> ## 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.

# List messages

> Returns outbound messages for the org (excludes thread replies — only original sent messages).

**Result cap:** at most **100 messages**, sorted newest first (`created_at` descending). This endpoint does not paginate, so there is no way to reach older messages beyond the first 100.

**Truncated body:** `body` comes back shortened on this endpoint. Fetch a message by ID for the full text.

**Silently omitted records:** a message whose related bookmark, trigger or campaign has been deleted resolves its `name` to the bare type string and is filtered out of the response.

**Conversations vs messages.** Most day-to-day work happens against conversations — `GET /api/messages/conversations` returns the threaded view, while this endpoint lists original outbound sends only and excludes thread replies.



## OpenAPI

````yaml /api-reference/specs/messages.json get /api/messages
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:
    get:
      tags:
        - Messages
      summary: List messages
      description: >-
        Returns outbound messages for the org (excludes thread replies — only
        original sent messages).


        **Result cap:** at most **100 messages**, sorted newest first
        (`created_at` descending). This endpoint does not paginate, so there is
        no way to reach older messages beyond the first 100.


        **Truncated body:** `body` comes back shortened on this endpoint. Fetch
        a message by ID for the full text.


        **Silently omitted records:** a message whose related bookmark, trigger
        or campaign has been deleted resolves its `name` to the bare type string
        and is filtered out of the response.


        **Conversations vs messages.** Most day-to-day work happens against
        conversations — `GET /api/messages/conversations` returns the threaded
        view, while this endpoint lists original outbound sends only and
        excludes thread replies.
      operationId: listOutboundMessages
      parameters:
        - name: types
          in: query
          description: >-
            Filter by message type(s). Valid values: `contact`, `bookmark`,
            `trigger`, `campaign`, `trigger_lesson`, `trigger_wait`. Invalid
            values are dropped; if nothing valid remains the filter falls back
            to **all** types rather than erroring.
          schema:
            type: array
            items:
              type: string
              enum:
                - contact
                - bookmark
                - trigger
                - campaign
                - trigger_lesson
                - trigger_wait
        - name: creators
          in: query
          description: >-
            Filter by creator type(s). Valid values: `user`, `system`, `team`,
            `automatic`. Omit it and all four are used. **But** if you pass a
            value and none of it is valid, the filter silently narrows to `user`
            only — the opposite of how `types` behaves. No error is returned
            either way.
          schema:
            type: array
            items:
              type: string
              enum:
                - user
                - system
                - team
                - automatic
        - $ref: '#/components/parameters/teams'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/MessageListRecord'
                        description: Up to 100 messages, newest first.
              example:
                status: ok
                message: success
                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.
    MessageListRecord:
      allOf:
        - $ref: '#/components/schemas/MessageReport'
        - type: object
          properties:
            body:
              type: string
              description: >-
                TRUNCATED on this endpoint. The list returns a shortened `body`;
                fetch a single message for the full text. Fetch the message by
                ID for the full text.
    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.