Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Routines and triggers

Change a routine

Changes a routine's instructions or times, pauses or resumes it, or gives it to another teammate (agent). Send any of them. A cron takes the place of the days and the time, and days take the place of a cron. A routine that goes to another teammate starts a new conversation there. When it runs next is worked out again. Needs an owner or admin.

patch/api/v1/routines/{id}

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy routines update
MCP tooltroopy_update_routine
Rate limit30 calls in 60 seconds, for each key
RetriesSend an Idempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.

Path parameters

id*string

A 24-character id

Body

application/json
agentstring

The teammate that does the routine from now on

At most 40 characters

namestring

At least 1 characters · At most 60 characters

taskstring

What 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

At most 7 items

hourinteger

At least 0 · At most 23

minuteinteger

At least 0 · At most 59

everyinteger | null

Minutes 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

cronstring | null

A 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

timezonestring

IANA time zone the time is in, like Europe/Berlin

At most 64 characters

notifyboolean
pausedboolean

Response

200 · application/json
data*object
18 properties
id*string

A 24-character id

agent*string
name*string
task*string
days*array<integer>

Days of the week it runs on, 0 is Sunday. Empty for a routine on a cron expression

hour*integer
minute*integer
every*integer | null

Minutes between runs within a day; null runs once a day, at hour:minute

cron*string | null

Its cron expression, in its time zone. Then days, hour, minute and every say nothing. Null for a routine with days and a time

timezone*string
notify*boolean

Whether each result is posted to the routine's conversation. A quiet routine keeps its results in its runs only

paused*boolean
nextRunAt*string | null
lastRunAt*string | null
lastRunId*string | null
lastError*string | null

Why the last time couldn't start

threadId*string | null

The conversation each run's answer is posted to

createdAt*string

ISO 8601 date and time

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
404 not_foundCheck the path and any id in it. Every operation is listed in /api/v1/openapi.json.
409 conflictThis Idempotency-Key was used for a different request, or that request is still running. Use a new key for a new request.
429 rate_limitedWait the number of seconds in Retry-After, then retry.