Set an agent's managing team
The managing team's leads administer the agent; its other members do not. Owners, admins and the agent's own admins. An owner or admin names any live team; anyone else only a team they are in (403 FORBIDDEN, details.reason_code team_not_allowed). A team that is not in the workspace or is deleted is 404 for an owner or admin. team_id cannot be null: every agent has a managing team, and this changes which one. The former team's leads lose the agent from their next request. Writes a set_agent_managing_team receipt unless the team is unchanged (receipt_id null).
Auth: cookie session only; no scope. Idempotency-Key: ignored.
cookieSession__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.
id*stringThe agent's id.
^([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)$uuidX-Requested-With?"werft-web"Required with a cookie session: the literal werft-web.
"werft-web"application/json- body
team_id*string^([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)$uuidThe agent with its managing team.
application/json- response
agent*receipt_id*|nullcurl -X PUT 'https://example.com/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/managing-team' \ -H 'Content-Type: application/json' \ -d '{ "team_id": "019a0000-0000-7000-8000-00000000b0a1"}'{ "agent": { "id": "8d2c4f1a-6b3e-4a9d-b7c5-2e1f0a9b8c7d", "workspace_id": "9d2c4e61-8a3b-4f70-b1e5-6c0a7d3f2b98", "slug": "finance", "name": "Finance analyst", "description": "Reads the quarterly reports and flags outliers.", "managing_team_id": "019a0000-0000-7000-8000-00000000b0a1", "managing_team_name": "Finance", "status": "active", "active_release_id": null, "activation_revision": -1, "auto_model_migration": true, "created_by": "3e7f1a90-5c2d-4b8e-8f61-2a9d0c4b7e35", "created_at": "2026-10-11T08:00:00Z", "updated_at": "2026-10-11T08:00:00Z" }, "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c"}