ReferenceHTTP APIAgents

Name a person or a team an agent's admin

POST
/v1/agents/{id}/admins

Owners, admins and the agent's own admins name a person. A team's members administer the agent while they are in it, so naming a team needs team.manage (owners and admins): anyone else gets 403 FORBIDDEN (details.reason_code role). A role lost during the request is read again when the team is saved: 403 team_not_allowed while the caller still administers the agent, role once they no longer do. Taking a team off stays with the agent's admins; admin teams added before stay. Writes an add_agent_admin receipt unless they already were one (receipt_id null).

Auth: cookie session only; no scope. Idempotency-Key: ignored.

Authorization

cookieSession
cookie__Host-werft_session<token>

For the web console: the browser session cookie set by POST /v1/auth/login. It holds the scopes of the user's workspace role (owner: all; admin and member: all but sessions:recover). Requests other than GET must also send X-Requested-With: werft-web.

Path Parameters

id*string

The agent's id.

Match^([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)$
Formatuuid

Header Parameters

X-Requested-With?"werft-web"

Required with a cookie session: the literal werft-web.

Value in"werft-web"

Request Body

application/json
  1. body
user_id?string
Match^([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)$
Formatuuid
team_id?string
Match^([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)$
Formatuuid

Response Body

The agent's admins after the change.

application/json
  1. response
admins*
receipt_id*|null
Example Request
curl -X POST 'https://example.com/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/admins' \  -H 'Content-Type: application/json' \  -d '{  "team_id": "019a0000-0000-7000-8000-00000000b0a1"}'
Example Response
{  "admins": {    "users": [      {        "user_id": "3e7f1a90-5c2d-4b8e-8f61-2a9d0c4b7e35",        "email": "ada@example.com",        "display_name": "Ada Owner",        "created_by": "3e7f1a90-5c2d-4b8e-8f61-2a9d0c4b7e35",        "created_at": "2026-10-23T09:00:00Z"      }    ],    "teams": [      {        "team_id": "019a0000-0000-7000-8000-00000000b0a1",        "name": "research admins",        "created_by": "3e7f1a90-5c2d-4b8e-8f61-2a9d0c4b7e35",        "created_at": "2026-10-24T09:00:00Z"      }    ]  },  "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c"}