Start a GitHub connection
Code Mode: praxis.devops.connections.create
HTTP: POST /devops/v1/connections
Begin connecting this organization to a GitHub App installation. The answer is where to send the user (installUrl) and the signed state that proves the callback belongs to this attempt; this call itself records nothing, so the connection exists only once connections:complete has verified that state. Repeat it when the user needs a fresh link — every answer carries its own state, and the newest is the one worth sending.
签名
praxis.devops.connections.create(args:{body:{/** The git host to connect; github is the only provider, and any other value is refused with INVALID_ARGUMENT rather than stored. e.g. "github" */ provider:"github";/** Absolute URL the Console sends the browser back to after GitHub redirects; required, and nothing is stored from it — the service never follows the URL itself. e.g. "https://console.deepraxis.com/devops/connections/callback" */ returnUrl:string}}):Promise<{/** GitHub URL to open in the browser so the user can install the app; it already carries the signed state, so open this URL verbatim rather than building one. e.g. "https://github.com/apps/praxis-devops/installations/new?state=eyJvcmdhbml6YXRpb24iOiJvcmdfMDEifQ" */ installUrl:string;/** Signed, short-lived proof that this attempt belongs to this organization; send it back as state to connections:complete, and never shorten or rebuild it, becaus e.g. "eyJvcmdhbml6YXRpb24iOiJvcmdfMDEifQ.c2lnbmF0dXJl" */ state:string}>;请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | Where to send the user, and the state to expect back from the browser. |
| 400 | application/json | INVALID_ARGUMENT means the request cannot start a connection — provider is not github, or returnUrl is missing or empty. Correct the field and send the same call again. |
| 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. |
| 429 | application/json | GITHUB_RATE_LIMITED means GitHub’s API rate limit is exhausted, so no installation URL could be built. Wait for the window to reset and call again; nothing 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, which is transient. Retry after a delay rather than changing the request; nothing was written. |
| 503 | application/json | SOURCE_NOT_CONFIGURED means this deployment has no GitHub App credentials, so no installation can be started here. This is a deployment fact, not a request error: report it rather than retrying. |