Skip to main content
POST
/
phone-numbers
Create phone number
curl --request POST \
  --url https://app.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": {
    "inboundAgentId": "550e8400-e29b-41d4-a716-446655440002",
    "outboundAgentId": "550e8400-e29b-41d4-a716-446655440003"
  }
}
'
{
  "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,
          "inboundAgentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "outboundAgentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "originationUri": "<string>",
          "sipInbound": {
            "enabled": true
          },
          "sipOutbound": {
            "enabled": true,
            "endpoint": "<string>",
            "port": 123,
            "username": "<string>",
            "password": "<string>",
            "fromDomain": "<string>",
            "transportProtocol": "UDP",
            "secureMedia": true,
            "headers": [
              {
                "key": "<string>",
                "value": "<string>"
              }
            ]
          }
        },
        "inboundAgentName": "<string>",
        "outboundAgentName": "<string>",
        "inboundAgentEntityType": "<string>",
        "outboundAgentEntityType": "<string>",
        "inboundAgentWorkflowId": "<string>",
        "outboundAgentWorkflowId": "<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
Required string length: 3 - 20
workspaceId
string<uuid>
required
userId
string<uuid>
required
friendlyName
string
config
object

Response

Phone number created

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