5 minutes to help shape OpenTodo. Anonymous, no account. Take the survey

Routines API

A routine's steps is an ordered list of at most 20 steps (counted across blocks, at most 3 block levels, 32 KB): {id, kind, in: {name: {ref} | {literal}}, then?, otherwise?, do?}.

Implementation notes

A routine's steps is an ordered list of at most 20 steps (counted across blocks, at most 3 block levels, 32 KB): {id, kind, in: {name: {ref} | {literal}}, then?, otherwise?, do?}. id is 1 to 8 characters a-z0-9, unique (trigger and item are reserved); a ref names trigger, an earlier step visible from the step, or item inside a Repeat's do. The step kinds, their inputs and output types are listed by the catalogue route and in routines.md. Steps read tasks from the trigger or earlier steps: an input that takes one task (add_comment.task, start_timer.task, notify.task, note_text.of, append_to_note.of, clear_note.of, create_tasks.parent) and receives a list runs once per task (OpenSpec routines-dynamic-data). A task literal {"task": id} (on add_comment, start_timer, notify and get_task) is for rare fixed targets. take is Pick: from start (default), end or all, and n (default 1, ignored with all); filter is Pick's "where". of also takes {"project": id}. date outputs a Date (date: today by default, tomorrow, {"in_days": n} or YYYY-MM-DD); project_of outputs a task's project (the Inbox, an empty id, for a task without one); create_tasks.parent makes subtasks and refuses a project next to it; split_lines.only: "open_checkboxes" keeps only - [ ] … lines; find_tasks with a query or view finds completed tasks when the query names completed or open (a condition finds open tasks); in every form it never finds a task in the Trash or of a project in the Trash, and leaves out tasks of archived projects unless archived is {"literal": true} (OpenSpec routines-find-scope; the matching tasks of a schedule trigger with a condition follow the same rule). A schedule trigger takes weekdays or month_days (1 to 31 and "last"; a day a month lacks does not fire that month), exactly one; a condition may hold unchanged: {days: 1..365} (no field of the task changed in that many days). A routine is type-checked like the app does (400 invalid_input names the step and input, for example step b: notify: text expects Text, got Tasks), and every id inside it is resolved.

POST /api/v1/assistant/routine-draft

Assistant routine draft · Session only

{text} (at most 500 characters) → {draft, note, errors, warnings, usage}: Describe it (OpenSpec routines-describe-it). One assistant turn drafts a routine with the one tool draft_routine; the model gets the steps available to you and the names and ids of your projects (not archived), their sections, labels, saved views and enabled webhooks (by host) as untrusted text. The draft ({name, trigger, condition, steps}, or null when the model answered in words, then in note) is checked like a create plus the draft rules (no task chosen by hand: no get_task, no {"task": id}; only available steps, else unavailable); when it does not check, the errors go back to the model once, and errors lists what still does not ([{step?, input?, code, message}]). Nothing is saved, enabled, tested or run, and a draft never holds ai_apply. usage is {input, cached, cache_write, output, month_total, cap, own_key} as for a turn; the tokens count toward the assistant allowance and GET /api/v1/me/assistant/usage lists them as drafts. 404 not_found while the assistant is off, 409 encryption_enabled for an encrypted account (it drafts on its device), 403 consent_required, 413 too_large, 429 assistant_quota at the cap (with resets_at), 409 turn_in_progress while another answer runs, 429 rate_limited after 10 drafts in an hour, 422 ai_refused/ai_truncated, provider errors as for a turn (502, 504 timeout)

Needs a session; tokens are refused.

Request body
FieldTypeDescription
text requiredstring
Response 200
FieldTypeDescription
draft requiredobject | null
draft.condition requiredstring
draft.name requiredstring
draft.steps requiredstring
draft.trigger requiredstring
errors requiredarray of object
errors[].code requiredstring
errors[].inputstring
errors[].message requiredstring
errors[].stepstring
note requiredstring
usage requiredobject
usage.cache_write requirednumber
usage.cached requirednumber
usage.cap requirednumber
usage.input requirednumber
usage.month_total requirednumber
usage.output requirednumber
usage.own_key requiredboolean
warnings requiredarray of object
warnings[].kind requiredstring
warnings[].message requiredstring
warnings[].reason requiredstring
warnings[].settingstring
warnings[].step requiredstring

GET /api/v1/me/rules/catalogue

