const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountSid: '<string>',
authToken: '<string>',
name: '<string>',
region: '<string>',
supportsCallTransfer: true
})
};
fetch('https://blackbox.dasha.ai/api/v1/providers/twilio', 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/providers/twilio \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountSid": "<string>",
"authToken": "<string>",
"name": "<string>",
"region": "<string>",
"supportsCallTransfer": true
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/providers/twilio"
payload = {
"accountSid": "<string>",
"authToken": "<string>",
"name": "<string>",
"region": "<string>",
"supportsCallTransfer": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"name": "<string>",
"providerType": "twilio",
"accountSid": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"verificationStatus": "pending",
"lastVerifiedAt": "2023-11-07T05:31:56Z",
"phoneNumberCount": 123,
"verificationDetails": [
{
"checkName": "<string>",
"message": "<string>",
"status": "passed",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
],
"trunkSid": "<string>",
"terminationUri": "<string>",
"region": "<string>",
"supportsCallTransfer": 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>"
}Create Twilio provider
Creates a new Twilio provider integration with automatic SIP trunk configuration. Validates credentials with Twilio, creates a SIP trunk, sets up credential lists, and generates SIP credentials for call routing. All credentials are encrypted before storage.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountSid: '<string>',
authToken: '<string>',
name: '<string>',
region: '<string>',
supportsCallTransfer: true
})
};
fetch('https://blackbox.dasha.ai/api/v1/providers/twilio', 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/providers/twilio \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountSid": "<string>",
"authToken": "<string>",
"name": "<string>",
"region": "<string>",
"supportsCallTransfer": true
}
'import requests
url = "https://blackbox.dasha.ai/api/v1/providers/twilio"
payload = {
"accountSid": "<string>",
"authToken": "<string>",
"name": "<string>",
"region": "<string>",
"supportsCallTransfer": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"name": "<string>",
"providerType": "twilio",
"accountSid": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"verificationStatus": "pending",
"lastVerifiedAt": "2023-11-07T05:31:56Z",
"phoneNumberCount": 123,
"verificationDetails": [
{
"checkName": "<string>",
"message": "<string>",
"status": "passed",
"timestamp": "2023-11-07T05:31:56Z",
"details": {}
}
],
"trunkSid": "<string>",
"terminationUri": "<string>",
"region": "<string>",
"supportsCallTransfer": 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>"
}Automatic SIP Trunk Setup
When you create a Twilio provider, the following resources are automatically configured:- SIP Trunk: A new trunk is created in your Twilio account with termination URI
- Credential List: A credential list is created and attached to the trunk
- SIP Credentials: Username/password credentials are generated for call authentication
- Local Records: Provider and SIP credentials are stored securely in your organization
Credential Requirements
Your Twilio credentials must have the following permissions:- Read access to account information
- Create/manage SIP trunking resources
- Create/manage credential lists
- Read incoming phone numbers
Security
- Auth Token is encrypted before storage
- Account SID is stored as plain text (it’s a non-sensitive identifier)
- Auth Token is never exposed in API responses
- SIP passwords are randomly generated (32 characters)
After Creation
Once the provider is created:- Use the
/available-numbersendpoint to see phone numbers in your Twilio account - Import desired phone numbers using the
/import-numbersendpoint - Link imported phone numbers to agents for call handling
Body
Twilio provider configuration including Account SID and Auth Token
Request DTO for creating a new Twilio provider integration. Contains required Twilio API credentials and optional configuration settings for the SIP trunk setup.
Response
Twilio provider created successfully with SIP trunk configured
Response DTO for Twilio provider integrations. Contains Twilio-specific configuration details including account identifier, SIP trunk configuration, and regional settings. AuthToken is intentionally excluded from responses for security.
Was this page helpful?