API reference / Routines and triggers
Make a routine
Gives a teammate a routine to do by itself on some days of the week: once at a time, or every so many minutes from a time (every). With cron in the place of days, the routine runs on that cron expression. Each run's answer is posted to the routine's own conversation, unless notify is false. Every run uses the organization's AI plan, so this needs an owner or admin, and a routine may not run more often than the teammate's daily run limit allows.
/api/v1/routinesOther ways to call it
troopy routines createtroopy_create_routineIdempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.Body
application/jsonagent*stringThe teammate's handle, like chief
At most 40 characters
name*stringAt least 1 characters · At most 60 characters
task*stringWhat to do each time, as you'd tell the teammate
At least 1 characters · At most 1000 characters
daysarray<integer>Days of the week it runs on, 0 is Sunday. Send days, or cron
At most 7 items
hourintegerWhen it runs, or when it starts repeating (with every)
Default 0 · At least 0 · At most 23
minuteintegerDefault 0 · At least 0 · At most 59
everyinteger | nullMinutes between runs, from hour:minute to the end of each of its days (15, 30, 60, 120, 180, 240, 360 or 720). Null runs it once a day, at hour:minute
Default null
cronstring | nullA cron expression of five fields (minute, hour, day of the month, month, day of the week), like 0 7 * * 1, in the time zone of the routine. It takes numbers, *, lists, ranges and steps. Send it in the place of days, hour, minute and every. Null for a routine with days and a time
Default null
timezonestringThe time zone of its times, like Europe/Berlin. Without it, the time zone of the workspace
At most 64 characters
notifybooleanPost each result to the routine's conversation (true), or run quietly (false)
Default true
Response
201 · application/jsondata*object18 properties
id*stringA 24-character id
agent*stringname*stringtask*stringdays*array<integer>Days of the week it runs on, 0 is Sunday. Empty for a routine on a cron expression
hour*integerminute*integerevery*integer | nullMinutes between runs within a day; null runs once a day, at hour:minute
cron*string | nullIts cron expression, in its time zone. Then days, hour, minute and every say nothing. Null for a routine with days and a time
timezone*stringnotify*booleanWhether each result is posted to the routine's conversation. A quiet routine keeps its results in its runs only
paused*booleannextRunAt*string | nulllastRunAt*string | nulllastRunId*string | nulllastError*string | nullWhy the last time couldn't start
threadId*string | nullThe conversation each run's answer is posted to
createdAt*stringISO 8601 date and time