Get me rules catalogue · Token or session

{steps: [{kind, group, inputs, output, content, needs?, available, reason?, setting?}]}: every step kind and whether you can use it now

Response 200
FieldTypeDescription
steps requiredarray of object
steps[].available requiredboolean
steps[].blocksarray of string
steps[].content requiredboolean
steps[].group requiredstring
steps[].inputs requiredarray of object
steps[].inputs[].accepts requiredarray of string
steps[].inputs[].contentboolean
steps[].inputs[].enumarray of string
steps[].inputs[].literalstring
steps[].inputs[].maxnumber
steps[].inputs[].name requiredstring
steps[].inputs[].requiredboolean
steps[].kind requiredstring
steps[].needsstring
steps[].one_ofarray of array of string
steps[].output requiredstring
steps[].reasonstring
steps[].same_asstring
steps[].settingstring
steps[].toolstring

GET /api/v1/me/rules/proposals

List me rules proposals · Token or session

{proposals: [{id, rule_id, run_id, created_at, expires_at, state, items, applied, skipped, encrypted}]}: your waiting proposals, newest first

Refuses read and agent tokens.

Response 200
FieldTypeDescription
proposals requiredarray of object
proposals[].applied requirednumber
proposals[].created_at requirednumber
proposals[].encrypted requiredboolean
proposals[].envelopestring
proposals[].expires_at requirednumber
proposals[].id requiredstring
proposals[].items requirednumber
proposals[].listarray of object
proposals[].list[].ai requiredboolean
proposals[].list[].beforeobject
proposals[].list[].entitystring
proposals[].list[].fieldsobject
proposals[].list[].idstring
proposals[].list[].key requiredstring
proposals[].list[].kind requiredstring
proposals[].list[].sideobject | null
proposals[].rule_id requiredstring
proposals[].run_id requiredstring
proposals[].skipped requirednumber
proposals[].state requiredstring

GET /api/v1/me/rules/proposals/{id}

Get a me rules proposal · Token or session

one proposal; while waiting it carries list: [{key, kind, entity?, id?, fields?, before?, ai, side?}] (kind is create, change, notify, webhook or email; before the values the change was planned on; ai marks text the AI wrote), or for an encrypted account envelope

Refuses read and agent tokens.

Path parameters
FieldTypeDescription
id requiredstringpath
Response 200
FieldTypeDescription
applied requirednumber
created_at requirednumber
encrypted requiredboolean
envelopestring
expires_at requirednumber
id requiredstring
items requirednumber
listarray of object
list[].ai requiredboolean
list[].beforeobject
list[].entitystring
list[].fieldsobject
list[].idstring
list[].key requiredstring
list[].kind requiredstring
list[].sideobject | null
list[].side.daystring
list[].side.deliveryobject | null
list[].side.firedobject | null
list[].side.hookstring
list[].side.kind requiredstring
list[].side.mailobject | null
list[].side.membersarray of string
list[].side.noticeobject | null
list[].side.projectstring
rule_id requiredstring
run_id requiredstring
skipped requirednumber
state requiredstring

DELETE /api/v1/me/rules/proposals/{id}

Delete a me rules proposal · Token or session

→ 204: dismisses a waiting proposal and deletes its body; 409 proposal_closed otherwise

Refuses read and agent tokens.

Path parameters
FieldTypeDescription
id requiredstringpath

Response 200: OK

POST /api/v1/me/rules/proposals/{id}/apply

Me rules proposal apply · Token or session

{items?: [key, …]} (all when left out) → {state, applied, skipped, changed, refused, run_id, rule_id}: writes the items with device rule:<rule-id>, recorded on the run (Undo run takes them back); an item whose target was deleted or whose field changed since is skipped and counted (changed); 409 proposal_closed once applied, dismissed or expired; 409 encrypted for an encrypted account's proposal sent with items: a device decrypts its envelope, re-checks the items and sends the ticked ones as {changes, completing?, sides?, skipped?, changed?} in the commit route's form (ciphertext only, 400 plaintext otherwise)

Refuses read and agent tokens.

