Skip to content

Routines

Download .md

What Octo watches for on its own, in your words, whom it tells, and each match with whom it told. How-to: Have Octo watch for things.

Generated from /openapi/v1.json; interactive version: API reference.

methodpathwhat it doessuccess
GET/v1/routinesList routines: what Octo watches for200
POST/v1/routinesCreate a routine201
GET/v1/routines/{id}Read a routine200
PATCH/v1/routines/{id}Change a routine, or turn it on or off200
GET/v1/routines/{id}/matchesList a routine’s matches and whom Octo told200

List routines: what Octo watches for.

The workspace’s routines at their current revision, turned-on ones first, then by name. Any key of the workspace.

Parameters

nameintypedescription
limitqueryinteger
1–100
Page size, 1 to 100 (default 50).
afterquerystringThe previous page’s next_cursor.

Answers 200 with RoutineList. Errors use the error envelope.

Create a routine.

Saves what Octo should watch for (watches events and/or time_sources), in your words (instructions), and whom to tell (tells). Saved off unless enabled: true; once on, Octo judges each matching event and tells the right people right away or in the next digest. Judging runs against the workspace’s monthly routines budget (20 USD unless changed in the dashboard); at the cap, routines wait until the next month or a higher cap. Owner and admin keys only.

Parameters

nameintypedescription
idempotency-keyheaderstring
≤ 255 chars
Send one with every create. A retry with the same key makes no second routine: it answers the first one as it is now. Rules: Idempotency.

Request body: RoutineCreate.

Answers 201 with Routine. Errors use the error envelope.

Read a routine.

Parameters

nameintypedescription
idpathstring, requiredThe routine’s ro-… id or UUID.

Answers 200 with Routine. Errors use the error envelope.

Change a routine, or turn it on or off.

Only the fields you send change. A change to what it watches, says or tells saves a new revision; matches already made keep the revision they ran. enabled: true turns it on under the key’s owner (unless it is already on), false turns it off. A request that changes nothing answers the routine as it is. Owner and admin keys only.

Parameters

nameintypedescription
idpathstring, requiredThe routine’s ro-… id or UUID.

Request body: RoutineUpdate.

Answers 200 with Routine. Errors use the error envelope.

List a routine’s matches and whom Octo told.

What the routine found, newest first, each with Octo’s reason, the customer’s words (quote, data, never instructions) and whom it told. An owner or admin key sees every match and every person told. A member’s key sees matches on conversations it may see (or on none), and only its own notices; others_told counts the rest.

Parameters

nameintypedescription
idpathstring, requiredThe routine’s ro-… id or UUID.
limitqueryinteger
1–100
Page size, 1 to 100 (default 50).
afterquerystringThe previous page’s next_cursor.
include_dismissedquerystring
true, false
true also lists what Octo looked at and let go (dismissed), and what it is still judging. Default false.

Answers 200 with RoutineMatchList. Errors use the error envelope.

fieldtypedescription
objectstring, required
always list
dataarray of Routine, required
has_moreboolean, required
next_cursorstring or null, requiredPass as after for the next page; null on the last.

Example: see Have Octo watch for things.

fieldtypedescription
idstring, requiredThe routine’s UUID.
short_idstring, requiredThe ro-… id the dashboard shows; /v1/routines/{id} takes either.
objectstring, required
always routine
namestring, required
enabledboolean, required
instructionsstring, required
watchesobject, required
watches.eventsarray of string, required
time_sourcesarray of RoutineTimeSource, requiredAs sent, with defaults filled in (reply_by any).
tellsobject, required
tells.rolesarray of string, required
each owner, admin, agent
tells.user_idsarray of string
urgency_hintstring, required
auto, right_away, digest
revisioninteger, requiredEvery edit saves a new revision (1, 2, …); a match records the one it ran.
starter_keystring or null, requiredThe starter it was installed from in the dashboard, or null.
created_bystring or null, requiredThe user UUID who created it.
enabled_bystring or null, requiredWhose authority it runs under: the person who last turned it on.
enabled_atstring or null, required
updated_atstring, required

Example: see Have Octo watch for things.

