PATCH /api/v1/agents/:key/owner
Auth: Guardian JWT of a global admin. Machine credentials cannot manage agents.
PATCH
/api/v1/agents/:key/ownerstableReassign an agent's owner
| Name | In | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|---|
key | query | string | required | — | — | The agent's agent_key (path segment). |
owner_user_id | body | string | required | — | — | UUID of the new owner. |
Moves an agent to a new owner. The only post-creation write to owner_user_id, and the one registry action reserved for global admins.
Response
| Field | Type | Allowed | Description |
|---|---|---|---|
agent | — | — | The agent record with its new owner. |
agent.id | string | — | Agent UUID. |
agent.agent_key | string | — | Immutable registry slug (^[a-z0-9][a-z0-9_-]{1,63}$). |
agent.display_name | string | — | Human-readable agent name. |
agent.description | string | — | Free-text description, or null. |
agent.status | string | active, suspended, deleted | Registry status. |
agent.owner_user_id | string | — | UUID of the owning user, or null. |
agent.inserted_at | string | — | Creation timestamp (ISO-8601). |
agent.updated_at | string | — | Last-update timestamp (ISO-8601). |
Example
curl -X PATCH https://therobot.is/api/v1/agents/project-aria/owner \
-H "Authorization: Bearer EXAMPLE_JWT" \
-H "Content-Type: application/json" \
-d '{"owner_user_id": "0f0e0d0c-0b0a-4938-8273-6a5b4c3d2e1f"}'Errors
401{ "error": "Authentication required" }A well-formed but unknown or revoked trm_ bearer. The response does not say which.
404{ "error": "not found" }Unknown or foreign agent key — at the agent level the two are deliberately the same answer, so no existence leaks.
422{ "errors": { "field": ["message", …] } }Validation failure, as a per-field message map.