Path parameters
FieldTypeDescription
id requiredstringpath
Request body
FieldTypeDescription
changed requirednumber
changes requiredarray of object
changes[].createboolean
changes[].entity requiredstring
changes[].fields requiredobject
changes[].id requiredstring
completing requiredarray of string
itemsarray of string
sides requiredarray of object
sides[].kind requiredstring
sides[].step requiredstring
sides[].taskstring
sides[].tasksarray of string
sides[].textstring
sides[].webhookstring
skipped requirednumber
Response 200
FieldTypeDescription
applied requirednumber
changed requirednumber
refused requirednumber
rule_id requiredstring
run_id requiredstring
skipped requirednumber
state requiredstring

GET /api/v1/me/rules/runs

List me rules runs · Token or session

?outcome=&source=&rule=&limit=&before= → {runs, before?}: every routine's runs, newest first (limit 1 to 100, default 50; before is the last run's id to page back)

Response 200
FieldTypeDescription
beforenumber
hide_successesboolean
runs requiredarray of object
runs[].ai_auto requiredboolean
runs[].at requirednumber
runs[].blocksarray of object
runs[].blocks[].datestring
runs[].blocks[].fromstring
runs[].blocks[].idsarray of string
runs[].blocks[].kind requiredstring
runs[].blocks[].spanstring
runs[].blocks[].tostring
runs[].changes requiredstring
runs[].depth requirednumber
runs[].device_idstring
runs[].duration_ms requirednumber
runs[].failed_step requirednumber
runs[].id requirednumber
runs[].kindstring
runs[].note_idstring
runs[].occurrence requiredstring
runs[].outcome requiredstring
runs[].project_idstring
runs[].proposalobject | null
runs[].proposal.applied requirednumber
runs[].proposal.created_at requirednumber
runs[].proposal.encrypted requiredboolean
runs[].proposal.envelopestring
runs[].proposal.expires_at requirednumber
runs[].proposal.id requiredstring
runs[].proposal.items requirednumber
runs[].proposal.listarray of object
runs[].proposal.rule_id requiredstring
runs[].proposal.run_id requiredstring
runs[].proposal.skipped requirednumber
runs[].proposal.state requiredstring
runs[].reasonstring
runs[].rule_id requiredstring
runs[].run_as requiredstring
runs[].run_id requiredstring
runs[].source requiredstring
runs[].stepsarray of object
runs[].steps[].duration_ms requirednumber
runs[].steps[].errorstring
runs[].steps[].ids requiredarray of string
runs[].steps[].index requirednumber
runs[].steps[].items requirednumber
runs[].steps[].kind requiredstring
runs[].steps[].output requiredstring
runs[].steps[].status requiredstring
runs[].steps[].step_id requiredstring
runs[].steps[].tokensnumber
runs[].steps_count requirednumber
runs[].task_idstring
runs[].test requiredboolean
runs[].tokens requirednumber
runs[].undone_at requirednumber | null
runs[].writes requirednumber
seen_atnumber

POST /api/v1/me/rules/runs/{run}/commit

Me rules run commit · Session only

a device run's result: {steps, outcome?, duration_ms?, tokens?, changes?: [{entity, id, create?, fields}], completing?: [task id], sides?: [{kind: "notify", step, text?, task?} | {kind: "fired", task} | {kind: "webhook", step, webhook, tasks?}], proposal?: {envelope, items}, blocks?: [block]} → {run, steps, writes, test}. blocks are the run's blocks (below), at most 4 (400 invalid_input otherwise). Content fields and a notice's text must be ciphertext (400 plaintext). 403 forbidden from another session than the one the run was sent to, 409 run_closed once it was committed, failed or missed, 409 routine_changed when the routine changed since it was sent (the run is recorded failed), 409 fallback when a routine with an AI step is not in auto mode or the result breaks auto mode's limits (commit a proposal instead), 400 write_limit past 500 items; nothing is written in each case

Needs a session; tokens are refused.

