Add a GitHub App connection for a role (owner or admin)
Takes role, the App's id and private key, checks the key with GitHub as PUT …/github-apps/{role} does and stores a new connection; a role may have any number. An App already registered in the workspace, in either role, is 409 GITHUB_APP_CONFLICT same_app; a reviewer App needs an author App first (409 no_author_app). The first author connection is the one people link their accounts with. Pins that the same App held before it was removed are filled again with the new connection (pins_restored). Writes a set_github_app receipt. API keys are refused.
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 workspace'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
app_id*integer0 < value <= 2147483647private_key*string1 <= length <= 16384role*string"author""reviewer"Stored; the new connection and the receipt.
application/json- response
github_app*receipt_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)$uuidpins_cleared?integer0 <= value <= 9007199254740991pins_restored?integer0 <= value <= 9007199254740991curl -X POST 'https://example.com/v1/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/github-apps' \ -H 'Content-Type: application/json' \ -d '{ "role": "author", "app_id": 234569, "private_key": "[REDACTED]"}'{ "github_app": { "role": "author", "connection_id": "019a0000-0000-7000-8000-0000000000c9", "app_id": 234569, "slug": "acme-second", "name": "Acme second", "html_url": "https://github.com/apps/acme-second", "private_key": { "updated_at": "2026-11-02T09:00:00Z", "updated_by": { "user_id": "3e7f1a90-5c2d-4b8e-8f61-2a9d0c4b7e35", "display_name": "Jae" } }, "created_at": "2026-11-02T09:00:00Z", "updated_at": "2026-11-02T09:00:00Z", "permissions": { "contents": "write", "metadata": "read", "pull_requests": "write" }, "permissions_checked_at": "2026-11-02T09:00:00Z", "warnings": [] }, "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c", "pins_cleared": 0, "pins_restored": 0}