const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: '<string>'})
};
fetch('https://blackbox.dasha.ai/api/v1/sip-domains', 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/sip-domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "<string>"
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/sip-domains"
payload = { "domain": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orgId": "<string>",
"domain": "<string>",
"status": "PendingVerification",
"createdTime": "2023-11-07T05:31:56Z",
"lastUpdateTime": "2023-11-07T05:31:56Z",
"exampleSipUri": "<string>",
"dns": {
"verification": {
"type": "<string>",
"name": "<string>",
"value": "<string>",
"target": "<string>"
},
"routing": {
"type": "<string>",
"name": "<string>",
"value": "<string>",
"target": "<string>"
},
"sipTarget": "<string>"
},
"lastError": "<string>",
"verifiedTime": "2023-11-07T05:31:56Z",
"defaultAgentId": "<string>",
"defaultAgentName": "<string>",
"routingRecordsDetected": true
}{
"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>"
}Add custom SIP domain
Registers a hostname you control as a SIP domain for registered inbound calls. The domain starts in PendingVerification. Publish the DNS records from the response, then call verify. Once Active, pass its id as sipDomainId when registering a call to receive sip:@.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: '<string>'})
};
fetch('https://blackbox.dasha.ai/api/v1/sip-domains', 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/sip-domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "<string>"
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/sip-domains"
payload = { "domain": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orgId": "<string>",
"domain": "<string>",
"status": "PendingVerification",
"createdTime": "2023-11-07T05:31:56Z",
"lastUpdateTime": "2023-11-07T05:31:56Z",
"exampleSipUri": "<string>",
"dns": {
"verification": {
"type": "<string>",
"name": "<string>",
"value": "<string>",
"target": "<string>"
},
"routing": {
"type": "<string>",
"name": "<string>",
"value": "<string>",
"target": "<string>"
},
"sipTarget": "<string>"
},
"lastError": "<string>",
"verifiedTime": "2023-11-07T05:31:56Z",
"defaultAgentId": "<string>",
"defaultAgentName": "<string>",
"routingRecordsDetected": true
}{
"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>"
}DNS records
The response contains two kinds of records:- Verification — a
TXTrecord at_dasha-verify.{domain}proving you control the hostname. Required before the domain can be verified. - Routing — a
CNAMEfrom the domain to the Dasha SIP host, so that calls placed tosip:{callId}@{domain}reach Dasha. SIP phones and PBXs resolve the host with A records, which the CNAME provides. Use a dedicated hostname: a CNAME cannot share its name with other records.
Body
Domain to add
Request to add a custom SIP domain for registered inbound calls. The domain must be a hostname you control; you prove ownership with a DNS TXT record before it becomes usable.
Hostname to register, e.g. "calls.example.com". Lowercased and stored without a trailing dot. Wildcards, IP addresses, ports and schemes are not accepted.
1Response
Domain created
Custom SIP domain with its verification state and the DNS records to publish.
Unique identifier of the domain record. Pass it as sipDomainId when registering a call.
Organization that owns the domain.
1Normalized hostname.
1PendingVerification until the TXT record is found and the platform registration succeeds; Active when usable; Failed when the platform refused the domain.
PendingVerification, Active, Failed Timestamp when the domain was added.
Timestamp of the last change.
Example of the SIP URI registered calls will get on this domain.
1DNS records to publish for verification and routing.
Show child attributes
Show child attributes
Reason for the last failed verification or registration attempt, if any.
When the domain became Active.
Agent that answers inbound calls on this domain whose SIP user part is not a registered call id. Null means such calls are rejected with SIP 404.
Display name of the default agent, when set.
Result of the last routing DNS check: true when the domain already resolves to the Dasha SIP host (CNAME or copied A records). Only set by the verify endpoint.
Was this page helpful?