Routines
Generated from api/openapi.yaml (OpenAPI 3.1). Base URL: https://api.teemli.com. Auth: Authorization: Bearer <token or tml_ API key>. Errors are application/problem+json; writes accept an Idempotency-Key header.
Standing work on a schedule, once, on an event (email, webhook, app event) or until a goal is met; run history
My routines (and those of AI employees I manage)
Section titled “My routines (and those of AI employees I manage)”GET /v1/orgs/{org}/routinesAPI keys: needs the agents:read scope.
| Parameter | In | Type | Description |
|---|---|---|---|
org (required) |
path | string (uuid) | The caller’s organisation id. |
agent_id |
query | string (uuid) | |
status |
query | active, paused, completed, all |
Default: everything but disabled |
Responses
200Routines, newest first — object401Missing, invalid or expired token — Problem
Create a routine with the form (no confirm card — it’s the person’s own act)
Section titled “Create a routine with the form (no confirm card — it’s the person’s own act)”POST /v1/orgs/{org}/routinesValidated as a whole: cron in the routine’s time zone (default the person’s), at least
TEEMLI_ROUTINE_MIN_INTERVAL_MINUTES apart; caps per person and per agent. Agents propose routines
with routine.create instead, which the person confirms on a setup_change card. Webhook routines
return webhook_url with its secret once.
API keys: needs the agents:write scope.
| Parameter | In | Type | Description |
|---|---|---|---|
org (required) |
path | string (uuid) | The caller’s organisation id. |
Request body (JSON)
| Field | Type | Description |
|---|---|---|
agent_id (required) |
string (uuid) | |
title |
string | |
instructions |
string | What to do on each run (each run is a new task) |
trigger |
schedule, once, event, goal |
|
cron |
string \ | null |
schedule_text |
string \ | null |
run_at |
string \ | null |
time_zone |
string \ | null |
event_source |
email, webhook, composio, null |
Slack/Teams phrases arrive with M5 |
composio_trigger |
string \ | null |
connection_id |
string \ | null (uuid) |
event_filter |
object \ | null |
goal |
string \ | null |
check_every_minutes |
integer \ | null |
give_up_after_days |
integer \ | null |
deliver_to |
task, conversation, null |
task (default) or also post the result in the agent’s chat |
Responses
201Created — object401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem
One routine
Section titled “One routine”GET /v1/orgs/{org}/routines/{routine}API keys: needs the agents:read scope.
| Parameter | In | Type | Description |
|---|---|---|---|
org (required) |
path | string (uuid) | The caller’s organisation id. |
routine (required) |
path | string (uuid) |
Responses
200The routine — Routine401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem
Change fields (validated as a whole), or pause/resume (status)
Section titled “Change fields (validated as a whole), or pause/resume (status)”PATCH /v1/orgs/{org}/routines/{routine}Resuming recomputes the next run and clears the failure count.
API keys: needs the agents:write scope.
| Parameter | In | Type | Description |
|---|---|---|---|
org (required) |
path | string (uuid) | The caller’s organisation id. |
routine (required) |
path | string (uuid) |
Request body (JSON)
| Field | Type | Description |
|---|---|---|
status |
active, paused |
|
title |
string | |
instructions |
string | What to do on each run (each run is a new task) |
trigger |
schedule, once, event, goal |
|
cron |
string \ | null |
schedule_text |
string \ | null |
run_at |
string \ | null |
time_zone |
string \ | null |
event_source |
email, webhook, composio, null |
Slack/Teams phrases arrive with M5 |
composio_trigger |
string \ | null |
connection_id |
string \ | null (uuid) |
event_filter |
object \ | null |
goal |
string \ | null |
check_every_minutes |
integer \ | null |
give_up_after_days |
integer \ | null |
deliver_to |
task, conversation, null |
task (default) or also post the result in the agent’s chat |
Responses
200The routine — Routine401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem
Delete (app-event routines also unsubscribe)
Section titled “Delete (app-event routines also unsubscribe)”DELETE /v1/orgs/{org}/routines/{routine}API keys: needs the agents:write scope.
| Parameter | In | Type | Description |
|---|---|---|---|
org (required) |
path | string (uuid) | The caller’s organisation id. |
routine (required) |
path | string (uuid) |
Responses
204Deleted401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem
Run now (a new task; the schedule is unchanged)
Section titled “Run now (a new task; the schedule is unchanged)”POST /v1/orgs/{org}/routines/{routine}/runAPI keys: needs the agents:run scope.
| Parameter | In | Type | Description |
|---|---|---|---|
org (required) |
path | string (uuid) | The caller’s organisation id. |
routine (required) |
path | string (uuid) |
Responses
202Started — open the task — object401Missing, invalid or expired token — Problem403Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem
Run history, newest first (each run is a task; skipped = over the event cap)
Section titled “Run history, newest first (each run is a task; skipped = over the event cap)”GET /v1/orgs/{org}/routines/{routine}/runsAPI keys: needs the agents:read scope.
| Parameter | In | Type | Description |
|---|---|---|---|
org (required) |
path | string (uuid) | The caller’s organisation id. |
routine (required) |
path | string (uuid) | |
limit |
query | integer | Page size. |
cursor |
query | string | Opaque cursor from a previous page’s next_cursor. |
Responses
200Runs — object401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem
New webhook secret (the old URL stops working); the URL is shown only now
Section titled “New webhook secret (the old URL stops working); the URL is shown only now”POST /v1/orgs/{org}/routines/{routine}/webhook-secretAPI keys: needs the agents:write scope.
| Parameter | In | Type | Description |
|---|---|---|---|
org (required) |
path | string (uuid) | The caller’s organisation id. |
routine (required) |
path | string (uuid) |
Responses
200The webhook URL — object401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem
Run a webhook routine (anything ≤ 64 KB; it reaches the agent as outside content)
Section titled “Run a webhook routine (anything ≤ 64 KB; it reaches the agent as outside content)”POST /v1/hooks/routines/{routine}/{secret}Auth: none (public endpoint).
| Parameter | In | Type | Description |
|---|---|---|---|
routine (required) |
path | string (uuid) | |
secret (required) |
path | string |
Responses
202Accepted (accepted: falsewhen the routine is paused) — object404Unknown routine or wrong secret
Run a webhook routine, with the secret in a header (for senders that can set one)
Section titled “Run a webhook routine, with the secret in a header (for senders that can set one)”POST /v1/hooks/routines/{routine}Same as the path form; the secret goes in X-Teemli-Webhook-Secret or Authorization: Bearer.
Auth: none (public endpoint).
| Parameter | In | Type | Description |
|---|---|---|---|
routine (required) |
path | string (uuid) | |
X-Teemli-Webhook-Secret |
header | string |
Responses
202Accepted (accepted: falsewhen the routine is paused) — object404Unknown routine or wrong secret
Composio trigger events (Standard Webhooks signature with the project secret)
Section titled “Composio trigger events (Standard Webhooks signature with the project secret)”POST /v1/hooks/composioAuth: none (public endpoint).
Responses
202Accepted401Bad signature404Not configured (COMPOSIO_WEBHOOK_SECRET unset)