All endpoints require authentication and are workspace-scoped (the workspace
comes from the session or
X-Workspace-ID). Reads are available to any
member; every mutation requires OWNER or ADMIN, because a rule grants
autonomous routine execution across the workspace.Endpoints
List automations
200 OK
Status codes:
200 OK · 401 no workspace in context · 500 read failed.
Create an automation
OWNER or ADMIN.
Request body:
201 Created — the stored automation, in the shape shown above.
Status codes: 201 created · 400 malformed body, an event_type that is
not shaped like a journal entry type, or a routine_slug that does not exist
in this workspace · 401 no workspace · 403 below ADMIN · 500 write
failed.
Update an automation
OWNER or ADMIN.
Path parameters:
Request body: the same fields as create, all optional. The write is
sparse — only fields present in the body are applied, so toggling
enabled cannot clobber a matcher edited a moment earlier. action is
written as a whole: sending inputs without routine_slug would blank the
target.
200 OK — the updated automation.
Status codes: 200 OK · 400 invalid field · 401 no workspace ·
403 below ADMIN · 404 unknown id in this workspace · 500 write failed.
Delete an automation
OWNER or ADMIN.
Soft-delete. The rule stops matching immediately; the row stays in the
database so a run it caused can still explain where it came from. Deleting an
id that is already deleted answers 404.
A deleted rule is filtered out of every read, including the
chain walk —
a chain will not draw a node you cannot fetch. The runs it caused keep
triggered_via='automation', so the record that a rule started them
survives even though the rule itself is no longer readable. Prefer
disable over delete when you want to stop a rule but keep the origin of
its past runs visible in the topology.id path parameter.
Response: 200 OK
200 OK · 401 no workspace · 403 below ADMIN ·
404 unknown id in this workspace · 500 write failed.
Preview what a rule would catch
create permission.
Replays recent journal history against a matcher and reports what it would
have caught. Nothing is saved and no run is started, so this is safe against a
live workspace.
A matcher is otherwise written blind — save it, wait, and notice nothing
happened. When nothing matches, the reply names the clause that excluded the
most entries and what was actually there.
Request: either name a saved rule, or describe a candidate.
200 OK
scanned is entries of this event type in the window. Zero means there is
nothing to judge the rule against — not that the rule is wrong, and the two
must not be confused: a quiet workspace would otherwise send you to edit a
predicate that is correct.
key_absent marks the one failure no value change can fix: the predicate
names a payload key the event does not carry.
Status codes: 200 OK · 400 neither automation_id nor event_type ·
401 no workspace · 403 below create · 404 unknown automation_id ·
500 journal read failed.
CLI equivalents
Full flag reference:
crewship automation.