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

# Update Provider

> Update a provider. For Twilio, credentials are validated before applying. If phone numbers using this provider cannot be verified with the new credentials, the update is rejected with a list of unreachable numbers. For SIP trunks, omitted fields remain unchanged. Set `credentials` or `destination_country` to `null` to clear that field. Send `[]` to clear an inbound allowlist.



## OpenAPI

````yaml 2026-03-01/api.yml PATCH /agents/phone-numbers/providers/{id}
openapi: 3.0.1
info:
  title: Cartesia API
  version: 0.0.1
servers:
  - url: https://api.cartesia.ai
    description: Production
security: []
paths:
  /agents/phone-numbers/providers/{id}:
    patch:
      tags:
        - Providers
      summary: Update Provider
      description: >-
        Update a provider. For Twilio, credentials are validated before
        applying. If phone numbers using this provider cannot be verified with
        the new credentials, the update is rejected with a list of unreachable
        numbers. For SIP trunks, omitted fields remain unchanged. Set
        `credentials` or `destination_country` to `null` to clear that field.
        Send `[]` to clear an inbound allowlist.
      operationId: providers_update
      parameters:
        - $ref: '#/components/parameters/CartesiaVersionHeader'
        - name: id
          in: path
          description: The provider ID.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProviderBody'
      responses:
        '200':
          description: Provider updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderAccountResponse'
        '400':
          description: >-
            Invalid credentials, invalid SIP trunk configuration, or phone
            numbers are unreachable with the new credentials.
        '404':
          description: Provider not found.
      security:
        - APIKeyAuth: []
