> This page is for APIs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# messaging.receive

GET /

Receive inbound messages on a subscribed context

Reference: https://signalwire.com/docs/apis/relay/server/messaging/messaging-receive

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: messaging.receive
  version: subpackage_messagingReceive.messaging.receive
  description: Receive inbound messages on a subscribed context
channels:
  /:
    description: Receive inbound messages on a subscribed context
    publish:
      operationId: subpackage_messagingReceive.messaging.receive-publish
      summary: messaging.receive
      message:
        name: onMessagingReceiveReceiveEvent
        title: messaging.receive
        payload:
          $ref: '#/components/schemas/messaging.receive_receiveEvent'
servers:
  production:
    url: wss://relay.signalwire.com/
    protocol: wss
    x-default: true
components:
  schemas:
    ChannelsMessagingReceiveMessagesReceiveEventJsonrpc:
      type: string
      enum:
        - '2.0'
      description: JSON-RPC version. Always `2.0`.
      title: ChannelsMessagingReceiveMessagesReceiveEventJsonrpc
    ChannelsMessagingReceiveMessagesReceiveEventMethod:
      type: string
      enum:
        - signalwire.event
      description: Always `signalwire.event`.
      title: ChannelsMessagingReceiveMessagesReceiveEventMethod
    ChannelsMessagingReceiveMessagesReceiveEventParamsEventType:
      type: string
      enum:
        - messaging.receive
      description: The event type — identifies which event this is.
      title: ChannelsMessagingReceiveMessagesReceiveEventParamsEventType
    MessagingReceiveEventDataDirection:
      type: string
      enum:
        - inbound
      description: The direction of the message. Always `inbound` here.
      title: MessagingReceiveEventDataDirection
    MessagingReceiveEventDataMedia:
      oneOf:
        - type: array
          items:
            type: string
        - description: Any type
      description: >-
        Any media URLs included with the message. `null` when the message has no
        media.
      title: MessagingReceiveEventDataMedia
    MessagingReceiveEventDataMessageState:
      type: string
      enum:
        - received
      description: The message state. Always `received` for an incoming message.
      title: MessagingReceiveEventDataMessageState
    Messaging.ReceiveEventData:
      type: object
      properties:
        message_id:
          type: string
          description: The unique ID of this inbound message.
        context:
          type: string
          description: The context this message arrived on.
        direction:
          $ref: '#/components/schemas/MessagingReceiveEventDataDirection'
          description: The direction of the message. Always `inbound` here.
        tags:
          type: array
          items:
            type: string
          description: Reserved and currently unused — always an empty array.
        from_number:
          type: string
          description: The sender's phone number, in E.164 format.
        to_number:
          type: string
          description: >-
            Where it was sent: your phone number in E.164 format, your WhatsApp
            business number with its `whatsapp:` prefix, or your RCS agent's ID.
        body:
          type: string
          description: The text of the message.
        media:
          $ref: '#/components/schemas/MessagingReceiveEventDataMedia'
          description: >-
            Any media URLs included with the message. `null` when the message
            has no media.
        segments:
          type: integer
          description: How many SMS segments the message was split into.
        message_state:
          $ref: '#/components/schemas/MessagingReceiveEventDataMessageState'
          description: The message state. Always `received` for an incoming message.
      required:
        - message_id
        - context
        - direction
        - from_number
        - to_number
        - body
        - media
        - segments
        - message_state
      title: Messaging.ReceiveEventData
    ChannelsMessagingReceiveMessagesReceiveEventParams:
      type: object
      properties:
        event_type:
          $ref: >-
            #/components/schemas/ChannelsMessagingReceiveMessagesReceiveEventParamsEventType
          description: The event type — identifies which event this is.
        context:
          type: string
          description: The context the message belongs to.
        timestamp:
          type: number
          format: double
          description: >-
            When the event was emitted, as a Unix timestamp in seconds. Always
            present.
        project_id:
          type: string
          description: Your project ID. Always present.
        space_id:
          type: string
          description: Your space ID. Always present.
        params:
          $ref: '#/components/schemas/Messaging.ReceiveEventData'
          description: The event-specific payload.
      required:
        - event_type
        - context
        - timestamp
        - project_id
        - space_id
        - params
      description: The event envelope.
      title: ChannelsMessagingReceiveMessagesReceiveEventParams
    messaging.receive_receiveEvent:
      type: object
      properties:
        jsonrpc:
          $ref: >-
            #/components/schemas/ChannelsMessagingReceiveMessagesReceiveEventJsonrpc
          description: JSON-RPC version. Always `2.0`.
        id:
          type: string
          description: >-
            Event id — a unique UUID generated for each event. Events are
            notifications: you do not reply to them.
        method:
          $ref: >-
            #/components/schemas/ChannelsMessagingReceiveMessagesReceiveEventMethod
          description: Always `signalwire.event`.
        params:
          $ref: >-
            #/components/schemas/ChannelsMessagingReceiveMessagesReceiveEventParams
          description: The event envelope.
      required:
        - jsonrpc
        - id
        - method
        - params
      description: >-
        Fires when someone sends a message to one of your numbers. The payload
        gives

        you the full incoming message — who it's from, the text, and any media —
        so

        you can react or reply.
      title: messaging.receive_receiveEvent

```