Assign phone number
curl --request POST \
--url https://api.omnia-voice.com/api/v1/numbers \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"phoneNumber": "<string>",
"agentId": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({phoneNumber: '<string>', agentId: '<string>'})
};
fetch('https://api.omnia-voice.com/api/v1/numbers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.omnia-voice.com/api/v1/numbers"
payload = {
"phoneNumber": "<string>",
"agentId": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"phoneNumber": "<string>",
"friendlyName": "<string>",
"agentId": "<string>",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"agent": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"status": "ACTIVE",
"type": "standard",
"workspaceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"standardConfig": {
"languageId": "<string>",
"voiceId": "<string>",
"basePrompt": "<string>",
"greeting": "<string>",
"context": "<string>",
"questions": "<string>",
"customInstructions": "<string>",
"recordingEnabled": true,
"temperature": 0,
"maxDuration": 3000,
"firstSpeaker": "agent",
"interruptible": false,
"inactivityTimeout": 155,
"inactivityAction": "hang_up",
"model": "llama",
"language": {
"id": "<string>",
"code": "<string>",
"name": "<string>",
"isActive": true
},
"voice": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"previewUrl": "<string>",
"languageCode": "<string>",
"gender": "<string>",
"isActive": true,
"language": {
"code": "<string>",
"name": "<string>"
}
}
},
"actions": [
{}
],
"knowledgeBases": [
{}
]
}
}Phone Numbers
Assign phone number
Create a phone number assignment
POST
/
numbers
Assign phone number
curl --request POST \
--url https://api.omnia-voice.com/api/v1/numbers \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"phoneNumber": "<string>",
"agentId": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({phoneNumber: '<string>', agentId: '<string>'})
};
fetch('https://api.omnia-voice.com/api/v1/numbers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.omnia-voice.com/api/v1/numbers"
payload = {
"phoneNumber": "<string>",
"agentId": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"phoneNumber": "<string>",
"friendlyName": "<string>",
"agentId": "<string>",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"agent": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"status": "ACTIVE",
"type": "standard",
"workspaceId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"standardConfig": {
"languageId": "<string>",
"voiceId": "<string>",
"basePrompt": "<string>",
"greeting": "<string>",
"context": "<string>",
"questions": "<string>",
"customInstructions": "<string>",
"recordingEnabled": true,
"temperature": 0,
"maxDuration": 3000,
"firstSpeaker": "agent",
"interruptible": false,
"inactivityTimeout": 155,
"inactivityAction": "hang_up",
"model": "llama",
"language": {
"id": "<string>",
"code": "<string>",
"name": "<string>",
"isActive": true
},
"voice": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"previewUrl": "<string>",
"languageCode": "<string>",
"gender": "<string>",
"isActive": true,
"language": {
"code": "<string>",
"name": "<string>"
}
}
},
"actions": [
{}
],
"knowledgeBases": [
{}
]
}
}Authorizations
API key for authentication
Body
application/json
Response
201 - application/json
Phone number assigned successfully
Phone number assignment ID
Phone number
Display name
Assigned agent ID
Available options:
ACTIVE, INACTIVE An agent as returned by the API.
Note the asymmetry with the create/update payloads: you write
configuration under config, and read it back under
standardConfig (or customProvider). The type field tells you which
one is present.
Show child attributes
Show child attributes