Path parameters
FieldTypeDescription
run requiredstringpath
Request body
FieldTypeDescription
blocks requiredarray of object
blocks[].datestring
blocks[].fromstring
blocks[].idsarray of string
blocks[].kind requiredstring
blocks[].spanstring
blocks[].tostring
changes requiredarray of object
changes[].createboolean
changes[].entity requiredstring
changes[].fields requiredobject
changes[].id requiredstring
completing requiredarray of string
duration_ms requirednumber
outcome requiredstring
proposalobject | null
proposal.envelope requiredstring
proposal.items requirednumber
sides requiredarray of object
sides[].kind requiredstring
sides[].step requiredstring
sides[].taskstring
sides[].tasksarray of string
sides[].textstring
sides[].webhookstring
steps requiredarray of object
steps[].duration_ms requirednumber
steps[].errorstring
steps[].ids requiredarray of string
steps[].index requirednumber
steps[].items requirednumber
steps[].kind requiredstring
steps[].output requiredstring
steps[].status requiredstring
steps[].step_id requiredstring
steps[].tokensnumber
tokens requirednumber
Response 200
FieldTypeDescription
device_runobject | null
device_run.at requirednumber
device_run.auto requiredboolean
device_run.budget requirednumber
device_run.notestring
device_run.occurrence requiredstring
device_run.op requiredstring
device_run.rev requiredstring
device_run.rule requiredstring
device_run.run requiredstring
device_run.taskstring
device_run.tokens requirednumber
run requiredobject
run.ai_auto requiredboolean
run.at requirednumber
run.blocksarray of object
run.blocks[].datestring
run.blocks[].fromstring
run.blocks[].idsarray of string
run.blocks[].kind requiredstring
run.blocks[].spanstring
run.blocks[].tostring
run.changes requiredstring
run.depth requirednumber
run.device_idstring
run.duration_ms requirednumber
run.failed_step requirednumber
run.id requirednumber
run.note_idstring
run.occurrence requiredstring
run.outcome requiredstring
run.project_idstring
run.proposalobject | null
run.proposal.applied requirednumber
run.proposal.created_at requirednumber
run.proposal.encrypted requiredboolean
run.proposal.envelopestring
run.proposal.expires_at requirednumber
run.proposal.id requiredstring
run.proposal.items requirednumber
run.proposal.listarray of object
run.proposal.rule_id requiredstring
run.proposal.run_id requiredstring
run.proposal.skipped requirednumber
run.proposal.state requiredstring
run.reasonstring
run.rule_id requiredstring
run.run_as requiredstring
run.run_id requiredstring
run.source requiredstring
run.stepsarray of object
run.steps[].duration_ms requirednumber
run.steps[].errorstring
run.steps[].ids requiredarray of string
run.steps[].index requirednumber
run.steps[].items requirednumber
run.steps[].kind requiredstring
run.steps[].output requiredstring
run.steps[].status requiredstring
run.steps[].step_id requiredstring
run.steps[].tokensnumber
run.steps_count requirednumber
run.task_idstring
run.test requiredboolean
run.tokens requirednumber
run.undone_at requirednumber | null
run.writes requirednumber
steps requiredarray of object
steps[].changesarray of object
steps[].changes[].baseobject
steps[].changes[].createboolean
steps[].changes[].entity requiredstring
steps[].changes[].entityId requiredstring
steps[].changes[].patch requiredobject
steps[].duration_ms requirednumber
steps[].errorstring
steps[].estimatenumber
steps[].ids requiredarray of string
steps[].index requirednumber
steps[].items requirednumber
steps[].kind requiredstring
steps[].output requiredstring
steps[].previewstring | number | array of string | object | array of objectA preview of the step's output, by its type: text and a date are a string, lines a list of strings, a number a number, a task or a note {id, title}, a project {id, name}, tasks or notes a list of {id, title}.
steps[].status requiredstring
steps[].step_id requiredstring
steps[].tokensnumber
steps[].warningobject | null
steps[].warning.kind requiredstring
steps[].warning.message requiredstring
steps[].warning.reason requiredstring
steps[].warning.settingstring
steps[].warning.step requiredstring
test requiredboolean
writes requirednumber

POST /api/v1/me/rules/runs/{run}/fail

Me rules run fail · Session only

{step, code, steps?, duration_ms?, tokens?} → {run}: the device could not finish; the run is recorded failed with code

Needs a session; tokens are refused.

