Skip to main content
POST
/
sip
/
hooks
Updates SIP hooks.
curl --request POST \
  --url https://api.sayna.ai/sip/hooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "hooks": [
    {
      "auth_id": "tenant-123",
      "host": "example.com",
      "url": "https://webhook.example.com/events"
    }
  ]
}
'
{
  "hooks": [
    {
      "auth_id": "tenant-123",
      "host": "example.com",
      "url": "https://webhook.example.com/events"
    }
  ]
}

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.

Adds or replaces SIP webhook forwarding entries at runtime. Changes take effect immediately and persist across server restarts.

Request body

Array of hook entries with:
  • host - Host pattern for matching SIP domains (case-insensitive)
  • url - HTTPS URL to forward webhook events to
  • auth_id - Tenant identifier for room ownership
The auth_id field is required when AUTH_REQUIRED=true. It determines which tenant owns rooms created from inbound SIP calls to this host.

Behavior

  • Hooks with matching hosts (case-insensitive) are replaced; others are added.
  • Hosts defined in the application configuration cannot be modified via this endpoint.
  • Secrets are NOT stored in the cache. Runtime-added hooks use the global hook_secret from server configuration.

Error responses

StatusCondition
400 Bad RequestValidation failed (duplicate hosts, non-HTTPS URLs, missing auth_id when required).
405 Method Not AllowedAttempted to modify a host defined in application config.
500 Internal Server ErrorFailed to write hooks cache.

Authorizations

Authorization
string
header
required

Authentication token for protected endpoints. Can be provided as Authorization: Bearer <token> or ?api_key=<token>. Required when AUTH_REQUIRED is enabled.

Body

application/json

Request body for updating SIP hooks.

Contains a list of SIP webhook configurations to add or replace.

hooks
object[]

List of SIP hooks to add or replace. Hooks with matching hosts (case-insensitive) will be replaced.

Response

Updated list of SIP hooks

Response body for SIP hooks operations.

hooks
object[]
required

List of all configured SIP hooks