Skip to main content
These routes configure approvers and notification recipients for shared agents. The organization switch turns the feature on for an organization. The agent settings name who approves and who is notified for one agent. The base URL, bearer authentication, and the error envelope are on the REST API overview. The desktop app and the admin dashboard edit both the organization switch and the agent settings; see Turning it on.

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. Response 200 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.
Response 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. Response 200 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.
What eligible contains depends on the caller:

PUT /admin/agents/:agentId/routing

Replaces the agent’s settings. The save is a compare-and-set on rev: 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.
Response 200 with the same shape as GET, carrying the new rev. Errors

See also