# Finalize a Slack workspace connection via the OAuth callback

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


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

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `integration_id` (path, string, required)

### Request body

Required. Content type `application/json`.

- `code` (string, required): OAuth authorization code returned to the Slack callback
- `state` (string, required): The state value Slack echoed back; must equal the integration id (CSRF check)

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `integration_id` (string, required): The integration this OAuth callback finalized
  - `connected` (boolean, required): True once the bot token was stored and the connection is live
  - `connection` (object, required)
    - `connection_id` (string, required): Opaque identifier for the connection, used to disconnect it
    - `team_id` (string, required): Slack workspace id
    - `team_name` (string, required): Slack workspace name
    - `granted_scopes` (array of string, required): Scopes the workspace actually granted. The history scopes are optional in the app manifest, so an admin can approve the install without them.
    - `can_answer_unmentioned` (boolean, required): True when the granted scopes allow reading a thread reply that does not mention the bot. False means the bot still answers an @mention, but cannot pick up a plain reply, and the dashboard should say so.
    - `connected_at` (date-time string, nullable)

#### 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)
