API reference
Assistant Routines & Events
The routines of your personal assistant - what it does on a schedule or when something happens (an email, a meeting ending, a track done, a webhook, ...), narrowed by filters and a condition in plain words - with their runs and the routines it suggests to you; and its event log: everything that happened that a routine can react to. Push events from your own systems into a webhook routine, and have a routine post its results back to your own address, signed. 22 endpoints. Add your API key in the authentication panel to send test requests from this page.
Read the event log
/api/external/v1/assistant/eventsThe latest events recorded for you, newest first: what happened that one of your routines listens to (events of a kind are recorded only while a routine of yours listens to it), kept 30 days. Each: id, kind, label, occurredAt, recordedAt, fromOutside (it came through a webhook or this API), routines (the titles of the routines that ran for it). Read one with its fields with GET /assistant/events/{eventId}.
Page with before: pass the previous page's next until it is null.
Errors: 400 UNKNOWN_EVENT_KIND, 400 INVALID_TIME, 403 FEATURE_NOT_ENABLED.
Parameters
kindstringqueryOnly events of this kind (see `GET /assistant/events/kinds`).
beforestringqueryISO-8601 time: only what was recorded before it (the previous page's `next`).
limitinteger (int32)queryEvents per page, 1 to 100 (40 by default).
Responses
200OK
Push an event from your system
/api/external/v1/assistant/eventsSends an event from your own system to one of your ON_WEBHOOK routines, exactly as a delivery to the routine's webhook address would - without a signature, since your API key says who sends. It is recorded in your event log for that routine alone, which runs for it on its next pass (within a minute or so) if its filters and condition let it.
Body:
routineId(required): the ON_WEBHOOK routine it is for;data: what happened, any JSON (an object, a list, or a text); at most 64 KB as JSON. Your assistant reads it as data, never as instructions;type: the event's type ("invoice.paid", "push"), which the routine'seventContainsfilter reads; else taken fromdata(event,type,event_type,action,nameortitle);eventId(oridempotencyKey, or anIdempotency-Keyheader): your own id of this event, at most 120 characters. The same id again is the same event: it is answered as aduplicatewith the event recorded the first time, and the routine does not run twice. Without one, every request is a new event.kind: ON_WEBHOOK (the default and the only kind taken from outside: the others are found in your workspace itself).
Answers 201 with the recorded event; 200 with duplicate true for an id sent before; 200 with active false when the routine is paused or still a suggestion (taken, not recorded, as its webhook does).
The routine's webhook limits hold for both ways in together: 120 deliveries a minute per routine, 2,000 webhook events a day for you; refusals are counted on the routine's webhook with their reason.
Errors: 400 MISSING_FIELD, 400 INVALID_ID, 400 UNKNOWN_EVENT_KIND, 400 KIND_NOT_PUSHABLE, 404 ROUTINE_NOT_FOUND, 409 ROUTINE_NOT_WEBHOOK (the routine is not set off by webhooks), 413 PAYLOAD_TOO_LARGE, 429 RATE_LIMITED, 429 DAILY_LIMIT, 503 EVENT_LOG_UNAVAILABLE, 403 FEATURE_NOT_ENABLED.
Request body application/json
object
Responses
200OK
Get one event
/api/external/v1/assistant/events/{eventId}One event with its fields: id, kind, ref (what it is about; a webhook's or a pushed event's delivery id is in it), occurredAt, label, payload (the fields routines filter on and your assistant reads; a webhook's or pushed event's event, body and kept headers), origin (SYSTEM or WEBHOOK), hookId, createdAt.
Errors: 404 EVENT_NOT_FOUND, 403 FEATURE_NOT_ENABLED.
Parameters
eventIdstring (uuid)pathRequired
Responses
200OK
List the kinds of events
/api/external/v1/assistant/events/kindsEverything a routine can be set off by, by group: each kind's kind (its name for triggerKind), shape (STREAM: found in your workspace as it happens; MOMENT: a time that comes, such as a meeting about to start; PUSHED: written when it happens), label, hint, and its filter fields (key, type TEXT, NUMBER or CHOICE, choices, min, max) for triggerFilter. Also conditionsAvailable (whether a condition in plain words can be checked for you now), hookPresets (who can send to a routine's webhook, and whether they sign), pushable (the kinds POST /assistant/events takes) and limits (maxRoutines, maxOpenSuggestions, maxCondition, maxRunsPerDay, webhookEventsPerDay).
Errors: 403 FEATURE_NOT_ENABLED.
Responses
200OK
List your assistant's routines
/api/external/v1/assistant/routinesEvery routine of yours, including the ones your assistant suggests and that wait for your yes (suggested true; they are off until you accept them). Each routine: id, title, instruction, triggerKind (SCHEDULE or an event kind from GET /assistant/events/kinds), the schedule (scheduleKind DAILY, WEEKDAYS, WEEKLY, MONTHLY or INTERVAL, scheduleTime HH:mm, scheduleDays, intervalMinutes, timezone), triggerFilter, condition, action (TELL, NOTE, WAKE, QUICK, WORK, AUTOMATION), automationId with automationName, delivery (SILENT, BRIEF, CHAT, MESSAGE, WEBHOOK) with deliveryUrl and deliverySecretSet, enabled, pausedReason, consecutiveFailures, maxRunsPerDay, lastRunAt, nextRunAt, lastRun, suggestionReason, automationOffer, and for an ON_WEBHOOK routine its hook (preset, whether it signs, counts of deliveries taken and refused, the last refusal's reason).
The hook's url is left out here (its last characters are in tokenHint): whoever has it can set the routine off. Read it with GET /assistant/routines/{id}/hook, which needs the permission to change routines.
Errors: 403 FEATURE_NOT_ENABLED.
Parameters
suggestedbooleanquerytrue: only the routines your assistant suggests; false: only yours; left out: all.
Responses
200OK
Create a routine
/api/external/v1/assistant/routinesMakes a routine, on unless enabled is false. Body (enum values by name, any case):
instruction(required): what your assistant should do when it runs, in plain words (up to 4,000 characters);title(else one is made from it);triggerKind: SCHEDULE (default) or an event kind fromGET /assistant/events/kinds(ON_EMAIL, ON_MEETING_ENDED, ON_TRACK_DONE, ON_WEBHOOK, ...);- for SCHEDULE:
scheduleKindDAILY (default), WEEKDAYS, WEEKLY, MONTHLY or INTERVAL;scheduleTimeHH:mm (08:00 by default);scheduleDaysfor WEEKLY (MONDAY,THURSDAY) or MONTHLY (1,15);intervalMinutesfor INTERVAL (15 to 10,080);timezone(an IANA zone; else yours); - for an event:
triggerFilter, an object of the kind's filter keys (fromContains,subjectContains,minImportance,leadMinutes, ...; every kind also takescontains), andcondition, a condition in plain words checked for each event before it runs (up to 600 characters); action: TELL (just tell you), NOTE (keep it for your assistant's next look), WAKE (your assistant decides now), QUICK (a quick background task), WORK (a full background task, the default) or AUTOMATION withautomationId(one of your automations, given the event as its input);delivery: where a run's result goes - SILENT, BRIEF (the app and your morning brief, the default), CHAT, MESSAGE, or WEBHOOK withdeliveryUrl: a public HTTPS address of yours the result is posted to, signed (seeGET /assistant/routines/{id}/delivery-secret);maxRunsPerDay: 1 to 48 (6 by default);- for ON_WEBHOOK:
hookPreset(who sends; GENERIC by default),signingSecret(the sender's, when it signs) andrequireSignature(take only signed deliveries).
Answers 201 with the routine, an ON_WEBHOOK routine's hook with its url. QUICK, WORK and WAKE runs use your plan's tasks and background check-ins as in the app; whatever a run does that reaches other people still waits for your approval.
Errors: 400 INVALID_ROUTINE (with the reason in message: an empty instruction, a time or zone that is not one, too many routines - at most 20 -, an automation that is not yours, ...), 400 DELIVERY_URL_NOT_ALLOWED (not a public HTTPS address, or one of this server's routine webhooks), 400 UNKNOWN_TRIGGER_KIND, UNKNOWN_SCHEDULE_KIND, UNKNOWN_ACTION, UNKNOWN_DELIVERY, UNKNOWN_HOOK_PRESET, INVALID_ID; 409 ROUTINES_UNAVAILABLE; 403 FEATURE_NOT_ENABLED.
Request body application/json
titlestringinstructionstringtriggerKindstringscheduleKindstringscheduleTimestringscheduleDaysstringintervalMinutesinteger (int32)timezonestringtriggerFilterobjectdeliverystringmaxRunsPerDayinteger (int32)enabledbooleanactionstringconditionstringautomationIdstringdeliveryUrlstringhookPresetstringsigningSecretstringrequireSignatureboolean
Responses
200OK
Get one routine
/api/external/v1/assistant/routines/{id}One routine (as listed, its hook's url left out) with its latest runs, newest first: each run's status (RUNNING, COMPLETED, FAILED, SKIPPED), action, triggerKind, triggerSummary, eventId, workRunId (the Work it started: GET /assistant/works/{id}), automationRunId, resultText, deliveredVia, error, startedAt, endedAt.
Errors: 404 ROUTINE_NOT_FOUND, 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequiredlimitinteger (int32)queryHow many runs, 1 to 100 (20 by default).
Responses
200OK
Change a routine
/api/external/v1/assistant/routines/{id}Changes only what is given, with the fields of POST /assistant/routines (enabled is not one: use pause and resume). condition "" removes the condition; deliveryUrl "" removes the address; signingSecret "" removes the sender's secret. Changing a routine's trigger makes it read events from now on, never from before. Answers 200 with the routine as it is now.
Errors: as when creating, and 404 ROUTINE_NOT_FOUND.
Parameters
idstring (uuid)pathRequired
Request body application/json
titlestringinstructionstringtriggerKindstringscheduleKindstringscheduleTimestringscheduleDaysstringintervalMinutesinteger (int32)timezonestringtriggerFilterobjectdeliverystringmaxRunsPerDayinteger (int32)enabledbooleanactionstringconditionstringautomationIdstringdeliveryUrlstringhookPresetstringsigningSecretstringrequireSignatureboolean
Responses
200OK
Delete a routine
/api/external/v1/assistant/routines/{id}Deletes the routine with its webhook (its address stops at once) and its history. Answers 204.
Errors: 404 ROUTINE_NOT_FOUND, 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Accept a suggested routine
/api/external/v1/assistant/routines/{id}/acceptSays yes to a routine your assistant suggested: it becomes yours and is switched on (an ON_WEBHOOK one gets its address now). A routine that is yours already is answered as it is. Answers 200 with the routine.
Errors: 404 ROUTINE_NOT_FOUND, 400 INVALID_ROUTINE (you have 20 routines already), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Dismiss an automation offer
/api/external/v1/assistant/routines/{id}/automation-offer/dismissWaves away the offer (automationOffer) to build a routine that always runs the same way as an automation: it is not made again for half a year. Answers 200 with the routine.
Errors: 404 ROUTINE_NOT_FOUND, 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Get a routine's result signing secret
/api/external/v1/assistant/routines/{id}/delivery-secretThe secret a routine with delivery WEBHOOK signs the results it posts to your deliveryUrl with. Each delivery carries X-Routine-Event: routine.run, X-Routine-Delivery (the run's id, the same on every attempt), X-Routine-Attempt, X-Routine-Timestamp (seconds) and X-Routine-Signature: sha256=<hex HMAC-SHA256(secret, timestamp + "." + body)>; check it before you trust a delivery. Needs the permission to change routines.
Errors: 404 ROUTINE_NOT_FOUND, 400 INVALID_ROUTINE (the routine sends its results to no address), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Replace a routine's result signing secret
/api/external/v1/assistant/routines/{id}/delivery-secret/rotateMakes a new secret for the results a WEBHOOK delivery posts: the old one stops fitting at once. Answers 200 with the new secret.
Errors: 404 ROUTINE_NOT_FOUND, 400 INVALID_ROUTINE (the routine sends its results to no address), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Dismiss a suggested routine
/api/external/v1/assistant/routines/{id}/dismissSays no to a routine your assistant suggested: it is deleted, and the same routine is not suggested again for half a year. Answers 200 with dismissed and the id.
Errors: 404 ROUTINE_NOT_FOUND, 400 INVALID_ROUTINE (the routine is yours, not a suggestion: delete it instead), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
List what became of a routine's events
/api/external/v1/assistant/routines/{id}/eventsThe latest events of the routine's kind (for a webhook routine: those that came through its own webhook) since it was made, newest first, each with what became of it: state RAN (with runId and runStatus), DID_NOT_FIT (its condition said no), FILTERED (its filters left it out) or NOT_RUN (not looked at yet, its condition not answered yet, or over its daily limit); and id, label, occurredAt, recordedAt, fromOutside. Empty for a SCHEDULE routine.
Errors: 404 ROUTINE_NOT_FOUND, 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequiredlimitinteger (int32)queryHow many events, 1 to 50 (20 by default).
Responses
200OK
Get a routine's webhook address
/api/external/v1/assistant/routines/{id}/hookThe webhook of an ON_WEBHOOK routine with its full url: give it to the service that should set the routine off (it POSTs there). Also preset (who sends: GENERIC, ZAPIER, MAKE, N8N, IFTTT, HOME_ASSISTANT, IOS_SHORTCUTS, GITHUB, STRIPE, SHOPIFY, CALENDLY, TYPEFORM), signs, requireSignature, secretSet, and the counts of deliveries taken and refused with the last refusal's reason. Needs the permission to change routines: whoever has the address can set the routine off.
Errors: 404 ROUTINE_NOT_FOUND, 404 NO_WEBHOOK (the routine is not set off by a webhook, or waits for your yes), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Give a routine a new webhook address
/api/external/v1/assistant/routines/{id}/hook/rotateMakes a new address for an ON_WEBHOOK routine: the old one stops working at once. Answers 200 with the routine, its hook.url the new address.
Errors: 404 ROUTINE_NOT_FOUND, 400 INVALID_ROUTINE (the routine has no webhook), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Send a test delivery to a routine
/api/external/v1/assistant/routines/{id}/hook/testRecords a test delivery to the routine's own webhook (event "test"): it goes through the routine's filters and condition and runs it on the next pass (within a minute or so), like a real delivery. Answers 200 with the test event's eventId.
Errors: 404 ROUTINE_NOT_FOUND, 400 INVALID_ROUTINE (no webhook, or the routine is paused), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Pause a routine
/api/external/v1/assistant/routines/{id}/pauseSwitches the routine off: it runs neither on its schedule nor for events, and its webhook takes deliveries without recording them. Answers 200 with the routine.
Errors: 404 ROUTINE_NOT_FOUND, 400 INVALID_ROUTINE (a suggested routine: accept it first), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Resume a routine
/api/external/v1/assistant/routines/{id}/resumeSwitches the routine on again (also one paused after five failures in a row). It reads events from now on: nothing that happened while it was off sets it off. Answers 200 with the routine and its nextRunAt.
Errors: 404 ROUTINE_NOT_FOUND, 400 INVALID_ROUTINE (a suggested routine: accept it first), 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
Run a routine now
/api/external/v1/assistant/routines/{id}/runStarts a run of the routine now, as its action says, within its daily limit (maxRunsPerDay) and never while a run of it is under way. Answers 200 with the run (status RUNNING while a task works; follow it with GET /assistant/routines/{id}/runs or its workRunId).
Errors: 404 ROUTINE_NOT_FOUND; 409 with the reason as code: ALREADY_RUNNING, DAILY_LIMIT, ROUTINES_UNAVAILABLE (also for a suggested routine), or the task's own (BUDGET, PLAN_PAUSED, PLAN_FEATURE, USAGE_BLOCKED, DISABLED, START_FAILED); 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequired
Responses
200OK
List a routine's runs
/api/external/v1/assistant/routines/{id}/runsThe routine's latest runs, newest first (see GET /assistant/routines/{id} for a run's fields).
Errors: 404 ROUTINE_NOT_FOUND, 403 FEATURE_NOT_ENABLED.
Parameters
idstring (uuid)pathRequiredlimitinteger (int32)queryHow many runs, 1 to 100 (20 by default).
Responses
200OK