# Register a connected WhatsApp number on the Cloud API

Registers a connected WhatsApp number on the Cloud API.

```http
POST https://api.pozy.ai/v1/accounts/{accountId}/whatsapp/register
```

- Area: WhatsApp / WhatsApp
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `accountId` (string, required)

## Request body

Content type: `application/json`

- `pin`, string: Matches `^\d{6}$`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/whatsapp/register" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "pin": "string"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/whatsapp/register", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    pin: "string"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/whatsapp/register",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "pin": "string",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `registered`, boolean
- `accountId`, string
- `phoneNumberId`, string

```json
{
  "registered": true,
  "accountId": "696e0b682d0a31188e7a2ba9",
  "phoneNumberId": "698fba0989716df44adb771f"
}
```
