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

# Carrier recorded-message webhook (media stream)

> Verified with the carrier's request signature, keyed by the account that holds the dialled number. Records the message a caller left on the message path, one per call, for an employee that takes messages. Off unless the deployment enables it.



## OpenAPI

````yaml https://api.sempera.org/openapi.json post /v1/webhooks/telephony/message
openapi: 3.1.0
info:
  title: Sempera API
  version: 1.0.0
  description: >-
    The Sempera API: agents, versions, sessions, calls, phone numbers, tools,
    integrations, knowledge, tests, evals, workspaces, API keys and webhooks,
    under one hostname. Read /llms.txt for the guide map.
  contact:
    name: Sempera
    url: https://sempera.org
    email: hello@sempera.org
servers:
  - url: https://api.sempera.org
security: []
tags:
  - name: OAuth
    description: >-
      OAuth discovery, client registration and authorization with PKCE. Revoke
      grants through Connected clients.
  - name: Operations
    description: >-
      Platform-operator attestations in the designated internal operations
      workspace only.
  - name: Webhook ingress
    description: >-
      Server-to-server provider callbacks with provider-specific proof, not
      workspace API keys.
  - name: Dialing pools
    description: Owned caller ID pools and side-effect-free selection previews.
  - name: Messaging
    description: >-
      Channel setup and stored conversations; transport activation remains
      gated.
  - name: Memory
    description: Workspace-scoped agent memory configuration and records.
  - name: Phone
    description: >-
      The personal phone plan: previewed, approved calls and texts on one
      number.
  - name: Batches
    description: Consent-bound outbound call batches and their recorded attempts.
  - name: SMS
    description: Workspace text conversations, guarded sends and human handoff.
  - name: Assistant
    description: >-
      Owner-session text Assistant settings, mobile linking and the owner's own
      thread.
  - name: Experiments
    description: Observed comparisons between published versions of an agent.
  - name: Meta
    description: The API's own front door.
  - name: Authentication
    description: Credential classes and scopes.
  - name: Agents
    description: 'The core product object: draft, preview, publish, versions.'
  - name: Sessions
    description: Channel-neutral conversations, and minting Web voice sessions.
  - name: Calls
    description: Phone calls (telephony lifecycle).
  - name: Phone numbers
    description: Number-to-agent binding.
  - name: Tools
    description: Workspace-level capabilities an agent attaches.
  - name: Integrations
    description: Provider connections.
  - name: Compatibility
    description: Observed read-only compatibility facades over Sempera canonical stores.
  - name: Snippets
    description: >-
      Versioned workspace code a code tool pins; published versions never
      change.
  - name: Knowledge
    description: Documents an agent answers from.
  - name: Personas
    description: Compiled agent identity, one persona per agent.
  - name: Tests
    description: Scripted scenarios before deployment.
  - name: Evals
    description: Judging completed conversations.
  - name: Alerts
    description: An organization's metric alert rules and each rule's trigger log.
  - name: Workspaces
    description: The tenant boundary.
  - name: Credits
    description: >-
      A workspace's credit balance and history, read only. Credits pay for
      building, never for live calls.
  - name: Automations
    description: >-
      Triggers: an event Sempera emits, conditions on it, and one action (a
      signed webhook or an owner email).
  - name: Platform
    description: Deployment identity and capacity, for CI and certification.
  - name: Organizations
    description: The membership and billing umbrella.
  - name: API keys
    description: Minting and revoking credentials.
  - name: Webhooks
    description: Sempera-signed outbound events.
  - name: Connected clients
    description: >-
      Every outside client connected to a workspace, whichever way it signed in,
      with scopes, last use and revocation.
  - name: MCP
    description: >-
      The MCP endpoint, per-client setup answers, and the revocable connections
      an owner gives outside AI clients.
  - name: Models
    description: Sempera's customer-eligible model catalog.
  - name: Prompts
    description: Stored prompts a workspace saves and reuses.
  - name: Scenarios
    description: >-
      An agent's scenarios (situations): create, archive, restore, copy and
      history.
  - name: Widgets
    description: Website widgets, web chat threads and custom components.
  - name: Citation schemas
    description: >-
      The outcome fields frozen with each published version, and how well they
      are captured.
  - name: Developer settings
    description: Developer-facing workspace settings.
  - name: Contacts
    description: Workspace contact grouping, resolution and the shared contact schema.
  - name: Voices
    description: >-
      The workspace voice collection: saved cleared voices, desk ratings, team
      sharing and professional clone preparation.
paths:
  /v1/webhooks/telephony/message:
    post:
      tags:
        - Webhook ingress
      summary: Carrier recorded-message webhook (media stream)
      description: >-
        Verified with the carrier's request signature, keyed by the account that
        holds the dialled number. Records the message a caller left on the
        message path, one per call, for an employee that takes messages. Off
        unless the deployment enables it.
      operationId: telephonyMessageWebhook
      parameters:
        - name: reason
          in: query
          required: true
          schema:
            enum:
              - at_capacity
              - workspace_limit
              - unavailable
              - already_admitted
              - testing
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CarrierMessageEvent'
      responses:
        '200':
          description: Call-control markup
          content:
            text/xml:
              schema:
                type: string
        '400':
          description: Invalid payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Invalid provider proof
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Ingress disabled or not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Ingress unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - carrierSignature: []
components:
  schemas:
    CarrierMessageEvent:
      type: object
      properties:
        To:
          type: string
        CallSid:
          type: string
        RecordingSid:
          type: string
        RecordingUrl:
          type: string
        RecordingDuration:
          type: string
        From:
          type: string
        ForwardedFrom:
          type: string
      required:
        - To
        - CallSid
        - RecordingSid
        - RecordingUrl
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              enum:
                - AGENT_ENV_UNPINNED
                - CALL_RL_PLAN_ALLOWANCE
                - CALL_RL_PLAN_CONCURRENCY
                - CALL_RL_PLAN_DAILY
                - CALL_RL_PLAN_DAILY_MINUTES
                - CALL_RL_PLAN_HOURLY
                - PHONE_AGENT_UNPINNED
                - PHONE_APPROVAL_EXPIRED
                - PHONE_APPROVAL_INVALID
                - PHONE_APPROVAL_REQUIRED
                - PHONE_COST_UNKNOWN
                - PHONE_DESTINATION_BLOCKED
                - PHONE_FUNDING_NOT_LIVE
                - PHONE_NUMBER_MISSING
                - PHONE_OUTSIDE_HOURS
                - PHONE_PLAN_INACTIVE
                - PHONE_RECIPIENT_OPTED_OUT
                - SMS_RL_PLAN_ALLOWANCE
                - SMS_RL_PLAN_DAILY
                - SMS_RL_PLAN_HOURLY
                - authentication_required
                - capability_unavailable
                - conflict
                - credits_exhausted
                - credits_unavailable
                - csrf_failed
                - forbidden
                - gone
                - idempotency_key_reused
                - insufficient_scope
                - internal_error
                - invalid_credential
                - method_not_allowed
                - not_found
                - owner_setup_required
                - payload_too_large
                - provider_failed
                - provider_timeout
                - rate_limited
                - service_unavailable
                - validation_failed
                - workspace_suspended
            message:
              type: string
            request_id:
              type: string
            field:
              type: string
            scope:
              type: string
            reason:
              type: string
          additionalProperties: true
  securitySchemes:
    carrierSignature:
      type: apiKey
      in: header
      name: X-Twilio-Signature
      description: Carrier signature over the public request URL and form fields.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.