레퍼런스HTTP APIWorkspace settings

Change how the workspace's pull request bodies are laid out (owner or admin)

PUT
/v1/workspaces/{id}/github-settings/pull-request

Replaces formatting (off leaves every template out, so the fields land on the platform's default layout), template_mode (repository_first: the repository's template, else default_template; override: default_template always, the repository's is not read), default_template (markdown up to 16 KiB, or null for the platform's default) and session_link (id leaves the console's address out of the pull request tail and the Agent-Session trailer). revision is pull_request_revision as last read; a stale one is 409 REVISION_CONFLICT and nothing changes. It is separate from the ceiling's revision. A template the platform will not lay text around is 400 with reason_code template_too_large, template_not_utf8 or template_unsupported. A change reaches pull requests opened or updated afterwards and commits made after a worker's next claim; text already on GitHub is not rewritten. Writes a set_github_pull_request_settings receipt with the values before and after (a template as its size and hash, never its text); receipt_id is null when nothing changed. 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 workspace'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
pull_request*
revision*integer
Range0 <= value <= 9007199254740991

Response Body

Stored; the settings and their new revision.

application/json
  1. response
pull_request*
pull_request_revision*integer
Range0 < value <= 9007199254740991
receipt_id*|null
Example Request
curl -X PUT 'https://example.com/v1/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/github-settings/pull-request' \  -H 'Content-Type: application/json' \  -d '{  "pull_request": {    "formatting": "on",    "default_template": null,    "template_mode": "repository_first",    "session_link": "id"  },  "revision": 0}'
Example Response
{  "pull_request": {    "formatting": "on",    "default_template": null,    "template_mode": "repository_first",    "session_link": "id"  },  "pull_request_revision": 1,  "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c"}