Skip to main content
POST
/
phone-numbers
Create phone number
curl --request POST \
  --url https://app2.freyavoice.ai/api/v2/phone-numbers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "number": "+14155551234",
  "friendlyName": "Main Support Line",
  "workspaceId": "550e8400-e29b-41d4-a716-446655440000",
  "userId": "550e8400-e29b-41d4-a716-446655440001",
  "config": {
    "configType": "agents",
    "inboundAgentId": "12345",
    "outboundAgentId": "67890"
  }
}
'
{
  "success": true,
  "data": {
    "message": "<string>",
    "result": {
      "phoneNumber": {
        "id": "<string>",
        "number": "<string>",
        "workspaceId": "<string>",
        "userId": "<string>",
        "createdAt": "<string>",
        "updatedAt": "<string>",
        "friendlyName": "<string>",
        "config": {
          "capabilities": {
            "voice": "<string>",
            "sms": true
          },
          "voiceConfig": "<string>",
          "messagingConfig": "<string>",
          "emergencyCalls": true,
          "configType": "agents",
          "inboundAgentId": "<string>",
          "outboundAgentId": "<string>",
          "inboundWorkflowId": "<string>",
          "outboundWorkflowId": "<string>",
          "originationUri": "<string>",
          "sipInbound": {
            "enabled": true
          },
          "sipOutbound": {
            "enabled": true,
            "endpoint": "<string>",
            "port": 123,
            "username": "<string>",
            "password": "<string>",
            "transportProtocol": "UDP",
            "secureMedia": true,
            "headers": [
              {
                "key": "<string>",
                "value": "<string>"
              }
            ]
          }
        },
        "inboundAgentName": "<string>",
        "outboundAgentName": "<string>",
        "inboundWorkflowName": "<string>",
        "outboundWorkflowName": "<string>"
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
number
string
required
Minimum string length: 1
workspaceId
string<uuid>
required
userId
string<uuid>
required
friendlyName
string
config
object

Response

Phone number created

success
enum<boolean>
required
Available options:
true,
false
data
object
required