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>"
}
}
}
}Registers a new phone number with optional agent/workflow configuration for inbound and outbound calls.
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>"
}
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.