# Finalize a Jira connection via the OAuth callback

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


## POST /api/v1/accounts/integrations/{integration_id}/jira-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 Jira callback
- `state` (string, required): The state value Atlassian 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 tokens were stored and the connection is live
  - `sites` (array of object, required): Sites the connected Atlassian account can reach
    - `id` (string, required): Atlassian cloud id of the site (used as site_id when creating a task)
    - `name` (string, required): Human-friendly site name
    - `url` (string, required): Base url of the site, e.g. https://acme.atlassian.net

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