> ## Documentation Index
> Fetch the complete documentation index at: https://blackbox.dasha.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Auth Token

> Updates the Auth Token for an existing Twilio provider. The new token is validated with Twilio
before being saved to ensure it is correct. If validation fails, an error is returned and
no changes are made.

## 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


## OpenAPI

````yaml https://blackbox.dasha.ai/swagger/v1/swagger.json patch /api/v1/providers/twilio/{id}/auth-token
openapi: 3.0.4
info:
  title: Dasha BlackBox Agent API
  description: API for managing AI agents and calls
  contact:
    name: DashaAI Team
    email: support@dasha.ai
  version: v1
servers:
  - url: https://blackbox.dasha.ai
    description: Dasha BlackBox Agent API
security:
  - ApiKey: []
  - OAuth: []
tags:
  - name: ActivityLogs
  - name: Agents
  - name: AgentTestCases
  - name: CallResults
  - name: Calls
  - name: Chats
  - name: Copilot
  - name: CustomerData
  - name: Mcp
  - name: Media
  - name: Misc
  - name: PronunciationDictionaries
  - name: Providers
  - name: SipAliases
  - name: SipCredentials
  - name: SipPhoneNumbers
  - name: TextChat
  - name: TwilioProvider
  - name: Voice
  - name: WebhookTest
  - name: WebIntegrations
  - name: WebSocket
    description: WebSocket endpoints for real-time communication
paths:
  /api/v1/providers/twilio/{id}/auth-token:
    patch:
      tags:
        - TwilioProvider
      summary: Update Auth Token
      description: >-
        Updates the Auth Token for an existing Twilio provider. The new token is
        validated with Twilio

        before being saved to ensure it is correct. If validation fails, an
        error is returned and

        no changes are made.
      parameters:
        - name: id
          in: path
          description: Provider identifier
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: New Auth Token to set
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/UpdateTwilioAuthTokenRequestDto'
              description: >-
                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.
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/UpdateTwilioAuthTokenRequestDto'
              description: >-
                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.
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/UpdateTwilioAuthTokenRequestDto'
              description: >-
                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.
      responses:
        '200':
          description: Auth Token updated successfully
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/TwilioProviderResponseDto'
                description: >-
                  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.
        '400':
          description: Invalid Auth Token format or Twilio rejected the credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Authentication failed or API key is missing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Access denied to the requested resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Provider with specified ID does not exist in your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Server error occurred during auth token update
components:
  schemas:
    UpdateTwilioAuthTokenRequestDto:
      required:
        - authToken
      type: object
      properties:
        authToken:
          minLength: 1
          type: string
          description: >-
            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.
      additionalProperties: false
      description: >-
        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.
    TwilioProviderResponseDto:
      allOf:
        - $ref: '#/components/schemas/ProviderResponseDto'
        - required:
            - accountSid
            - providerType
          type: object
          properties:
            providerType:
              enum:
                - twilio
              type: string
              description: Type of VoIP provider. Always returns Twilio for this DTO.
              readOnly: true
            accountSid:
              minLength: 1
              type: string
              description: >-
                Twilio Account SID. A unique identifier for the Twilio account
                associated with this provider.

                Format: AC[a-f0-9]{32} (e.g.,
                ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx).
            trunkSid:
              type: string
              description: >-
                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).
              nullable: true
            terminationUri:
              type: string
              description: >-
                SIP trunk termination URI configured for this provider. Used for
                routing outbound calls through Twilio.

                Format: sip:<trunk-name>.pstn.twilio.com
              nullable: true
            region:
              type: string
              description: >-
                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.
              nullable: true
            supportsCallTransfer:
              type: boolean
              description: >-
                Whether the provider supports call transfers. When enabled,
                allows warm and cold transfers during calls.

                Requires proper Twilio account configuration and sufficient
                permissions.
          additionalProperties: false
      description: >-
        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.
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    ProviderResponseDto:
      required:
        - name
        - providerType
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the provider integration.
          format: uuid
        name:
          type: string
          description: >-
            Display name for the provider integration. Used to identify the
            provider in the UI and API responses.
          nullable: true
        providerType:
          allOf:
            - $ref: '#/components/schemas/ProviderType'
          description: >-
            Type of VoIP provider. Determines the specific provider
            implementation and available features.

            Supported values: twilio, vonage, telnyx.
          readOnly: true
        verificationStatus:
          allOf:
            - $ref: '#/components/schemas/VerificationStatus'
          description: >-
            Current verification status of the provider credentials. Indicates
            the health and validity of the integration.

            Supported values: pending, verified, warning, failed.
        lastVerifiedAt:
          type: string
          description: >-
            Timestamp when the provider credentials were last verified. Null if
            verification has never been performed.
          format: date-time
          nullable: true
        phoneNumberCount:
          type: integer
          description: >-
            Total number of phone numbers currently imported and managed through
            this provider integration.
          format: int32
        verificationDetails:
          type: array
          items:
            $ref: '#/components/schemas/VerificationCheckDto'
          description: >-
            Detailed results of the last verification. Contains individual check
            results with status, messages, and timestamps.

            Null if verification has never been performed.
          nullable: true
      additionalProperties: false
      description: >-
        Base response DTO for VoIP provider integrations. Contains common
        provider information

        shared across all provider types including identification, verification
        status, and phone number counts.

        Uses polymorphic serialization with providerType discriminator to
        support different provider implementations.
    ProviderType:
      enum:
        - twilio
        - vonage
        - telnyx
      type: string
      description: >-
        Type of VoIP provider integration. Determines the specific provider
        implementation and API interactions.
    VerificationStatus:
      enum:
        - pending
        - verified
        - warning
        - failed
      type: string
      description: >-
        Status of provider credential verification. Indicates the current health
        and validity of the provider integration.
    VerificationCheckDto:
      required:
        - checkName
        - message
      type: object
      properties:
        checkName:
          type: string
          description: >-
            Name of the verification check that was performed.

            Common values: credentials, api_connectivity, sip_trunk,
            phone_numbers.
          nullable: true
        status:
          allOf:
            - $ref: '#/components/schemas/CheckStatus'
          description: >-
            Status indicating whether the check passed, failed, or raised a
            warning.

            Supported values: passed, failed, warning.
        message:
          type: string
          description: >-
            Human-readable message describing the check result. Provides context
            about

            what was verified and any issues encountered.
          nullable: true
        timestamp:
          type: string
          description: Timestamp when the check was performed. Recorded in UTC.
          format: date-time
        details:
          type: object
          additionalProperties:
            type: string
          description: >-
            Additional details about the check result as key-value pairs.

            Can contain provider-specific information such as error codes or
            configuration details.
          nullable: true
      additionalProperties: false
      description: >-
        DTO representing the result of an individual verification check for a
        provider.

        Contains details about what was checked, the outcome, and any additional
        context.
    CheckStatus:
      enum:
        - passed
        - failed
        - warning
      type: string
      description: >-
        Status of an individual verification check. Indicates whether a specific
        verification check passed, failed, or raised a warning.
  securitySchemes:
    ApiKey:
      type: http
      description: API Key Authentication (Bearer {key})
      scheme: Bearer
    OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://auth.dasha.ai/connect/authorize
          scopes:
            platform_api: Platform API

````