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

# Delete SIP hooks

> Removes the specified hosts from the cache. Hosts defined in the application
configuration cannot be removed. If a host exists in the original server
configuration, it will revert to its config value after deletion of a
cached override. Hosts that only exist in cache will be completely removed.

The changes take effect immediately and persist across server restarts.

# Request Body
Array of host names to remove (case-insensitive).

# Returns
* `200 OK` - Updated list of SIP hooks after deletion
* `400 Bad Request` - If the hosts array is empty
* `500 Internal Server Error` - If writing the cache fails

Remove SIP webhook forwarding entries by host name.

* Body: `{ hosts: [] }` array of host names (case-insensitive); empty arrays are rejected.
* Hosts present in server config revert to their config values after deletion; cache-only hosts are removed entirely.
* Changes apply immediately and persist across restarts. Auth still applies when `AUTH_REQUIRED=true`; failures return 500 if cache writing fails.


## OpenAPI

````yaml DELETE /sip/hooks
openapi: 3.1.0
info:
  title: Sayna API
  description: >-
    Real-time voice processing server with Speech-to-Text (STT) and
    Text-to-Speech (TTS) services
  contact:
    name: Sayna
    url: https://api.sayna.ai
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  version: 0.1.0
servers:
  - url: https://api.sayna.ai
    description: Production API
  - url: http://localhost:3001
    description: Local development
security: []
tags:
  - name: health
    description: Health check endpoints
  - name: voices
    description: TTS voice management
  - name: tts
    description: Text-to-speech synthesis
  - name: livekit
    description: LiveKit room and token management
  - name: recordings
    description: Recording download operations
  - name: sip
    description: SIP webhook configuration management
  - name: websocket
    description: WebSocket API for real-time communication
paths:
  /sip/hooks:
    delete:
      tags:
        - sip
      summary: Deletes SIP hooks by host name.
      description: >-
        Removes the specified hosts from the cache. Hosts defined in the
        application

        configuration cannot be removed. If a host exists in the original server

        configuration, it will revert to its config value after deletion of a

        cached override. Hosts that only exist in cache will be completely
        removed.


        The changes take effect immediately and persist across server restarts.


        # Request Body

        Array of host names to remove (case-insensitive).


        # Returns

        * `200 OK` - Updated list of SIP hooks after deletion

        * `400 Bad Request` - If the hosts array is empty

        * `500 Internal Server Error` - If writing the cache fails
      operationId: delete_sip_hooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteSipHooksRequest'
        required: true
      responses:
        '200':
          description: Updated list of SIP hooks after deletion
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipHooksResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipHooksErrorResponse'
        '405':
          description: Host defined in application config cannot be modified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipHooksErrorResponse'
        '500':
          description: Failed to write hooks cache
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SipHooksErrorResponse'
      security:
        - auth: []
components:
  schemas:
    DeleteSipHooksRequest:
      type: object
      description: |-
        Request body for deleting SIP hooks.

        Contains a list of host names to remove from the SIP hooks cache.
      properties:
        hosts:
          type: array
          items:
            type: string
          description: >-
            List of host names to remove (case-insensitive).

            Hosts that exist in the original config will revert to their config
            values.
          example:
            - example.com
            - other.com
    SipHooksResponse:
      type: object
      description: Response body for SIP hooks operations.
      required:
        - hooks
      properties:
        hooks:
          type: array
          items:
            $ref: '#/components/schemas/SipHookEntry'
          description: List of all configured SIP hooks
    SipHooksErrorResponse:
      type: object
      description: Error response for SIP hooks operations.
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: 'Duplicate host detected: example.com'
    SipHookEntry:
      type: object
      description: >-
        A single SIP hook entry.


        Note: The `auth_id` field is conditionally required based on
        `AUTH_REQUIRED`:

        - When `AUTH_REQUIRED=true`: `auth_id` must be provided and cannot be
        empty

        - When `AUTH_REQUIRED=false`: `auth_id` may be empty (unauthenticated
        mode)
      required:
        - host
        - url
        - auth_id
      properties:
        auth_id:
          type: string
          description: >-
            Tenant identifier for this hook (written to LiveKit room metadata).

            Required when AUTH_REQUIRED=true; may be empty when
            AUTH_REQUIRED=false.

            When empty, room metadata updates are skipped.
          example: tenant-123
        host:
          type: string
          description: Host pattern for matching SIP domains (case-insensitive)
          example: example.com
        url:
          type: string
          description: HTTPS URL to forward webhook events to
          example: https://webhook.example.com/events
  securitySchemes:
    auth:
      type: http
      scheme: bearer
      bearerFormat: Token
      description: >-
        Authentication token for protected endpoints. Can be provided as
        `Authorization: Bearer <token>` or `?api_key=<token>`. Required when
        AUTH_REQUIRED is enabled.

````