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

# Update Provider

> Partially update a telephony provider configuration

<ResponseExample>
  ```json Success Response (200) theme={null}
  {
    "status_code": 200,
    "message": "Provider configuration updated successfully.",
    "data": {
      "id": 42,
      "provider": "twilio",
      "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "created_at": "2026-02-07T10:00:00Z"
    }
  }
  ```

  ```json Error Response (404) theme={null}
  {
    "status_code": 404,
    "message": "Provider configuration not found."
  }
  ```
</ResponseExample>

# Update Provider Configuration

Partially update an existing telephony provider configuration. This is useful for rotating credentials such as the `auth_token` without deleting and recreating the entire configuration.

<Note>
  **Prerequisites:** Make sure you have your API Token and Org-Handle ready. See [Authentication](/api/get-started/authentication) for details.
</Note>

### Path Parameters

| Name | Type    | Required | Description                                     |
| ---- | ------- | -------- | ----------------------------------------------- |
| id   | integer | Yes      | Unique identifier of the provider configuration |

<Note>
  You can get the provider configuration `id` by hitting the [Get All Providers](/api/provider/get-all-providers) API.
</Note>

### Headers

| Name          | Type   | Required | Description                     |
| ------------- | ------ | -------- | ------------------------------- |
| Authorization | string | Yes      | API Key format: `Token <token>` |
| Org-Handle    | string | Yes      | Organization domain handle      |
| Content-Type  | string | Yes      | `application/json`              |

### Request Body

All fields are optional - include only the fields you wish to update.

| Field        | Type   | Required | Description                     |
| ------------ | ------ | -------- | ------------------------------- |
| auth\_token  | string | No       | Updated Auth Token / Secret key |
| account\_sid | string | No       | Updated Account SID             |

### Response Fields

| Field        | Type    | Description                     |
| ------------ | ------- | ------------------------------- |
| status\_code | integer | HTTP status code                |
| message      | string  | Response message                |
| data         | object  | Updated provider config details |

### Provider Config Object Fields

| Field        | Type    | Description                              |
| ------------ | ------- | ---------------------------------------- |
| id           | integer | Unique provider configuration identifier |
| provider     | string  | Provider slug/identifier                 |
| account\_sid | string  | Account SID for the provider             |
| created\_at  | string  | Configuration creation timestamp         |

## Common Error Codes

| Status Code | Description                                  |
| ----------- | -------------------------------------------- |
| 200         | Success - Configuration updated successfully |
| 400         | Bad Request - Invalid update parameters      |
| 401         | Unauthorized - Invalid or missing API token  |
| 403         | Forbidden - Invalid organization handle      |
| 404         | Not Found - Provider configuration not found |
| 500         | Internal Server Error - Server-side error    |

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const axios = require('axios');

  const headers = {
    'Authorization': 'Token your-api-token',
    'Org-Handle': 'your-org-handle',
    'Content-Type': 'application/json'
  };

  // Update a provider configuration
  const updateProvider = async (id, updates) => {
    const response = await axios.patch(
      `https://unpod.ai/api/v2/platform/telephony/providers-configurations/${id}/`,
      updates,
      { headers }
    );
    console.log(`Provider #${response.data.data.id} updated successfully`);
    return response.data.data;
  };

  // Example: rotate auth_token
  updateProvider(42, { auth_token: 'your-new-auth-token-here' });
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'Authorization': 'Token your-api-token',
      'Org-Handle': 'your-org-handle',
      'Content-Type': 'application/json'
  }

  def update_provider(config_id: int, updates: dict):
      """Partially update a provider configuration"""
      url = f'https://unpod.ai/api/v2/platform/telephony/providers-configurations/{config_id}/'
      response = requests.patch(url, headers=headers, json=updates)
      data = response.json()
      print(f"Provider #{data['data']['id']} updated successfully")
      return data['data']

  # Example: rotate auth_token
  update_provider(42, {'auth_token': 'your-new-auth-token-here'})
  ```

  ```bash cURL theme={null}
  # Update a provider configuration (rotate auth token)
  curl -X PATCH "https://unpod.ai/api/v2/platform/telephony/providers-configurations/42/" \
    -H "Authorization: Token your-api-token" \
    -H "Org-Handle: your-org-handle" \
    -H "Content-Type: application/json" \
    -d '{
      "auth_token": "your-new-auth-token-here"
    }'
  ```
</CodeGroup>

## Best Practices

1. **Partial Updates**: Only include fields you want to change - PATCH supports partial updates
2. **Credential Rotation**: Regularly rotate `auth_token` values for security without disrupting bridges
3. **Security**: Never expose `auth_token` values in logs or responses
4. **Verify Before Update**: Use [Get Provider by ID](/api/provider/get-provider-by-id) to confirm the configuration exists before patching
5. **Error Handling**: Handle 404 and 400 errors to catch invalid IDs or credential formats


## OpenAPI

````yaml PATCH /api/v2/platform/telephony/providers-configurations/{id}/
openapi: 3.0.3
info:
  title: Unpod API
  description: REST API for Unpod Voice AI Platform
  version: 2.0.0
servers:
  - url: https://unpod.ai/
    description: QA
  - url: https://unpod.ai/
    description: Production
security: []
tags:
  - name: Organisation
  - name: Spaces
  - name: Agents
  - name: Tasks
  - name: Runs
  - name: Call Logs
  - name: Analytics
  - name: Providers
  - name: Bridges
  - name: Numbers
  - name: Trunks
  - name: Telephony
  - name: Billing
paths:
  /api/v2/platform/telephony/providers-configurations/{id}/:
    patch:
      tags:
        - Providers
      summary: Update Provider
      operationId: updateProvider
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            example: 42
        - $ref: '#/components/parameters/OrgHandle'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                auth_token:
                  type: string
                  example: your_new_auth_token_here
                account_sid:
                  type: string
                  example: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            example:
              auth_token: your_new_auth_token_here
      responses:
        '200':
          description: Provider updated
          content:
            application/json:
              example:
                status_code: 200
                message: Provider configuration updated successfully.
                data:
                  id: 42
                  provider: twilio
                  account_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                  created_at: '2026-02-07T10:00:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - TokenAuth: []
components:
  parameters:
    OrgHandle:
      name: Org-Handle
      in: header
      required: true
      schema:
        type: string
        example: unpod.tv
      description: Organization domain handle
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API token
      content:
        application/json:
          example:
            status_code: 401
            message: Authentication credentials were not provided.
    NotFound:
      description: Resource not found
      content:
        application/json:
          example:
            status_code: 404
            message: Not found.
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Format: Token <your-api-key>'

````