components:
  parameters:
    CartesiaVersionHeader:
      name: Cartesia-Version
      in: header
      description: API version header.
      required: true
      schema:
        type: string
        format: date
        example: '2026-03-01'
        default: '2026-03-01'
        enum:
          - '2026-03-01'
  schemas:
    UpdateProviderBody:
      title: Update Provider
      description: Request body for updating a provider. Discriminated by `type`.
      oneOf:
        - $ref: '#/components/schemas/UpdateTwilioProviderBody'
        - $ref: '#/components/schemas/UpdateSIPTrunkProviderBody'
      discriminator:
        propertyName: type
        mapping:
          twilio:
            $ref: '#/components/schemas/UpdateTwilioProviderBody'
          sip_trunk:
            $ref: '#/components/schemas/UpdateSIPTrunkProviderBody'
    ProviderAccountResponse:
      title: Provider Account
      description: A telephony provider account.
      oneOf:
        - $ref: '#/components/schemas/TwilioProviderResponse'
        - $ref: '#/components/schemas/SIPTrunkProviderResponse'
      discriminator:
        propertyName: type
        mapping:
          twilio:
            $ref: '#/components/schemas/TwilioProviderResponse'
          sip_trunk:
            $ref: '#/components/schemas/SIPTrunkProviderResponse'
    UpdateTwilioProviderBody:
      title: Twilio
      type: object
      description: >-
        Update Twilio API key credentials and optionally the region. Credentials
        are validated before applying. If phone numbers using this provider
        cannot be verified with the new credentials, the update is rejected with
        a list of unreachable numbers.
      properties:
        type:
          type: string
          enum:
            - twilio
          description: Must be `"twilio"`.
        api_key_sid:
          type: string
          description: New Twilio API key SID.
        api_key_secret:
          type: string
          format: password
          description: New API key secret.
        region:
          $ref: '#/components/schemas/TelephonyRegion'
      required:
        - type
        - api_key_sid
        - api_key_secret
    UpdateSIPTrunkProviderBody:
      title: SIP Trunk
      type: object
      description: >-
        Update a SIP trunk provider's inbound and/or outbound configuration.
        Merge-patch semantics: omitted fields are unchanged. To add outbound to
        an inbound-only provider, send `outbound` with both `address` and
        `transport`.
      properties:
        type:
          type: string
          enum:
            - sip_trunk
          description: Must be `"sip_trunk"`.
        label:
          type: string
          minLength: 1
          description: >-
            A new human-readable label for the provider. Omit to leave
            unchanged.
        inbound:
          $ref: '#/components/schemas/UpdateInboundSIPTrunkConfig'
        outbound:
          $ref: '#/components/schemas/UpdateOutboundSIPTrunkConfig'
      required:
        - type
    TwilioProviderResponse:
      title: Twilio
      type: object
      description: >-
        A linked Twilio account. The `api_key_sid` field is partially masked in
        responses.
      properties:
        type:
          type: string
          enum:
            - twilio
          description: Always `"twilio"`.
        id:
          type: string
          description: Unique identifier for the provider.
        account_sid:
          type: string
          description: The Twilio account SID.
        api_key_sid:
          type: string
          description: The Twilio API key SID (partially masked).
        region:
          $ref: '#/components/schemas/TelephonyRegion'
        label:
          type: string
          nullable: true
          description: A human-readable label for the provider.
      required:
        - type
        - id
        - account_sid
        - api_key_sid
        - region
    SIPTrunkProviderResponse:
      title: SIP Trunk
      type: object
      description: A linked SIP trunk provider.
      properties:
        type:
          type: string
          enum:
            - sip_trunk
          description: Always `"sip_trunk"`.
        id:
          type: string
          description: Unique identifier for the provider.
        label:
          type: string
          nullable: true
          description: A human-readable label for the provider.
        inbound:
          description: Inbound configuration. Present when inbound is configured.
          allOf:
            - $ref: '#/components/schemas/SIPTrunkInboundDetails'
        outbound:
          description: Outbound configuration. Present when outbound is configured.
          allOf:
            - $ref: '#/components/schemas/SIPTrunkOutboundDetails'
      required:
        - type
        - id
    TelephonyRegion:
      title: TelephonyRegion
      type: string
      enum:
        - us1
        - ie1
        - au1
      description: >-
        The Twilio region the phone number and API key are configured for. `us1`
        (US), `ie1` (Ireland), `au1` (Australia). Default is `us1`.
      default: us1
    UpdateInboundSIPTrunkConfig:
      title: UpdateInboundSIPTrunkConfig
      type: object
      description: >-
        Inbound SIP configuration for updating a trunk. Omitted fields remain
        unchanged. Send `[]` to clear an allowlist.
      properties:
        credentials:
          $ref: '#/components/schemas/UpdateSIPCredentials'
        allowed_addresses:
          type: array
          items:
            type: string
          description: Source IP addresses or CIDR ranges allowed to send SIP traffic.
        allowed_numbers:
          type: array
          items:
            type: string
          description: Caller numbers allowed on inbound calls.
        media_encryption:
          description: Media encryption policy.
          allOf:
            - $ref: '#/components/schemas/SIPMediaEncryption'
    UpdateOutboundSIPTrunkConfig:
      title: UpdateOutboundSIPTrunkConfig
      type: object
      description: >-
        Outbound SIP configuration for updating a trunk. `address` and
        `transport` are immutable on an existing outbound trunk, but required
        when adding outbound to an inbound-only provider.
      properties:
        address:
          type: string
          minLength: 1
          description: Required only when adding outbound to an inbound-only provider.
        transport:
          description: Required only when adding outbound to an inbound-only provider.
          allOf:
            - $ref: '#/components/schemas/SIPTrunkTransport'
        destination_country:
          type: string
          nullable: true
          minLength: 2
          maxLength: 2
          pattern: ^[A-Za-z]{2}$
          description: Send `null` to clear.
        media_encryption:
          description: Media encryption policy. Omit to leave unchanged.
          allOf:
            - $ref: '#/components/schemas/SIPMediaEncryption'
        credentials:
          $ref: '#/components/schemas/UpdateSIPCredentials'
    SIPTrunkInboundDetails:
      title: SIPTrunkInboundDetails
      type: object
      description: >-
        Inbound SIP configuration. Passwords are never returned; only the
        configured username is exposed as `auth_username`.
      properties:
        allowed_addresses:
          type: array
          items:
            type: string
          description: Source IP addresses or CIDR ranges allowed to send SIP traffic.
        allowed_numbers:
          type: array
          items:
            type: string
          description: Caller numbers allowed on inbound calls.
        auth_username:
          type: string
          description: SIP username returned without the password.
        media_encryption:
          description: Media encryption policy. Defaults to `allowed`.
          allOf:
            - $ref: '#/components/schemas/SIPMediaEncryption'
      required:
        - allowed_addresses
        - allowed_numbers
        - auth_username
        - media_encryption
    SIPTrunkOutboundDetails:
      title: SIPTrunkOutboundDetails
      type: object
      description: >-
        Outbound SIP configuration. Passwords are never returned; only the
        configured username is exposed as `auth_username`.
      properties:
        address:
          type: string
          description: SIP server hostname or address used for outbound signaling.
        destination_country:
          type: string
          description: >-
            Two-letter ISO 3166-1 alpha-2 destination country code, or an empty
            string if not set.
        transport:
          $ref: '#/components/schemas/SIPTrunkTransport'
        media_encryption:
          description: Media encryption policy. Defaults to `disabled`.
          allOf:
            - $ref: '#/components/schemas/SIPMediaEncryption'
        auth_username:
          type: string
          description: SIP username returned without the password.
      required:
        - address
        - transport
        - media_encryption
        - auth_username
    UpdateSIPCredentials:
      title: UpdateSIPCredentials
      type: object
      nullable: true
      description: >-
        SIP digest authentication credentials for an update. The username is
        required when credentials are provided. Omit the password to keep the
        stored secret, or send `null` to clear the credentials.
      properties:
        username:
          type: string
          minLength: 1
        password:
          type: string
          minLength: 1
          format: password
      required:
        - username
    SIPMediaEncryption:
      title: SIPMediaEncryption
      type: string
      enum:
        - disabled
        - allowed
        - required
      description: >-
        SRTP policy for call audio. `disabled` does not negotiate encryption,
        `allowed` uses encryption when available, and `required` rejects calls
        that cannot use encryption.
    SIPTrunkTransport:
      title: SIPTrunkTransport
      type: string
      enum:
        - tcp
        - tls
      description: Transport for outbound SIP signaling.
  securitySchemes:
    APIKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Cartesia API key (`sk_car_...`). Get one at
        [play.cartesia.ai/keys](https://play.cartesia.ai/keys).
      x-default: $CARTESIA_API_KEY

````