Path parameters
FieldTypeDescription
run requiredstringpath
Request body
FieldTypeDescription
code requiredstring
duration_ms requirednumber
step requirednumber
steps requiredarray of object
steps[].duration_ms requirednumber
steps[].errorstring
steps[].ids requiredarray of string
steps[].index requirednumber
steps[].items requirednumber
steps[].kind requiredstring
steps[].output requiredstring
steps[].status requiredstring
steps[].step_id requiredstring
steps[].tokensnumber
tokens requirednumber
Response 200
FieldTypeDescription
run requiredobject
run.ai_auto requiredboolean
run.at requirednumber
run.blocksarray of object
run.blocks[].datestring
run.blocks[].fromstring
run.blocks[].idsarray of string
run.blocks[].kind requiredstring
run.blocks[].spanstring
run.blocks[].tostring
run.changes requiredstring
run.depth requirednumber
run.device_idstring
run.duration_ms requirednumber
run.failed_step requirednumber
run.id requirednumber
run.note_idstring
run.occurrence requiredstring
run.outcome requiredstring
run.project_idstring
run.proposalobject | null
run.proposal.applied requirednumber
run.proposal.created_at requirednumber
run.proposal.encrypted requiredboolean
run.proposal.envelopestring
run.proposal.expires_at requirednumber
run.proposal.id requiredstring
run.proposal.items requirednumber
run.proposal.listarray of object
run.proposal.rule_id requiredstring
run.proposal.run_id requiredstring
run.proposal.skipped requirednumber
run.proposal.state requiredstring
run.reasonstring
run.rule_id requiredstring
run.run_as requiredstring
run.run_id requiredstring
run.source requiredstring
run.stepsarray of object
run.steps[].duration_ms requirednumber
run.steps[].errorstring
run.steps[].ids requiredarray of string
run.steps[].index requirednumber
run.steps[].items requirednumber
run.steps[].kind requiredstring
run.steps[].output requiredstring
run.steps[].status requiredstring
run.steps[].step_id requiredstring
run.steps[].tokensnumber
run.steps_count requirednumber
run.task_idstring
run.test requiredboolean
run.tokens requirednumber
run.undone_at requirednumber | null
run.writes requirednumber

GET /api/v1/rules/{id}/ai-usage

Get rule ai usage · Token or session

{days: [{day, tokens}], budget, mode}: the routine's AI tokens of the last 7 UTC days, its daily budget and its ai_mode (null without AI steps)

Path parameters
FieldTypeDescription
id requiredstringpath
Response 200
FieldTypeDescription
budget requirednumber
days requiredarray of object
days[].day requiredstring
days[].tokens requirednumber
mode requiredobject
mode.asked requiredboolean
mode.at requirednumber
mode.auto requiredboolean
mode.blocked requiredobject
mode.blocked.step requiredstring
mode.blocked.what requiredstring
mode.reason requiredstring

POST /api/v1/rules/{id}/run

Rule run · Token or session

{run_id, task_id?, note_id?, test?, call_ai?, device?} → {run, steps, writes, test, device_run?}. note_id is the standalone note a routine triggered by a note, or run on a note (trigger: {kind: "manual", on: "note"}), runs on: 400 note_required without it or with a task_id instead, 400 invalid_input with both; the run then carries note_id instead of task_id. run_id is your UUID: the same value answers the first run again. test: true plans, logs a test run and writes nothing; its AI steps call the model only with call_ai: true (otherwise they answer nothing and carry their estimate of tokens). A disabled routine can be run; 409 paused while the server paused it, 409 automations_off when the owner turned automations off, 400 task_required when its steps read the trigger's task and task_id is missing, 429 rate_limited past 60 runs a minute (nothing is queued). On an encrypted account a routine with text or AI steps runs on a device (below): device (session cookies only) runs it on the calling device, which gets device_run (the routine.run request) and commits it; without device it is sent to an opted-in device

