const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromNumber: '<string>',
toNumber: null,
additionalData: {},
callDeadline: null,
sipDomainId: null
})
};
fetch('https://blackbox.dasha.ai/api/v1/calls/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://blackbox.dasha.ai/api/v1/calls/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fromNumber": "<string>",
"toNumber": null,
"additionalData": {},
"callDeadline": null,
"sipDomainId": null
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/calls/register"
payload = {
"fromNumber": "<string>",
"toNumber": None,
"additionalData": {},
"callDeadline": None,
"sipDomainId": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"callId": "<string>",
"sipUri": "<string>",
"orgId": "<string>",
"agentId": "<string>",
"fromNumber": "<string>",
"status": "Unknown",
"direction": "Outbound",
"callDeadline": "2023-11-07T05:31:56Z",
"createdTime": "2023-11-07T05:31:56Z",
"sipDomainId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toNumber": "<string>",
"additionalData": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Register inbound call
Registers an inbound call that your telephony already holds and returns the SIP destination to bridge it to. Use this when you own the inbound call flow and decide per call which agent should answer. The call record is created up front with the supplied variables, so the call ID you receive here is the same ID on the result webhook, call results and recordings. Bridge the live call to the returned SIP URI and the agent starts.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromNumber: '<string>',
toNumber: null,
additionalData: {},
callDeadline: null,
sipDomainId: null
})
};
fetch('https://blackbox.dasha.ai/api/v1/calls/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://blackbox.dasha.ai/api/v1/calls/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fromNumber": "<string>",
"toNumber": null,
"additionalData": {},
"callDeadline": null,
"sipDomainId": null
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/calls/register"
payload = {
"fromNumber": "<string>",
"toNumber": None,
"additionalData": {},
"callDeadline": None,
"sipDomainId": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"callId": "<string>",
"sipUri": "<string>",
"orgId": "<string>",
"agentId": "<string>",
"fromNumber": "<string>",
"status": "Unknown",
"direction": "Outbound",
"callDeadline": "2023-11-07T05:31:56Z",
"createdTime": "2023-11-07T05:31:56Z",
"sipDomainId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toNumber": "<string>",
"additionalData": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Register-then-bridge flow
- Your telephony receives the inbound call and decides which agent should answer.
- Call this endpoint with the agent ID, the caller number and any variables the agent needs.
- Store the returned
callIdand bridge the live call to the returnedsipUri(sip:{callId}@sip-reg.blackbox.dasha.ai). - The agent answers as soon as the call arrives. Results arrive on the agent’s result webhook with the same
callId.
Deadline
callDeadline is how long the registration stays valid. If the call is not bridged by then, it is canceled and reported through the result webhook. Default is 10 minutes, maximum 24 hours.
Response
The response includes the assignedcallId, the sipUri to bridge to, and the stored settings. The call has status Registered until the audio arrives.Query Parameters
Agent identifier
Body
Registration details: caller number, called number, variables, deadline
Registration of an inbound call that your telephony already holds. Registering creates the call record with its settings before the audio arrives, and returns the SIP destination to bridge the live call to. The agent starts as soon as the call reaches that destination.
Number of the original caller (E.164 recommended). Stored as the call endpoint and reported back on every webhook for this call.
1Number that received the inbound call. Optional, informational only.
Data for variable interpolation in agent prompts. Values can be referenced in prompts using {{variableName}} syntax. Merged with the agent's AdditionalData.
Show child attributes
Show child attributes
Time until which the registration stays valid. If the call has not been bridged to the SIP destination by then, the registration is canceled and reported through the result webhook. Defaults to 10 minutes after registration; cannot exceed 24 hours.
Identifier of one of your verified custom SIP domains (see /api/v1/sip-domains). When set, the returned SIP URI uses that domain instead of the shared Dasha domain. The domain must be Active.
Response
Call registered successfully
Response after registering an inbound call. Store the call ID: it is the correlation key on every webhook and call result for this call. Bridge the live call to the SIP URI to start the agent.
Unique identifier for this call. Same value on the result webhook, in call results, and in the SIP URI user part.
1SIP destination to bridge the live call to, in the form sip:{callId}@{domain}.
1Organization that owns this call.
1Agent that will handle this call.
1Number of the original caller, as supplied at registration.
1Current status. A fresh registration is Registered; it becomes Running when the call reaches the SIP destination and Canceled if the deadline passes first.
Unknown, Created, Pending, Queued, Completed, Failed, Canceled, Running, Registered Always Inbound for registered calls.
Outbound, Inbound Time until which the registration stays valid.
Timestamp when the call was registered.
Custom SIP domain used for the SIP URI, when one was requested. Null when the shared Dasha domain is used.
Number that received the inbound call, as supplied at registration.
Data for variable interpolation in agent prompts, as supplied at registration.
Show child attributes
Show child attributes
Was this page helpful?