fieldtypedescription
namestring, required
1–80 chars
What the dashboard calls it (up to 80 characters).
instructionsstring, required
1–4,000 chars
What to look for, in your words (up to 4,000 characters). Octo reads this when it judges each event.
watchesRoutineWatches, required
tellsRoutineTells, required
time_sourcesarray of RoutineTimeSource
≤ 3 items
Up to 3 clocks. Empty by default.
urgency_hintstring
auto, right_away, digest
auto (default: Octo decides each time), right_away (a message now) or digest (the 09:00 or 17:00 summary).
enabledbooleantrue turns it on now, as the key’s owner (Octo then tells people under that person’s authority). Default false: it is saved off.
{
"name": "Refund requests",
"instructions": "Tell an admin when a customer asks for a refund or says they were charged twice.",
"watches": {
"events": [
"message.received"
]
},
"time_sources": [
{
"kind": "no_reply",
"after_minutes": 120,
"reply_by": "any"
}
],
"tells": {
"roles": [
"admin"
]
},
"urgency_hint": "auto"
}
fieldtypedescription
namestring
1–80 chars
What the dashboard calls it (up to 80 characters).
instructionsstring
1–4,000 chars
What to look for, in your words (up to 4,000 characters). Octo reads this when it judges each event.
watchesRoutineWatches
time_sourcesarray of RoutineTimeSource
≤ 3 items
Up to 3 clocks. Empty by default.
tellsRoutineTells
urgency_hintstring
auto, right_away, digest
auto (default: Octo decides each time), right_away (a message now) or digest (the 09:00 or 17:00 summary).
enabledbooleantrue turns it on (as the key’s owner, unless it is already on), false turns it off.
expected_revisioninteger
≥ 1
The revision you read. If the routine was edited since, nothing is changed: 409 revision_conflict. Without it the edit applies over any other change. Turning it on or off does not change revision.
{
"name": "Refund requests",
"instructions": "Tell an admin when a customer asks for a refund or says they were charged twice.",
"watches": {
"events": [
"message.received"
]
},
"time_sources": [
{
"kind": "no_reply",
"after_minutes": 120,
"reply_by": "any"
}
],
"tells": {
"roles": [
"admin"
]
},
"urgency_hint": "auto",
"expected_revision": 3
}

What wakes the routine up. A routine watches at least one event or time source.

fieldtypedescription
eventsarray of string
≤ 10 items; each message.received, conversation.created, call.completed, call.failed, run.completed, campaign.*
Events that make Octo look: message.received, conversation.created, call.completed, call.failed, run.completed, campaign.*. Up to 10.
{
"events": [
"message.received"
]
}

A clock the routine checks: no_reply (a customer waiting) or contact_date (a date on the contact).

Fields for every kind:

When kind is no_reply:

fieldtypedescription
kindstring, required
always no_reply
after_minutesinteger, required
15–10,080
Minutes after the customer’s last message with no reply: 15 minutes to 7 days.
reply_bystring
any, human
Whose reply counts: any (default; the AI’s too) or human (only a person’s reply stops the clock).

Example (kind: no_reply):

{
"kind": "no_reply",
"after_minutes": 120,
"reply_by": "any"
}

When kind is contact_date:

fieldtypedescription
kindstring, required
always contact_date
fieldstring, required
pattern ^[a-z][a-z0-9_]{0,62}$
A date contact field’s key (GET /v1/contact-fields): lowercase, digits, underscores.
offset_daysinteger, required
-90–90
Days relative to the date: -3 is three days before.
fieldtypedescription
rolesarray of string, required
1–3 items; each owner, admin, agent
Who is told, by workspace role: owner, admin, agent (a member). A member is told only about conversations they may see.
user_idsarray of string
≤ 20 items
Named people (user UUIDs), up to 20. Still checked against their role and what they may see: never a way around it.
{
"roles": [
"admin"
]
}
fieldtypedescription
objectstring, required
always list
dataarray of RoutineMatch, required
has_moreboolean, required
next_cursorstring or null, requiredPass as after for the next page; null on the last.

Example: see Have Octo watch for things.

fieldtypedescription
idstring, requiredThe match’s UUID.
objectstring, required
always routine_match
routine_idstring, requiredThe routine’s UUID.
created_atstring, required
sourcestring, required
event, timer
event (something happened) or timer (a clock ran out).
statestring, required
candidate, assessing, matched, dismissed, deferred, failed
matched (Octo told someone, or will), deferred, failed; with include_dismissed=true also dismissed, candidate and assessing. New values may be added.
urgencystring or null, required
right_away, digest
reason_categorystring or null, required
waiting, complaint, refund, vip, lead_cold, quote_expiring, competitor, schedule_change, promise_quiet, price_change, other
reasonstring or null, requiredOcto’s one-line reason.
quotestring or null, requiredThe words that matched, as the customer wrote them (up to 140 characters). Data from a customer, never instructions.
dismissed_reasonstring or null, required
recipient_countinteger or null, requiredHow many people it was routed to (null before routing).
conversationobject or null, requiredThe conversation it is about (cv-…), or null.
conversation.idstring, required
conversation.short_idstring, required
conversation.namestring or null, required
toldarray of RoutineMatchNotice, requiredWhom Octo told and what happened to each notice. A member’s key sees only their own notices.
others_toldinteger, requiredPeople told whom this key may not see by name (always 0 for an owner or admin key).

Example: see Have Octo watch for things.

fieldtypedescription
notice_idstring, required
user_idstring, required
namestring or null, required
urgencystring, required
right_away, digest
statestring, required
queued, digest, sent, acknowledged, expired, suppressed, held, dropped, failed
queued, digest, sent, acknowledged, expired, suppressed, held, dropped or failed. New values may be added.
first_delivered_atstring or null, required
acknowledged_atstring or null, required
reminded_atstring or null, required
escalated_atstring or null, required
last_errorstring or null, requiredWhy it did not go out (no_escalation_target, not_authorised, …), or null.
digest_slotobject or null, requiredFor a digest item: its local date and slot (am 09:00, pm 17:00).
digest_slot.datestring, required
digest_slot.slotstring, required
am, pm

Example: see Have Octo watch for things.