Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Tasks and projects

Switch on a routine template

Gives the teammate of the role of a routine template its routine, at the days and time of the template in timezone. It hires the role first when nobody holds it. A template that is on already gives its routine as it is. Needs an owner or admin, and the services of the role connected. A ready skill, a built-in template and a trigger template give 400: POST /templates/{id}/trigger switches a trigger template on.

post/api/v1/templates/{id}/on

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 templates on
MCP tooltroopy_switch_on_template
Rate limit10 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 template's id, like weekly-brief or welcome-note. GET /templates lists them

At most 64 characters

Body

application/json
timezone*string

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

At most 64 characters

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.