Scopes
A credential without the scope answers
403.
The routing errors below use one envelope, with any extra fields at the top level:
Organization switch
The switch is off for every organization until an admin turns it on. While it is off, agent settings can be read but not saved, and nothing is sent to approvers or recipients.GET /admin/orgs/:orgId/shared-agent-routing
Reads the switch. Response200 with { "enabled": boolean, "killSwitch": boolean }. enabled is the organization’s own setting. killSwitch is true when Lua has turned the feature off for every organization; the organization’s setting then has no effect until it is lifted.
PUT /admin/orgs/:orgId/shared-agent-routing
Turns the switch on or off. The change is recorded in the organization’s audit log.boolean
required
true to turn the feature on, false to turn it off.200 with { "enabled", "killSwitch" }.
Errors
Agent settings
An agent’s settings take effect only while the organization switch is on, the agent is public (shared with the organization), and it is not a Space. You can save them while the agent is private; they apply once it is shared.GET /admin/agents/:agentId/routing
Reads the agent’s settings and the members who can be chosen. Response200 with:
boolean
The organization switch is on and the feature has not been turned off platform-wide.
boolean
The settings are in effect:
featureEnabled, the agent is public and not a Space, and settings are saved.object | null
The saved settings, or
null when none have been saved.object[]
The organization’s members, each
{ userId, name, email?, avatarUrl?, canApprove, canBeNotified, reason? }. Empty when featureEnabled is false.eligible contains depends on the caller:
PUT /admin/agents/:agentId/routing
Replaces the agent’s settings. The save is a compare-and-set onrev: send 0 when no settings have been saved, otherwise the rev you last read. A successful save increments rev. Pending approval requests follow the new settings: added approvers receive them, removed approvers’ copies are withdrawn, and other copies are left as they are. The change is recorded in the organization’s audit log.
number
required
0 the first time, then the rev you last read. A stale value answers 409 ROUTING_REV_CONFLICT.string[]
required
Up to 20 user ids. Each must be an active member with
operator or above on the agent.boolean
required
The person who started a run or triggered a request can’t decide it and gets no copy.
boolean
required
Send workflow approval steps whose approver is
'creator' to the approvers as well as the person who started the run. The desktop app turns it on by default.string[]
required
Up to 50 user ids. Each must be an active member of the organization.
boolean
required
Also send notices to the person who triggered the work, when there is one.
200 with the same shape as GET, carrying the new rev.
Errors
See also
- Approvers and notifications for shared agents: who receives what, and what stays personal
- Workflow approvals: deciding an approval, and the no-op a late decision gets
User.Inbox: notices and questions from your code

