# Enable phone calling on a number

Enables a phone calling on a number.

```http
POST https://api.pozy.ai/v1/phone-numbers/{id}/voice
```

- Area: Phone & voice / Voice
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `id` (string, required)

## Request body

Content type: `application/json`

- `forwardTo`, string
- `recordingEnabled`, boolean
- `transcriptionEnabled`, boolean
- `transcriptionLanguage`, string: One of `auto`, `en`, `es`
- `voicemailEnabled`, boolean
- `voicemailGreeting`, string: Up to 1000 characters
- `businessHoursEnabled`, boolean
- `businessHoursTimezone`, string: Up to 64 characters
- `businessHours`, array of object: Up to 21 items
  - `day`, integer, required: 0 to 6
  - `open`, string, required: Matches `^\d{2}:\d{2}$`
  - `close`, string, required: Matches `^\d{2}:\d{2}$`
- `blockedCallers`, array of string: Up to 1000 items
- `forwardCallerId`, string: One of `business`, `caller`
- `ivrEnabled`, boolean
- `ivrPrompt`, string: Up to 1000 characters
- `ivrOptions`, array of object: Up to 12 items
  - `digit`, string, required: Matches `^[0-9*#]$`
  - `forwardTo`, string, required
  - `label`, string: Up to 80 characters

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/phone-numbers/6bfebd43ddc270f6d2c56fc5/voice" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "forwardTo": "string",
  "recordingEnabled": true,
  "transcriptionEnabled": true,
  "transcriptionLanguage": "auto"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/phone-numbers/6bfebd43ddc270f6d2c56fc5/voice", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    forwardTo: "string",
    recordingEnabled: true,
    transcriptionEnabled: true,
    transcriptionLanguage: "auto"
  }),
});
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/phone-numbers/6bfebd43ddc270f6d2c56fc5/voice",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "forwardTo": "string",
        "recordingEnabled": True,
        "transcriptionEnabled": True,
        "transcriptionLanguage": "auto",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `enabled`, boolean
- `phoneNumber`, string
- `pstnForwardTo`, string: Can be null
- `recordingEnabled`, boolean
- `transcriptionEnabled`, boolean
- `transcriptionLanguage`, string: One of `auto`, `en`, `es`
- `voicemailEnabled`, boolean
- `voicemailGreeting`, string: Can be null
- `businessHoursEnabled`, boolean
- `businessHoursTimezone`, string: Can be null
- `businessHours`, array of object
  - `day`, integer
  - `open`, string
  - `close`, string
- `blockedCallers`, array of string
- `forwardCallerId`, string: One of `business`, `caller`
- `ivrEnabled`, boolean
- `ivrPrompt`, string: Can be null
- `ivrOptions`, array of object
  - `digit`, string
  - `forwardTo`, string
  - `label`, string

```json
{
  "enabled": true,
  "phoneNumber": "+14155550123",
  "pstnForwardTo": "string",
  "recordingEnabled": true,
  "transcriptionEnabled": true,
  "transcriptionLanguage": "auto",
  "voicemailEnabled": true,
  "voicemailGreeting": "alex@example.com",
  "businessHoursEnabled": true,
  "businessHoursTimezone": "string",
  "businessHours": [
    {
      "day": 1,
      "open": "string",
      "close": "string"
    }
  ],
  "blockedCallers": [
    "string"
  ],
  "forwardCallerId": "business",
  "ivrEnabled": true,
  "ivrPrompt": "string",
  "ivrOptions": [
    {
      "digit": "string",
      "forwardTo": "string",
      "label": "string"
    }
  ]
}
```
