Create a call for your own telephony
curl --request POST \
--url https://api.omnia-voice.com/api/v1/calls/create \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agentId": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agentId: '<string>'})
};
fetch('https://api.omnia-voice.com/api/v1/calls/create', 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/calls/create"
payload = { "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>",
"websocketUrl": "<string>",
"status": "<string>",
"connectionType": "<string>",
"agent": {
"id": "<string>",
"name": "<string>",
"description": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
}Calls
Create a call for your own telephony
Create a call session for a saved agent and receive a WebSocket URL to stream audio into.
This is the “bring your own telephony” endpoint: point Twilio, Telnyx or
Plivo at the returned websocketUrl, or connect to it directly from
your own client. It is also what the JavaScript SDK calls under the hood
when you pass an agentId.
POST
/
calls
/
create
Create a call for your own telephony
curl --request POST \
--url https://api.omnia-voice.com/api/v1/calls/create \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agentId": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agentId: '<string>'})
};
fetch('https://api.omnia-voice.com/api/v1/calls/create', 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/calls/create"
payload = { "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>",
"websocketUrl": "<string>",
"status": "<string>",
"connectionType": "<string>",
"agent": {
"id": "<string>",
"name": "<string>",
"description": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
}Body
application/json
Which transport the returned websocketUrl is prepared for.
twilio / telnyx / plivo — carrier media streams, G.711 audio.
websocket — your own client; you choose the sample rates and codec.
webrtc — browser transport, normally reached through the SDK.
Any other value returns 400.
Available options:
twilio, telnyx, plivo, websocket, webrtc