Skip to main content
PATCH
/
api
/
v1
/
providers
/
twilio
/
{id}
/
auth-token
Update Auth Token
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({authToken: '<string>'})
};

fetch('https://blackbox.dasha.ai/api/v1/providers/twilio/{id}/auth-token', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "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
}

Auth Token Update

This endpoint allows you to update the Auth Token for an existing Twilio provider without recreating the entire integration.

Validation

Before saving, the new Auth Token is validated by calling the Twilio API with the existing Account SID and new Auth Token:
  • If validation succeeds, the token is encrypted and saved
  • If validation fails, an error is returned and no changes are made

When to Use

Use this endpoint when:
  • Your Twilio Auth Token has been rotated
  • You need to update credentials without losing phone number configurations
  • You want to verify new credentials before committing them

Security

  • The new Auth Token is encrypted before storage
  • The old Auth Token is overwritten and cannot be recovered
  • Auth Tokens are never exposed in API responses

Path Parameters

id
string<uuid>
required

Provider identifier

Body

New Auth Token to set

Request DTO for updating a Twilio provider's Auth Token. The new credentials are validated with Twilio before being saved to ensure they are correct.

authToken
string
required

New Twilio Auth Token for API authentication. Must be exactly 32 lowercase hexadecimal characters. Found in the Twilio Console dashboard under Account Settings. Format: [a-f0-9]{32}. The token is validated with Twilio before being saved.

Minimum string length: 1

Response

Auth Token updated successfully

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.

name
string | null
required

Display name for the provider integration. Used to identify the provider in the UI and API responses.

providerType
enum<string>
required

Type of VoIP provider. Always returns Twilio for this DTO.

Available options:
twilio
accountSid
string
required

Twilio Account SID. A unique identifier for the Twilio account associated with this provider. Format: AC[a-f0-9]{32} (e.g., ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).

Minimum string length: 1
id
string<uuid>

Unique identifier for the provider integration.

verificationStatus
enum<string>

Current verification status of the provider credentials. Indicates the health and validity of the integration. Supported values: pending, verified, warning, failed.

Available options:
pending,
verified,
warning,
failed
lastVerifiedAt
string<date-time> | null

Timestamp when the provider credentials were last verified. Null if verification has never been performed.

phoneNumberCount
integer<int32>

Total number of phone numbers currently imported and managed through this provider integration.

verificationDetails
object[] | null

Detailed results of the last verification. Contains individual check results with status, messages, and timestamps. Null if verification has never been performed.

trunkSid
string | null

Twilio SIP Trunk SID. The unique identifier for the SIP trunk created in Twilio for this provider. Format: TK[a-f0-9]{32} (e.g., TKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).

terminationUri
string | null

SIP trunk termination URI configured for this provider. Used for routing outbound calls through Twilio. Format: sip:.pstn.twilio.com

region
string | null

Twilio region where the SIP trunk is configured. Affects call routing latency and regional compliance. Common values: us1, us2, ie1, de1, au1, jp1, br1, sg1.

supportsCallTransfer
boolean

Whether the provider supports call transfers. When enabled, allows warm and cold transfers during calls. Requires proper Twilio account configuration and sufficient permissions.