リファレンスHTTP APIAgents

Replace who may use an agent

PUT
/v1/agents/{id}/usage

Owners, admins and the agent's own admins; never an API key. The whole setting is replaced and If-Match: <revision> is required, so two edits cannot overwrite each other: the later one answers 412. private names at least one team and workspace none (400). An owner or admin names any live team; anyone else adds only a team they are in (403 FORBIDDEN, details.reason_code team_not_allowed), and removing a team needs only this right. A team that is not in the workspace or is deleted is 404. Archiving a team removes it from every list and moves those agents' revision; an agent left private with no team admits no one but the people who manage it. Writes a set_agent_usage receipt with the setting before and after unless nothing changed (receipt_id null, revision kept).

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

If-Match*string

The revision last read, as a number (an entity tag's quotes are allowed). A different one answers 412 VERSION_MISMATCH; none answers 428 PRECONDITION_REQUIRED.

Length1 <= length
X-Requested-With?"werft-web"

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

Value in"werft-web"

Request Body

application/json
  1. body
scope*string
Value in"workspace""private"
teams*array<>
Itemsitems <= 50

Response Body

The setting now held, and its new revision.

application/json
  1. response
usage*
receipt_id*|null
Example Request
curl -X PUT 'https://example.com/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage' \  -H 'If-Match: string' \  -H 'Content-Type: application/json' \  -d '{  "scope": "private",  "teams": [    {      "id": "019a0000-0000-7000-8000-00000000b0a1"    }  ]}'
Example Response
{  "usage": {    "scope": "private",    "teams": [      {        "id": "019a0000-0000-7000-8000-00000000b0a1",        "name": "Platform"      }    ],    "revision": 3  },  "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c"}