Path parameters
FieldTypeDescription
id requiredstringpath
Request body
FieldTypeDescription
call_ai requiredboolean
device requiredstring
note_id requiredstring
run_id requiredstring
task_id requiredstring
test requiredboolean
Response 200
FieldTypeDescription
device_runobject | null
device_run.at requirednumber
device_run.auto requiredboolean
device_run.budget requirednumber
device_run.notestring
device_run.occurrence requiredstring
device_run.op requiredstring
device_run.rev requiredstring
device_run.rule requiredstring
device_run.run requiredstring
device_run.taskstring
device_run.tokens requirednumber
run requiredobject
run.ai_auto requiredboolean
run.at requirednumber
run.blocksarray of object
run.blocks[].datestring
run.blocks[].fromstring
run.blocks[].idsarray of string
run.blocks[].kind requiredstring
run.blocks[].spanstring
run.blocks[].tostring
run.changes requiredstring
run.depth requirednumber
run.device_idstring
run.duration_ms requirednumber
run.failed_step requirednumber
run.id requirednumber
run.note_idstring
run.occurrence requiredstring
run.outcome requiredstring
run.project_idstring
run.proposalobject | null
run.proposal.applied requirednumber
run.proposal.created_at requirednumber
run.proposal.encrypted requiredboolean
run.proposal.envelopestring
run.proposal.expires_at requirednumber
run.proposal.id requiredstring
run.proposal.items requirednumber
run.proposal.listarray of object
run.proposal.rule_id requiredstring
run.proposal.run_id requiredstring
run.proposal.skipped requirednumber
run.proposal.state requiredstring
run.reasonstring
run.rule_id requiredstring
run.run_as requiredstring
run.run_id requiredstring
run.source requiredstring
run.stepsarray of object
run.steps[].duration_ms requirednumber
run.steps[].errorstring
run.steps[].ids requiredarray of string
run.steps[].index requirednumber
run.steps[].items requirednumber
run.steps[].kind requiredstring
run.steps[].output requiredstring
run.steps[].status requiredstring
run.steps[].step_id requiredstring
run.steps[].tokensnumber
run.steps_count requirednumber
run.task_idstring
run.test requiredboolean
run.tokens requirednumber
run.undone_at requirednumber | null
run.writes requirednumber
steps requiredarray of object
steps[].changesarray of object
steps[].changes[].baseobject
steps[].changes[].createboolean
steps[].changes[].entity requiredstring
steps[].changes[].entityId requiredstring
steps[].changes[].patch requiredobject
steps[].duration_ms requirednumber
steps[].errorstring
steps[].estimatenumber
steps[].ids requiredarray of string
steps[].index requirednumber
steps[].items requirednumber
steps[].kind requiredstring
steps[].output requiredstring
steps[].previewstring | number | array of string | object | array of objectA preview of the step's output, by its type: text and a date are a string, lines a list of strings, a number a number, a task or a note {id, title}, a project {id, name}, tasks or notes a list of {id, title}.
steps[].status requiredstring
steps[].step_id requiredstring
steps[].tokensnumber
steps[].warningobject | null
steps[].warning.kind requiredstring
steps[].warning.message requiredstring
steps[].warning.reason requiredstring
steps[].warning.settingstring
steps[].warning.step requiredstring
test requiredboolean
writes requirednumber

GET /api/v1/rules/{id}/runs/{run}

Get a rule run · Token or session

one run with steps (index, step_id, kind, status: ok, skipped, ended, failed, unavailable or truncated, duration_ms, items, output, ids (at most 50), error)

Path parameters
FieldTypeDescription
id requiredstringpath
run requiredstringpath
Response 200
FieldTypeDescription
ai_auto requiredboolean
at requirednumber
blocksarray of object
blocks[].datestring
blocks[].fromstring
blocks[].idsarray of string
blocks[].kind requiredstring
blocks[].spanstring
blocks[].tostring
changes requiredstring
depth requirednumber
device_idstring
duration_ms requirednumber
failed_step requirednumber
id requirednumber
note_idstring
occurrence requiredstring
outcome requiredstring
project_idstring
proposalobject | null
proposal.applied requirednumber
proposal.created_at requirednumber
proposal.encrypted requiredboolean
proposal.envelopestring
proposal.expires_at requirednumber
proposal.id requiredstring
proposal.items requirednumber
proposal.listarray of object
proposal.list[].ai requiredboolean
proposal.list[].beforeobject
proposal.list[].entitystring
proposal.list[].fieldsobject
proposal.list[].idstring
proposal.list[].key requiredstring
proposal.list[].kind requiredstring
proposal.list[].sideobject | null
proposal.rule_id requiredstring
proposal.run_id requiredstring
proposal.skipped requirednumber
proposal.state requiredstring
reasonstring
rule_id requiredstring
run_as requiredstring
run_id requiredstring
source requiredstring
stepsarray of object
steps[].duration_ms requirednumber
steps[].errorstring
steps[].ids requiredarray of string
steps[].index requirednumber
steps[].items requirednumber
steps[].kind requiredstring
steps[].output requiredstring
steps[].status requiredstring
steps[].step_id requiredstring
steps[].tokensnumber
steps_count requirednumber
task_idstring
test requiredboolean
tokens requirednumber
undone_at requirednumber | null
writes requirednumber

POST /api/v1/rules/{id}/runs/{run}/dismiss

Rule run dismiss · Token or session

