> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# Message status callback

POST 

Payload sent by SignalWire to the `status_callback` URL each time a message transitions to a new state. The same payload shape is used for RELAY SDK message callbacks and SWML `send_sms` status callbacks.

Configure `status_callback` when [sending a message](/docs/apis/rest/messages/create-message).

Reference: https://signalwire.com/docs/apis/rest/messages/webhooks/message-status-callback

## OpenAPI 3.1 Webhook Specification

```yaml
openapi: 3.1.0
info:
  title: signalwire-rest
  version: 1.0.0
paths: {}
webhooks:
  message-status-callback:
    post:
      operationId: message-status-callback
      summary: Message status callback
      description: >-
        Payload sent by SignalWire to the `status_callback` URL each time a
        message transitions to a new state. The same payload shape is used for
        RELAY SDK message callbacks and SWML `send_sms` status callbacks.


        Configure `status_callback` when [sending a
        message](/docs/apis/rest/messages/create-message).
      responses:
        '200':
          description: Webhook received successfully
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: The unique ID of the message segment.
                project_id:
                  type: string
                  description: The ID of the project the message belongs to.
                status:
                  $ref: >-
                    #/components/schemas/WebhooksMessageStatusCallbackPayloadContentApplicationJsonSchemaStatus
                  description: The current delivery state of the message.
                to:
                  type: string
                  description: The destination phone number.
                from:
                  type: string
                  description: The source phone number.
                body:
                  type: string
                  description: The message body text.
                number_of_segments:
                  type: integer
                  description: >-
                    Number of segments the message body was split into for
                    delivery.
                timestamp:
                  type: string
                  format: date-time
                  description: Timestamp of the status transition.
                error_code:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Provider-specific error code if delivery failed. Null when
                    no error occurred.
                error_message:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Human-readable error message if delivery failed. Null when
                    no error occurred.
              required:
                - id
                - project_id
                - status
                - to
                - from
                - body
                - number_of_segments
                - timestamp
                - error_code
                - error_message
components:
  schemas:
    WebhooksMessageStatusCallbackPayloadContentApplicationJsonSchemaStatus:
      type: string
      enum:
        - queued
        - initiated
        - sent
        - delivered
        - undelivered
        - failed
        - read
      description: The current delivery state of the message.
      title: WebhooksMessageStatusCallbackPayloadContentApplicationJsonSchemaStatus

```