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

# Get a message

> Returns a single message by ID.

Unlike the list endpoint, this returns the full `body` without truncation.

**A missing record does not return 404.** This handler reports the failure without a status code, and the error envelope defaults to HTTP `200` — you get `200` with `status: "failed"`. Branch on `status`, not on the HTTP code.



## OpenAPI

````yaml /api-reference/specs/messages.json get /api/messages/{id}
openapi: 3.1.0
info:
  title: ConveYour API — Messages
  description: >-
    Send SMS and email messages to contacts, and manage conversation thread
    assignments.
  version: 1.0.0
servers:
  - url: https://{subdomain}.conveyour.com
    description: Your organization's ConveYour instance
    variables:
      subdomain:
        default: acme
        description: >-
          Your organization's slug — the subdomain you sign in on. Replace
          `acme` with yours: if you sign in at `bigco.conveyour.com`, enter
          `bigco`.
security:
  - conveyourToken: []
tags:
  - name: Messages
    description: >-
      Send SMS and email messages to contacts, and manage conversation thread
      assignments.
paths:
  /api/messages/{id}:
    get:
      tags:
        - Messages
      summary: Get a message
      description: >-
        Returns a single message by ID.


        Unlike the list endpoint, this returns the full `body` without
        truncation.


        **A missing record does not return 404.** This handler reports the
        failure without a status code, and the error envelope defaults to HTTP
        `200` — you get `200` with `status: "failed"`. Branch on `status`, not
        on the HTTP code.
      operationId: getASingleMessage
      parameters:
        - name: id
          in: path
          required: true
          description: The id identifier.
          schema:
            type: string
        - $ref: '#/components/parameters/teams'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MessageReport'
              example:
                status: ok
                message: message found
                data:
                  id: 64a1b2c3d4e5f6a7b8c9d0e1
                  class: sms
                  type: contact
                  type_id: 64a1b2c3d4e5f6a7b8c9d0e2
                  body: Hi Jane, your session is confirmed.
                  created_at: 1718438400
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    teams:
      name: teams[]
      in: query
      description: >-
        Team scope for the request, as one or more team ObjectIds. The brackets
        are required: PHP keeps only the last value for a repeated plain key, so
        `teams=A&teams=B` silently resolves to B alone. On requests with a JSON
        body you may send `teams` (no brackets) in the body instead.


        **Values that are not valid ObjectIds are silently ignored** — a
        mistyped team ID behaves as if no team was sent. See the [teams section
        of the API conventions guide](/guides/api-conventions#team-scoping).
      style: form
      explode: true
      schema:
        type: array
        items:
          type: string
      example:
        - 64a1b2c3d4e5f6a7b8c9d0ff
  schemas:
    Envelope:
      type: object
      description: The common response envelope shared by all ConveYour endpoints.
      properties:
        status:
          type: string
          enum:
            - ok
            - failed
          description: '`ok` on success, `failed` on error.'
        message:
          type: string
          description: Human-readable description of the result.
        data:
          description: >-
            The response payload — an object or an array depending on the
            endpoint.
    MessageReport:
      allOf:
        - $ref: '#/components/schemas/Message'
        - type: object
          description: >-
            Both the list and single-message endpoints return these — they are
            not stored on the record.
          properties:
            name:
              type: string
              description: >-
                Display name of the related record — the bookmark, trigger,
                campaign or contact this message targeted. Falls back to the
                literal `type` string when the related record no longer exists.
                For a trigger_wait carrying a nudge it is prefixed `(#N) `.
            time:
              type: string
              description: >-
                Relative send time, e.g. "3 days ago". Computed at read time —
                not a timestamp.
            class:
              type: string
              description: >-
                Message class. Defaults to `sms` when the stored value is
                missing or empty, so it is never blank.
            sent:
              type: integer
              description: Number of sends recorded for this message.
            last_sent:
              type: integer
              description: Unix timestamp of the last send, or 0 when unknown.
            media_url:
              type: string
              description: >-
                Media URL when the message has a video_id; an empty string
                otherwise.
            open_count:
              type: integer
              description: Raw count of `open` events.
            opened:
              type: number
              description: >-
                Ratio of `open` events to sends, rounded to 2 decimals. `0` when
                nothing has been sent.
            click_count:
              type: integer
              description: Raw count of `click` events.
            clicked:
              type: number
              description: >-
                Ratio of `click` events to sends, rounded to 2 decimals. `0`
                when nothing has been sent.
            unsub_count:
              type: integer
              description: Raw count of `unsub` events.
            unsubs:
              type: number
              description: >-
                Ratio of `unsub` events to sends, rounded to 2 decimals. `0`
                when nothing has been sent.
            spam_count:
              type: integer
              description: Raw count of `spam` events.
            spam:
              type: number
              description: >-
                Ratio of `spam` events to sends, rounded to 2 decimals. `0` when
                nothing has been sent.
            watch_count:
              type: integer
              description: Raw count of `watch` events.
            watched:
              type: number
              description: >-
                Ratio of `watch` events to sends, rounded to 2 decimals. `0`
                when nothing has been sent.
            reply_count:
              type: integer
              description: Raw count of `reply` events.
            replied:
              type: number
              description: >-
                Ratio of `reply` events to sends, rounded to 2 decimals. `0`
                when nothing has been sent.
            bounce_count:
              type: integer
              description: Raw count of `bounce` events.
            bounces:
              type: number
              description: >-
                Ratio of `bounce` events to sends, rounded to 2 decimals. `0`
                when nothing has been sent.
            delivery_count:
              type: integer
              description: Raw count of `delivery` events.
            delivered:
              type: number
              description: >-
                Ratio of `delivery` events to sends, rounded to 2 decimals. `0`
                when nothing has been sent.
    Message:
      type: object
      description: A message.
      properties:
        id:
          type: string
          description: Message ID.
        org_id:
          type: integer
          description: Owning organization.
        user_id:
          type: integer
          description: User who sent it.
        class:
          type: string
          description: Message class, e.g. sms or email.
        type:
          type: string
          description: Recipient type, e.g. `contact` or `bookmark`.
        type_id:
          type: string
          description: ID of the recipient named by `type`.
        body:
          type: string
          description: Message body. Liquid is compiled at send time.
        snippet_id:
          type: string
          description: Snippet the body was built from, if any.
        inputs:
          type: object
          description: Values passed into the template.
        test:
          type: boolean
          description: Whether this is a test send.
        time:
          type: string
          description: Computed per request — relative time, e.g. "3 days ago".
        created_at:
          type: integer
          description: Unix timestamp.
        updated_at:
          type: integer
          description: Unix timestamp.
      required:
        - class
        - type
        - type_id
        - body
  responses:
    Forbidden:
      description: >-
        The token is missing or invalid, or the service account behind it lacks
        the permission this endpoint requires.
      content:
        application/json:
          example:
            status: failed
            message: Lacking necessary permission add_contacts
            data:
              permission: add_contacts
  securitySchemes:
    conveyourToken:
      type: apiKey
      in: header
      name: x-conveyour-token
      description: >-
        Your API key token. Contacts endpoints require a **Server-only — Full
        API** key — see [Authentication](/quickstart).

````

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