---
title: "Connect a GitHub installation to the workspace"
method: POST
path: "/v1/organizations/{organization_id}/github:connect"
---

# Connect a GitHub installation to the workspace

`POST /v1/organizations/{organization_id}/github:connect`

## Request

- Base URL: `https://app.ohmyho.st`
- URL: `https://app.ohmyho.st/v1/organizations/{organization_id}/github:connect`
- Auth: HTTP bearer

Owner or Admin connects once through one GitHub browser link. The original user session or user API key is bound to the thirty-minute authorization. Repeat the same request and key to observe its result. No provider credential is returned or retained.

## Path parameters

- `organization_id` string, required

## Headers

- `X-Request-Id` string
- `Idempotency-Key` string, required

## Request body

- ConnectGithubOrganizationRequest

## Response `201`

Bound authorization handoff, replay status, or the existing connection.

- GithubConnectionAuthorization
  - `authorization_id` string, nullable, required
  - `status` 'pending' | 'authorizing' | 'connected' | 'failed' | 'expired', required
  - `last_failure` 'installation_access_required' | 'account_admin_required' | 'authorization_code_rejected' | 'provider_unavailable' | 'expired' | 'session_inactive' | 'denied' | 'code_spent' | 'state_unknown' | 'null', nullable, required
  - `authorization_url` string, uri, nullable, required: One GitHub browser authorization link when pending; contains only the bound single-use state, never a provider credential.
  - `expires_at` string, date-time, nullable, required
  - `connection` GithubOrganizationConnection, required
    - `connection_id` string, required
    - `organization_id` string, required
    - `installation_id` string, required
    - `account_id` string, required
    - `account_login` string, required
    - `account_type` 'User' | 'Organization', required
    - `github_user_id` string, required
    - `github_user_login` string, required
    - `connected_at` string, date-time, required
    - `revoked_at` string, date-time, nullable, required
    - `settings_url` string, uri, required

## Other responses

- `400`: The request failed.
- `401`: The request failed.
- `403`: The request failed.
- `404`: The resource does not exist or is not visible to the authenticated principal.
- `409`: The request failed.
- `429`: The request failed.
- `503`: The request failed.

---

[API](https://skmtc.dev/ohmyho/apis/ohmyho-st-api.md) · [All operations](https://skmtc.dev/ohmyho/apis/ohmyho-st-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ohmyho/apis/ohmyho-st-api/revisions/d069888c0017?raw)