→ 204: hides the run from the Inbox card on every device; another account's run answers 404 not_found

Path parameters
FieldTypeDescription
id requiredstringpath
run requiredstringpath

Response 200: OK

POST /api/v1/rules/{id}/runs/{run}/undo

Rule run undo · Token or session

→ {restored, kept, not_undoable}: puts back what the run wrote that has not changed since, moves what it created to the Trash, stops a timer it started; notifications, deliveries and emails are listed in not_undoable; 409 already_undone the second time

Path parameters
FieldTypeDescription
id requiredstringpath
run requiredstringpath
Response 200
FieldTypeDescription
kept requirednumber
not_undoable requiredarray of string
restored requirednumber

POST /api/v1/rules/test

Rules test · Token or session

an unsaved draft {trigger, condition?, actions?, steps?, task_id?, call_ai?, workspace_id?} → {run, steps, writes, test}; validated like a create; nothing is written or logged; each step carries preview (its output, titles included, never stored) and the last one the planned changes; an AI step carries estimate and calls the model only with call_ai: true

Request body
FieldTypeDescription
actions requiredstring
call_ai requiredboolean
condition requiredstring
note_id requiredstring
project_id requiredstring
steps requiredstring
task_id requiredstring
trigger requiredstring
workspace_id requiredstring
Response 200
FieldTypeDescription
device_runobject | null
device_run.at requirednumber
device_run.auto requiredboolean
device_run.budget requirednumber
device_run.notestring
device_run.occurrence requiredstring
device_run.op requiredstring
device_run.rev requiredstring
device_run.rule requiredstring
device_run.run requiredstring
device_run.taskstring
device_run.tokens requirednumber
run requiredobject
run.ai_auto requiredboolean
run.at requirednumber
run.blocksarray of object
run.blocks[].datestring
run.blocks[].fromstring
run.blocks[].idsarray of string
run.blocks[].kind requiredstring
run.blocks[].spanstring
run.blocks[].tostring
run.changes requiredstring
run.depth requirednumber
run.device_idstring
run.duration_ms requirednumber
run.failed_step requirednumber
run.id requirednumber
run.note_idstring
run.occurrence requiredstring
run.outcome requiredstring
run.project_idstring
run.proposalobject | null
run.proposal.applied requirednumber
run.proposal.created_at requirednumber
run.proposal.encrypted requiredboolean
run.proposal.envelopestring
run.proposal.expires_at requirednumber
run.proposal.id requiredstring
run.proposal.items requirednumber
run.proposal.listarray of object
run.proposal.rule_id requiredstring
run.proposal.run_id requiredstring
run.proposal.skipped requirednumber
run.proposal.state requiredstring
run.reasonstring
run.rule_id requiredstring
run.run_as requiredstring
run.run_id requiredstring
run.source requiredstring
run.stepsarray of object
run.steps[].duration_ms requirednumber
run.steps[].errorstring
run.steps[].ids requiredarray of string
run.steps[].index requirednumber
run.steps[].items requirednumber
run.steps[].kind requiredstring
run.steps[].output requiredstring
run.steps[].status requiredstring
run.steps[].step_id requiredstring
run.steps[].tokensnumber
run.steps_count requirednumber
run.task_idstring
run.test requiredboolean
run.tokens requirednumber
run.undone_at requirednumber | null
run.writes requirednumber
steps requiredarray of object
steps[].changesarray of object
steps[].changes[].baseobject
steps[].changes[].createboolean
steps[].changes[].entity requiredstring
steps[].changes[].entityId requiredstring
steps[].changes[].patch requiredobject
steps[].duration_ms requirednumber
steps[].errorstring
steps[].estimatenumber
steps[].ids requiredarray of string
steps[].index requirednumber
steps[].items requirednumber
steps[].kind requiredstring
steps[].output requiredstring
steps[].previewstring | number | array of string | object | array of objectA preview of the step's output, by its type: text and a date are a string, lines a list of strings, a number a number, a task or a note {id, title}, a project {id, name}, tasks or notes a list of {id, title}.
steps[].status requiredstring
steps[].step_id requiredstring
steps[].tokensnumber
steps[].warningobject | null
steps[].warning.kind requiredstring
steps[].warning.message requiredstring
steps[].warning.reason requiredstring
steps[].warning.settingstring
steps[].warning.step requiredstring
test requiredboolean
writes requirednumber

This group in the HTTP API guide