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

# Pair with a code

> Request a WhatsApp pairing code for a token.

Use a pairing code when scanning a QR code is not convenient. The token must be connected first, and pairing codes only work for tokens that are not already paired.

## Prepare the token

Start the token connection:

```http theme={null}
POST /api/v1/sessions/{sessionId}/connect
Authorization: Bearer <api_key>
```

## Request the code

Send the phone number with country code:

```http theme={null}
POST /api/v1/sessions/{sessionId}/auth/pairing-code
Authorization: Bearer <api_key>
Content-Type: application/json
```

```json theme={null}
{
  "phoneNumber": "15551234567"
}
```

WADial returns a code formatted for entry in WhatsApp.

## Enter the code in WhatsApp

1. Open WhatsApp on the phone
2. Open **Linked devices**
3. Choose the option to link with a phone number
4. Enter the code returned by WADial

If the token is already paired, reconnect it instead of requesting another code.
