← All REST endpoints

PATCH /api/v1/agents/:key/owner

Auth: Guardian JWT of a global admin. Machine credentials cannot manage agents.

PATCH/api/v1/agents/:key/ownerstable

Reassign an agent's owner

Parameters
NameInTypeRequiredDefaultAllowedDescription
keyquerystringrequired——The agent's agent_key (path segment).
owner_user_idbodystringrequired——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

FieldTypeAllowedDescription
agent——The agent record with its new owner.
agent.idstring—Agent UUID.
agent.agent_keystring—Immutable registry slug (^[a-z0-9][a-z0-9_-]{1,63}$).
agent.display_namestring—Human-readable agent name.
agent.descriptionstring—Free-text description, or null.
agent.statusstringactive, suspended, deletedRegistry status.
agent.owner_user_idstring—UUID of the owning user, or null.
agent.inserted_atstring—Creation timestamp (ISO-8601).
agent.updated_atstring—Last-update timestamp (ISO-8601).

Example

bash
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.