# Get connection session

> Poll a connection session until it completes, fails, or expires.

Canonical: <https://www.tryadeli.com/docs/api/connect/get-connection-session>

`GET https://app.tryadeli.com/api/v1/profiles/{profileId}/connect/{connectionSessionId}`

Authorization: `Bearer <API key>` — see [Authentication](https://www.tryadeli.com/docs/authentication)

The same object without `authUrl`. Poll until `status` is terminal.

**Session status**

| Name                    | Type       | Required | Description                                                                                                                           |
| ----------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `pending_authorization` |            |          | Waiting for your customer to authorize. Becomes expired ten minutes after creation.                                                   |
| `processing`            |            |          | The customer authorized and Adeli is exchanging the code with the provider. This is brief, and may finish after expiresAt has passed. |
| `connected`             | `terminal` |          | Done. `accountId` is the connection to use in every later request.                                                                    |
| `failed`                | `terminal` |          | Authorization was denied or the exchange failed. `error.code` says why.                                                               |
| `expired`               | `terminal` |          | Nobody completed authorization in time. Start a new session.                                                                          |

**Errors** — `401 unauthorized`, `400 invalid_request`,
`404 profile_not_found`, `404 connection_session_not_found`,
`502 database_error`.

## Request examples

**cURL**

```bash
curl --fail-with-body "https://app.tryadeli.com/api/v1/profiles/00000000-0000-4000-8000-000000000001/connect/00000000-0000-4000-8000-000000000002" \
  -H "Authorization: Bearer $ADELI_API_KEY"
```

**JavaScript**

```javascript
const response = await fetch("https://app.tryadeli.com/api/v1/profiles/00000000-0000-4000-8000-000000000001/connect/00000000-0000-4000-8000-000000000002", {
  headers: {
    Authorization: `Bearer ${process.env.ADELI_API_KEY}`,
  },
});
console.log(await response.json());
```

**Python**

```python
import os

import requests

response = requests.get(
    "https://app.tryadeli.com/api/v1/profiles/00000000-0000-4000-8000-000000000001/connect/00000000-0000-4000-8000-000000000002",
    headers={"Authorization": f"Bearer {os.environ['ADELI_API_KEY']}"},
)
print(response.json())
```

## Responses

### 200

```json
{
  "id": "00000000-0000-4000-8000-000000000002",
  "profileId": "00000000-0000-4000-8000-000000000001",
  "platform": "instagram",
  "authMethod": "instagram_login",
  "status": "connected",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "expiresAt": "2026-09-08T20:10:00.000Z",
  "completedAt": "2026-09-08T20:03:11.000Z",
  "error": null
}
```

### 404

```json
{
  "error": {
    "code": "connection_session_not_found",
    "message": "Connection session not found"
  }
}
```
