# Connections

> The apps one app user has connected, with whether each is reading and when it last did.

`POST /v2/connections`

- Auth: read key (project)
- Cost: free; never refused for your plan

Lists the apps the app user named in `X-Alexein-User` has [connected](/api/connections/connect) and not
disconnected. Use it to confirm a connection after the person comes back to your app, to show them which apps
their memory reads, and to find one that needs them to connect again. See
[Connect your users' apps](/guides/connect-apps).

It takes no arguments; send `{}`.

## Headers

- `Authorization` (string, required): `Bearer ax_…`, an API key. A read key is enough.
- `X-Alexein-User` (string, required): The app user whose connections to list. See [App users](/concepts/app-users).
- `X-Request-Id` (string): Your id for this request, echoed on the response.

## Body

- `{}` (object): An empty object.

## Response

- `connections` (object[]): One entry per connected app. Empty when the app user has none.
- `connections[].id` (string): The connection's id: the `connection_id` the person came back with, and the `id` to
  [disconnect](/api/connections/disconnect).
- `connections[].provider` (string): The app, such as `google-gmail`.
- `connections[].status` (string): `active`: it is reading. `needs_reauth`: the app refused access, such as when the person revoked it, and
  nothing is read until they [connect](/api/connections/connect) it again.
- `connections[].account_label` (string | null): The account connected, as the app names it, such as an email address. `null` when the app names none.
- `connections[].connected_at` (string | null): When it was connected, in ISO 8601.
- `connections[].last_sync_at` (string | null): When it last read the app, in ISO 8601. `null` until it first has.
- `connections[].error` (string | null): `null` while all is well. Otherwise a sentence to show: `The app refused access; the person must connect it
  again.` for `needs_reauth`, or, on an `active` connection one of whose sources stopped after repeated failures,
  which sources: `Reading messages stopped after repeated failures.`

## Errors

- `400` (bad request): `X-Alexein-User` is missing or not a usable id.
- `401` (unauthorized): The bearer is not a key this service issued.
- `403` (forbidden): A [personal key](/concepts/personal-memory#personal-keys), whose own apps are under My memory › Connectors,
  or the organisation has been closed in the console.
- `422` (invalid): A body with a field in it.
- `429` (too many requests): Past your organisation's rate limits. Retry after `Retry-After` seconds. See
  [Limits](/concepts/limits#rate-limits).
- `503` (unavailable): Connecting apps cannot be reached just now. Retry after `Retry-After` seconds.
```bash title="Request"
curl https://api.alexein.ai/v2/connections \
  -H "Authorization: Bearer $ALEXEIN_API_KEY" \
  -H "X-Alexein-User: user_42" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```json title="200 OK"
{
  "connections": [
    {
      "id": "6f1c2d9e-4b7a-4e3f-9a51-0c8d2e7b4f13",
      "provider": "google-gmail",
      "status": "active",
      "account_label": "alice@example.com",
      "connected_at": "2026-12-01T14:08:32Z",
      "last_sync_at": "2026-12-01T14:19:05Z",
      "error": null
    },
    {
      "id": "0b9e7a4c-2f61-4d38-8c15-7e3a9d2b6f40",
      "provider": "slack",
      "status": "needs_reauth",
      "account_label": "Acme",
      "connected_at": "2026-11-20T09:31:47Z",
      "last_sync_at": "2026-11-29T22:04:13Z",
      "error": "The app refused access; the person must connect it again."
    }
  ]
}
```
