Finish a GitHub connection
Code Mode: praxis.devops.connections.complete
HTTP: POST /devops/v1/connections:complete
Record the installation GitHub sent the user back with; this is the call that creates the connection. The state from connections:create is verified before anything is written, so a forged, expired or foreign callback is refused with CONNECTION_STATE_INVALID and leaves no row; the installation is then read from GitHub to learn the account and its repository access. Completing the same installation again updates that connection instead of creating a second one — which is how a setupAction of update, repositories added or removed on GitHub, is recorded.
签名
praxis.devops.connections.complete(args:{body:{/** The state verbatim from connections:create; one that fails verification, belongs to another organization, or was edited is refused with CONNECTION_STATE_INVALID e.g. "eyJvcmdhbml6YXRpb24iOiJvcmdfMDEifQ.c2lnbmF0dXJl" */ state:string;/** GitHub's installation id from the redirect, as an integer; a non-integer is refused with INVALID_ARGUMENT, and an installation GitHub does not know answers CONN e.g. 12345678 */ installationId:number;/** Which GitHub setup step produced this answer; it says what the callback means, while the write itself always updates the installation's connection in place. e.g. "install" */ setupAction:"install"|"update"}}):Promise<{/** Connection identifier used when binding a project to a repository; it is not GitHub's installation id, which is installationId. e.g. "con_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** The resource type of this answer, always connection. */ object:"connection";/** RFC 3339 UTC time the installation was first recorded for this organization. e.g. "2026-11-03T09:10:00Z" */ createTime:string;/** RFC 3339 UTC time the connection last changed — a repeated complete, or a state GitHub reported. e.g. "2026-11-03T09:14:00Z" */ updateTime:string;/** Canonical Console link for this organization's connections. e.g. "https://console.deepraxis.com/devops/connections/con_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ viewerUrl:string;/** The git host this connection was made with; github is the only provider today. e.g. "github" */ provider:"github";/** GitHub's own installation id, the number the installation redirect carries; every repository read is made against it. e.g. 12345678 */ installationId:number;account:{/** The account's GitHub login, which is what a person recognizes when checking that the installation landed in the right place. e.g. "deepraxis" */ login:string;/** Whether the installation was made on an organization or on a personal account; it decides who can manage the installation on GitHub. e.g. "Organization" */ type:"Organization"|"User"};/** How much of the account the installation may read; a repository outside this scope is not listed and cannot be bound. e.g. "selected" */ repositorySelection:"all"|"selected";/** Whether the connection can be used: a suspended installation is refused by GitHub reads until it is restored there, and a deleted one is kept only as history. e.g. "active" */ state:"active"|"suspended"|"deleted"}>;请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The connection as recorded: its id, the account it was installed on, its repository selection and its state. |
| 400 | application/json | INVALID_ARGUMENT means installationId is not an integer or setupAction is neither install nor update; CONNECTION_STATE_INVALID means the state failed verification or belongs to another organization. Re-run connections:create and use the state it answered rather than editing this one; nothing was written. |
| 401 | application/json | The API key is missing or invalid; send a valid Praxis API key in the Authorization header before retrying. |
| 403 | application/json | The credential carries no organization, or that organization cannot reach this project; use a key belonging to the project’s organization. No cross-organization read is possible. |
| 404 | application/json | CONNECTION_NOT_FOUND means GitHub does not know this installation id — it was removed on GitHub, or the id belongs to another app. Nothing was written; start a new connection instead of retrying the same id. |
| 429 | application/json | GITHUB_RATE_LIMITED means GitHub’s API rate limit is exhausted before the installation could be read. Wait and retry the same call; no connection was written. |
| 500 | application/json | INTERNAL means the service could not complete the request; retry once, and if it repeats report the request id. A read is safe to repeat; a write that failed this way should be re-read before it is sent again. |
| 502 | application/json | GITHUB_UNAVAILABLE means GitHub could not be reached while reading the installation, which is transient. Retry the same call; no connection was written. |
| 503 | application/json | SOURCE_NOT_CONFIGURED means this deployment has no GitHub App credentials, so no state can be verified. Report it rather than retrying; nothing was written. |