# Finalize a GitHub App install via the Setup URL callback

Source: https://docs.levelfour.ai/api-reference/accounts/post-accounts-integrations-by-id-github-complete


## POST /api/v1/accounts/integrations/{integration_id}/github-complete

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `integration_id` (path, string, required)

### Request body

Required. Content type `application/json`.

- `installation_id` (integer, required): GitHub App installation ID returned by the Setup URL callback
- `setup_action` (one of `install`, `update`, required): GitHub Setup URL action. install on first install, update when repos/permissions changed.

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `integration_id` (string, required)
  - `provider` (one of `aws`, `gcp`, `github`, `gitlab`, `jira`, `slack`, required)
  - `mode` (one of `single`, `organization`, `github_app`, `gitlab_oauth`, `jira_oauth`, `slack_oauth`, required)
  - `status` (one of `pending`, `verifying`, `connected`, `failed`, `expired`, required)
  - `discovered_account_ids` (array of string, nullable): Populated once status='connected'. AWS: one entry per onboarded account. GitHub: one entry per installed GitHub org login.
  - `error_message` (string, nullable): Populated when status='failed'
  - `polling_hint_ms` (integer, required): How long the dashboard should wait before polling again; 0 when terminal
  - `expires_at` (date-time string, required)

#### Errors

- `400`: Bad Request
- `401`: Authentication Error
- `403`: Authorization Error
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

Body of `400`, `401`, `403`, `404`, `409`, `422`, `429`, `500`:

- `success` (`false`, required)
- `error` (object, required)
  - `code` (string, required)
  - `message` (string, required)
  - `details` (any)
- `timestamp` (date-time string, required)
