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

# Handle ElevenLabs post-call webhook

> Inbound webhook called by ElevenLabs after a voice AI call completes. Dispatches by `type`: `post_call_transcription` creates the Call record and AI summary note, `post_call_audio` uploads the recording, `call_initiation_failure` records a missed/failed call and optionally fires a missed-call auto-SMS. Authenticated via HMAC signature (`elevenlabs-signature` header) or Bearer token (per-org `elevenlabsToolSecret`).



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/webhook/elevenlabs
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/webhook/elevenlabs:
    post:
      tags:
        - Webhooks
      summary: Handle ElevenLabs post-call webhook
      description: >-
        Inbound webhook called by ElevenLabs after a voice AI call completes.
        Dispatches by `type`: `post_call_transcription` creates the Call record
        and AI summary note, `post_call_audio` uploads the recording,
        `call_initiation_failure` records a missed/failed call and optionally
        fires a missed-call auto-SMS. Authenticated via HMAC signature
        (`elevenlabs-signature` header) or Bearer token (per-org
        `elevenlabsToolSecret`).
      operationId: post_webhook_elevenlabs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElevenLabsPostCallWebhookRequest'
      responses:
        '200':
          description: Event processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ElevenLabsPostCallWebhookResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookErrorResponse'
components:
  schemas:
    ElevenLabsPostCallWebhookRequest:
      type: object
      description: >-
        ElevenLabs post-call webhook payload. The `type` field discriminates
        between `post_call_transcription`, `post_call_audio`, and
        `call_initiation_failure`. The bulk of the data lives under `data` (or
        sometimes top-level for older payload shapes).
      properties:
        type:
          type: string
          enum:
            - post_call_transcription
            - post_call_audio
            - call_initiation_failure
          description: >-
            Event discriminator selecting how the handler processes `data`:
            transcript+summary, recording upload, or missed-call record.
        event_timestamp:
          type: number
          description: Unix epoch seconds when ElevenLabs emitted the event.
        data:
          description: >-
            Event payload; field set depends on `type`. Older payloads sometimes
            inline these fields at top level.
          type: object
          properties:
            conversation_id:
              type: string
            agent_id:
              type: string
            call_duration_secs:
              type: number
            transcript:
              description: ElevenLabs transcript array — opaque, forwarded as-is.
            analysis:
              type: object
              additionalProperties: true
              properties:
                transcript_summary:
                  type: string
            metadata:
              type: object
              additionalProperties: true
              properties:
                caller_id:
                  type: string
                called_id:
                  type: string
                phone_call:
                  type: object
                  additionalProperties: true
                  properties:
                    direction:
                      type: string
                      enum:
                        - inbound
                        - outbound
                    external_number:
                      type: string
                    agent_number:
                      type: string
            full_audio:
              type: string
              description: Base64-encoded MP3 — only present on post_call_audio events.
            reason:
              type: string
            error:
              type: string
          additionalProperties: true
      required:
        - type
      additionalProperties: true
      example:
        type: post_call_transcription
        event_timestamp: 1747580641
        data:
          conversation_id: conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01
          agent_id: agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01
          call_duration_secs: 42
          transcript:
            - role: agent
              message: Thanks for calling Acme Corp, how can I help?
            - role: user
              message: I need to update my address.
          analysis:
            transcript_summary: Caller asked to update their shipping address.
          metadata:
            caller_id: '+14165550100'
            called_id: '+12362320246'
            phone_call:
              direction: inbound
              external_number: '+14165550100'
              agent_number: '+12362320246'
    ElevenLabsPostCallWebhookResponse:
      type: object
      properties:
        received:
          type: boolean
        callId:
          type: string
        deduplicated:
          type: boolean
        skipped:
          type: boolean
        reason:
          type: string
        error:
          type: string
      additionalProperties: true
      example:
        received: true
        callId: 5f7b1c2e8a1d4e0012c3b4a5
    WebhookErrorResponse:
      type: object
      description: >-
        Error envelope used across provider webhook routes. Most failures only
        carry `error`; a few (ElevenLabs tool errors, ingress validation) add
        `success:false`, `message`, or a `code`. Many of these endpoints respond
        200 with `success:false` for recoverable cases (especially the
        ElevenLabs server tools) — only hard failures use 4xx/5xx.
      properties:
        error:
          type: string
        message:
          type: string
        success:
          type: boolean
          enum:
            - false
        code:
          type: string
        details:
          description: Optional diagnostic detail (stack snippet, validation issues, etc.).
      additionalProperties: true
      example:
        error: Webhook processing failed

````