Skip to main content
PATCH
Update a Loop
Partial update. A paused Loop resumes from its next slot. wake_on replaces everything that wakes the Loop; timezone sent with it is only the zone its schedule is read in. When the Loop has one listener and wake_on is a single entry of that same kind (not GitHub), that listener changes in place and other fields may go with it. Any other replacement goes alone or with name, prompt, notification_policy, until, max_runs, model and owner_user_id; another field with it returns 400 wake_on_with_other_changes. A webhook it leaves out has its key revoked for good, and a new one later gets a new URL and key; a webhook it adds returns its URL and key once, as on create. Switching the Loop on, or onto another Session or model, checks the workspace can fund it (402 loop_model_not_fundable). A new or switched-on schedule that would take the workspace’s schedules past 1,000 runs a day returns 409 schedule_budget_reached. Who sees and changes a Loop follows its Reason: the people who can use the Reason see and change its Loops, except that a teammate’s Loop on a team Reason stays that teammate’s (the Reason’s owner may see and stop it). Workspace owners and admins may pause and delete any Loop.What a Loop runs in (its Session or computer), its Slack channels and what wakes it stay with its creator, since each is checked against their access (403 loop_creator_only_change). Scope: automations:write

Authorizations

Authorization
string
header
required

Your Reason API key from Settings › API keys. New keys use reason_; legacy ara_ keys remain accepted. Keys are capability-scoped: run, mcp:read, mcp:write, secrets:read, secrets:write, sessions:read, sessions:debug, devices:read, devices:write, devices:use, computers:read, computers:write, ssh:write, knowledge:read, memory:read, memory:write, skills:read, skills:write, pages:read, pages:write, repos:read, repos:write, reviews:read, reviews:write, deployment:read, analytics:read, org:read, org:write, attachments:read, attachments:write, guardrails:read, guardrails:write, network:read, network:write, automations:read, automations:write, agent_auth:read. devices:write, devices:use, computers:read, computers:write, ssh:write, network:read and network:write are opt-in, excluded from default keys. computers:read lists visible cloud and connected computers without waking them or granting execution access. devices:read discovers local Device targets; devices:use separately consents to local execution, so a discover-and-run local workflow needs both. devices:write manages enrollment and device grants; computers:write creates or deletes cloud computers; ssh:write manages retained SSH access. network:read reads the saved workspace network policy; network:write replaces custom allowed hosts and requires a current organization owner/admin. Legacy project PATCH requests containing network_allowed_hosts also require network:write plus their existing run scope and project management permission; saved project hosts do not affect current session egress. Only owners/admins can mint or manage keys with network:write; keys cannot grant themselves more authority. See /docs/network-policies for replacement semantics and runtime applicability. mcp:write manages MCP server configuration only; it does not authorize remote MCP-tool execution. sessions:read reads sessions, including the assistant, reasoning and tool activity in their events. sessions:debug is privileged: only for organization owners/admins, it expands session events to the full diagnostic projection (diagnostic event kinds, status text and raw event metadata).

Scopes

automations:write

Path Parameters

orgId
string
required

Organization id or slug. Resolve it with GET /v3/self.

reasonId
string<uuid>
required

The Reason id, returned as id by listReasons and createReason.

loopId
string<uuid>
required

The Loop id, returned as id by listReasonLoops and as loop.id by createReasonLoop.

Body

application/json

Only the fields sent change. wake_on replaces what wakes the Loop, and timezone with it is its schedule's zone. Unless it is one entry of the kind that alone wakes the Loop now (not GitHub), which changes that in place, send it with only name, prompt, notification_policy, until, max_runs, model and owner_user_id.

prompt
string

New instructions for its future wakes.

Required string length: 1 - 100000
name
string

New label for the Loop in the Reason's Loops list.

Required string length: 1 - 200
enabled
boolean

false pauses it; true resumes it from its next slot.

schedule
string

A new schedule for a Loop that has one, in the same forms as a wake_on schedule.

Required string length: 1 - 500
webhook
object

A webhook Loop's signing secret or condition, changed in place.

wake_on
object[]

Everything that wakes the Loop: at most one schedule, one webhook and one Slack listener, and GitHub events on one repository. A Loop woken by several things at once is in early access for some workspaces (403 wake_on_unavailable elsewhere). On update it replaces what wakes the Loop.

Required array length: 1 - 8 elements

Wake on a schedule.

Example:
until
string<date-time> | null

End of a scheduled Loop: no wake after this time, then it reads completed. null clears it. A Loop woken by events has no end of its own.

max_runs
integer | null

How many runs a scheduled Loop makes before it reads completed, counted from when it is set. null clears it.

Required range: 1 <= x <= 100000
owner_user_id
string<uuid>

Workspace member credited for each Loop run. Defaults to its creator. Changing it does not transfer execution access or billing.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
execution_mode
enum<string>

session continues one Session across wakes, the one in session_id or else one of the Loop's own that its first wake opens; new_session opens a fresh Session on every wake. A Loop woken by events opens a Session per event (events sharing a correlation key continue one), so it takes neither.

Available options:
session,
new_session
session_id
string<uuid> | null

An existing Session of the caller's that each wake continues. null unbinds it.

device_id
string<uuid> | null

A connected computer of the caller's (listDevices) that its runs use; null runs them on a Reason cloud machine.

notification_policy
enum<string>

When the Loop tells the person about a run: on important updates (the default) or only when a run fails.

Available options:
important_updates,
failed_runs_only
model
string | null

Model the Loop asks for when it opens a new Session, as a Session model id: each scheduled run with execution_mode new_session, and the first run of a Loop that opens its own Session. The workspace's plan and model routing decide what serves it, as for any Session. null or auto sets none, and a Session it opens takes its usual default. It does not override the model of a Session the Loop continues: a run added there as a turn starts from that Session's own settings; send that Session a message with model to change those. An id the workspace cannot pin returns 400 invalid_model.

Required string length: 1 - 200
flex_minutes
integer

Early access (Settings › Experiments, Flexible Loop schedules): a cron schedule runs at one fixed point up to this many minutes after each scheduled time, the same point every time, instead of on the dot; 0 runs on the dot. Use it for work that only needs to run around a time, so Loops on the same schedule don't all start together. Only a cron schedule takes it (400 invalid_routine otherwise); off in this workspace returns 403 flexible_schedule_unavailable. Left out on update, the Loop keeps its window.

Required range: 0 <= x <= 120
timezone
string

IANA time zone name, such as America/Los_Angeles, that the Loop's schedule is read in. Sent alone, it moves the existing schedule to that zone; with schedule or wake_on, the new schedule is read in it. Left out, the Loop keeps its own. Without wake_on, a Loop that has no schedule refuses it with 400 routine_trigger_kind_fixed. A name that is not a known time zone returns 400 invalid_routine when a schedule is read in it.

Required string length: 1 - 120

Response

The updated Loop, and a webhook it just gave out.

The Loop as saved, and the webhook it just gave out, when it did.

loop
object
required

A Loop: standing work a Reason does, woken by a schedule or an event. Each wake opens or continues a Session of the Reason.

webhook
object

The webhook a Loop just gave out, returned once.