> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superskope.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connection and lifecycle

> Pair a selected phone with separate scopes and a permanent number binding.

`GET /api/v1/status` with `status:read` remains the normal bound-phone status check. An HTTP health response proves the process responds; it does not prove WhatsApp connectivity.

## Inspect and pair

`GET /api/v1/connection` requires `connection:read` and reports status, expected bound `accountId`, observed `connectedAccountId`, `confirmed`, `mismatch`, `paused` and `version`.

An owner can issue a pre-pairing key limited to `connection:read`, `connection:pair`, `connection:disconnect` and optional `logs:read`. No message/chat authority is available until the phone is confirmed. Confirmation binds the key to that number; it does not add other scopes.

1. Call `POST /api/v1/connection/start` with `connection:pair`, a stable `Idempotency-Key` and `{}`.
2. Fetch `GET /api/v1/connection/qr` with `connection:pair` while pairing is needed. The response contains `mimetype: "image/png"` and base64 `data` with private no-store handling.
3. Show the QR privately to the authorised person and link WhatsApp.
4. Call `POST /api/v1/connection/confirm` with the same scope, a new operation key and `{"accountId":"<connected-number-with-country-code>"}`. The account must match the currently linked number and any immutable existing binding.

QR data is a temporary credential. Never cache it, log it, include it in public screenshots or pass it into an untrusted model prompt. A different detected number needs owner/operator review; never silently rebind the phone.

## Disconnect deliberately

`POST /api/v1/connection/disconnect` requires separate `connection:disconnect` permission, a stable operation key and current state:

```json theme={null}
{"confirm":true,"accountId":"<expected-connected-or-bound-account>","expectedVersion":3}
```

Use the current `connectedAccountId`, or the bound `accountId` when offline. Use `null` only when no number is linked. `expectedVersion` is the integer `version` from the latest connection inspection; `3` above is an example. Disconnection pauses sending, automation and schedules before logging out the selected phone’s current session. It does not delete session files manually or affect unrelated runtimes. Use the API reference for the response schema.

Review the effect in your host before submitting. An uncertain result must never automatically retry. Do not restart stopped/pairing sessions or clear storage as a recovery shortcut. See [safe requests](https://docs.superskope.com/developers/reliability.md) and [connection help](https://docs.superskope.com/guides/connect.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.