リファレンスHTTP APIAgents

Save the agent's GitHub settings

PUT
/v1/agents/{id}/github/settings

Replaces the agent's whole settings row in one transaction and makes no release: a new session reads it at once, and a change that narrows reaches running sessions too. expected_revision is settings_revision as read (null when there was no row); another value answers 409 REVISION_CONFLICT. push_attached is optional: left out, a first save writes allow and a later save keeps the row's value. updated_by is always the caller, so the first save of an agent also fixes the rollback floor at the snapshot-reading image. Only repositories the save adds are checked against the catalog and the workspace's repository ceiling, and features it turns on against the feature ceiling (400 with reason_code). Writes a set_agent_github receipt with result.change = "settings" and the values before and after; receipt_id is null when a person's row already held them. Agent managers with a web session only; API keys are refused.

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
expected_revision*|null
settings*
start_repository_id*|null
push_attached?string
Value in"allow""ask""deny"

Response Body

Saved.

application/json
  1. response
settings_revision*integer
Range-9007199254740991 <= value <= 9007199254740991
receipt_id*|null
Example Request
curl -X PUT 'https://example.com/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/github/settings' \  -H 'Content-Type: application/json' \  -d '{  "expected_revision": 3,  "settings": {    "repositories": [      "werft-sandbox"    ],    "push_approval": true,    "features": {      "workflows": false,      "actions": true,      "checks": false,      "issues": false,      "review": false    },    "actions_allow": [      {        "workflow": "ci.yml"      }    ]  },  "start_repository_id": "werft-sandbox",  "push_attached": "allow"}'
Example Response
{  "settings_revision": 4,  "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c"}