Phone & voice · Voice

Enable phone calling on a number

Enables a phone calling on a number.

POSThttps://api.pozy.ai/v1/phone-numbers/{id}/voice
enableVoiceOnNumber

Guides: Voice calls, AI voice agents

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the telephony resource group disabled get 403 resource_group_disabled. Authentication

Path parameters

NameTypeNotes
idrequiredstring

Request body

application/json, optional

  • forwardTostring
  • recordingEnabledboolean
  • transcriptionEnabledboolean
  • transcriptionLanguagestring

    One of auto, en, es.

  • voicemailEnabledboolean
  • voicemailGreetingstring

    Up to 1000 characters.

  • businessHoursEnabledboolean
  • businessHoursTimezonestring

    Up to 64 characters.

  • businessHoursarray of object

    Up to 21 items.

    • dayintegerrequired

      0 to 6.

    • openstringrequired

      Matches ^\d{2}:\d{2}$.

    • closestringrequired

      Matches ^\d{2}:\d{2}$.

  • blockedCallersarray of string

    Up to 1000 items.

  • forwardCallerIdstring

    One of business, caller.

  • ivrEnabledboolean
  • ivrPromptstring

    Up to 1000 characters.

  • ivrOptionsarray of object

    Up to 12 items.

    • digitstringrequired

      Matches ^[0-9*#]$.

    • forwardTostringrequired
    • labelstring

      Up to 80 characters.

Example

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"
}'

Response

200 on success

  • enabledboolean
  • phoneNumberstring
  • pstnForwardTostring

    Can be null.

  • recordingEnabledboolean
  • transcriptionEnabledboolean
  • transcriptionLanguagestring

    One of auto, en, es.

  • voicemailEnabledboolean
  • voicemailGreetingstring

    Can be null.

  • businessHoursEnabledboolean
  • businessHoursTimezonestring

    Can be null.

  • businessHoursarray of object
    • dayinteger
    • openstring
    • closestring
  • blockedCallersarray of string
  • forwardCallerIdstring

    One of business, caller.

  • ivrEnabledboolean
  • ivrPromptstring

    Can be null.

  • ivrOptionsarray of object
    • digitstring
    • forwardTostring
    • labelstring
200 response
{
  "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"
    }
  ]
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
404not_foundNothing with that id exists in your workspace.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Voice