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

# Update Phone Number Webhooks

> Update voice webhook URL and/or disable SMS webhooks for a phone number.

This endpoint allows you to update the voice webhook URL and optionally disable
SMS webhooks. SMS webhook URLs are managed automatically through assistant assignment.

Args:
    webhook_data: Webhook update details including phone number and voice URL

Returns:
    UpdateWebhookResponse: Update confirmation with details

## Overview

Update voice webhook URLs and optionally disable SMS webhooks for a phone number.

**Important**: SMS webhook URLs are managed automatically through assistant assignment. This endpoint only allows you to disable SMS webhooks when needed.

## Request Body

* `phone_number` (string, **required**): The phone number to update in E.164 format (e.g., `+1234567890`)
* `voice_webhook_url` (string, optional): URL for voice call webhooks
* `disable_sms` (boolean, optional): Set to `true` to disable SMS webhooks. Default: `false`
* `enable_sms` (boolean, optional): Set to `true` to enable SMS webhooks based on assigned assistant. Default: `false`
* `provider` (string, optional): Provider (`twilio` or `telnyx`). Auto-detected if not provided

**Note**: You cannot set both `disable_sms` and `enable_sms` to `true` in the same request.

## SMS Webhook Management

SMS webhooks are automatically configured when you assign a phone number to an assistant with an `sms_webhook_url`. Use this endpoint to temporarily disable SMS handling:

### Disabling SMS Webhooks

```json Request - Disable SMS theme={null}
{
  "phone_number": "+15551234567",
  "disable_sms": true
}
```

**What happens when SMS is disabled:**

* **Twilio**: Sets SMS webhook to `https://demo.twilio.com/welcome/sms/reply`
* **Telnyx**: Sets SMS webhook to empty URL
* **Result**: Incoming SMS messages are ignored

### Re-enabling SMS Webhooks

```json Request - Enable SMS theme={null}
{
  "phone_number": "+15551234567",
  "enable_sms": true
}
```

**What happens when SMS is enabled:**

* **Prerequisites**: Phone number must be assigned to an assistant with `sms_webhook_url` configured
* **Twilio**: Sets SMS webhook to `/twilio-sms-webhook` and enables messaging service
* **Telnyx**: Sets SMS webhook to `/telnyx-webhook`
* **Result**: SMS messages are forwarded to assistant's `sms_webhook_url`

### Updating Voice Webhooks

```json Request - Update Voice Webhook theme={null}
{
  "phone_number": "+15551234567",
  "voice_webhook_url": "https://your-app.com/voice-webhook"
}
```

### Combined Updates

```json Request - Update Voice + Disable SMS theme={null}
{
  "phone_number": "+15551234567",
  "voice_webhook_url": "https://your-app.com/voice-webhook",
  "disable_sms": true
}
```

```json Request - Update Voice + Enable SMS theme={null}
{
  "phone_number": "+15551234567",
  "voice_webhook_url": "https://your-app.com/voice-webhook",
  "enable_sms": true
}
```

## Response

```json Response theme={null}
{
  "success": true,
  "phone_number": "+15551234567",
  "provider": "twilio",
  "updated_webhooks": {
    "voice": "https://your-app.com/voice-webhook",
    "sms": "disabled (demo URL)"
  },
  "message": "Successfully updated 2 webhook(s) for +15551234567 via twilio"
}
```

## Use Cases

1. **Voice webhook updates** - Change where voice call events are sent
2. **Temporary SMS disable** - Disable SMS during maintenance or testing
3. **Emergency SMS disable** - Quickly stop SMS processing if needed
4. **Re-enable SMS after maintenance** - Restore SMS functionality without reassigning phone numbers

## Notes

* At least one of `voice_webhook_url`, `disable_sms`, or `enable_sms` must be provided
* Cannot set both `disable_sms` and `enable_sms` to `true` in the same request
* To enable SMS, the phone number must be assigned to an assistant with `sms_webhook_url` configured
* Voice webhooks can be updated independently of SMS webhook state


## OpenAPI

````yaml PUT /api/v1/phone-numbers/webhooks
openapi: 3.1.0
info:
  title: Burki
  description: A system that uses AI to answer customer Calls.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/phone-numbers/webhooks:
    put:
      summary: Update Phone Webhooks
      description: >-
        Update voice webhook URL and/or disable SMS webhooks for a phone number.


        This endpoint allows you to update the voice webhook URL and optionally
        disable

        SMS webhooks. SMS webhook URLs are managed automatically through
        assistant assignment.


        Args:
            webhook_data: Webhook update details including phone number and voice URL

        Returns:
            UpdateWebhookResponse: Update confirmation with details
      operationId: update_phone_webhooks_api_v1_phone_numbers_webhooks_put
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateWebhookResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateWebhookRequest:
      properties:
        phone_number:
          type: string
          title: Phone Number
          description: Phone number to update webhooks for
        voice_webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Voice Webhook Url
          description: URL for voice call webhooks
        disable_sms:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Disable Sms
          description: Set to true to disable SMS webhooks (sets to demo URL)
          default: false
        enable_sms:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enable Sms
          description: Set to true to enable SMS webhooks based on assigned assistant
          default: false
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
          description: Provider ('twilio' or 'telnyx'). Auto-detected if not provided
      type: object
      required:
        - phone_number
      title: UpdateWebhookRequest
      description: Request model for updating phone number webhooks.
    UpdateWebhookResponse:
      properties:
        success:
          type: boolean
          title: Success
        phone_number:
          type: string
          title: Phone Number
        provider:
          type: string
          title: Provider
        updated_webhooks:
          additionalProperties:
            type: string
          type: object
          title: Updated Webhooks
        message:
          type: string
          title: Message
      type: object
      required:
        - success
        - phone_number
        - provider
        - updated_webhooks
        - message
      title: UpdateWebhookResponse
      description: Response model for webhook update.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````