---
title: "List messages"
method: GET
path: "/api/messages"
tags: ["Ticket Messages"]
---

# List messages

`GET /api/messages`

List messages matching the given parameters, paginated.

## Query parameters

- `cursor` string, nullable
- `limit` integer
- `order_by` 'created_datetime:asc' | 'created_datetime:desc'
- `ticket_id` integer, nullable

## Response `200`

A list of messages.

- object
  - `object` string, required
  - `uri` string, required
  - `data` TicketMessage[], required
    - `id` integer, required — ID of the message.
    - `uri` string, required — URI of the message.
    - `message_id` string, required — ID of the message on the service that sent the message.It can be the ID of an email, a Messenger message, a Facebook comment, etc...
    - `ticket_id` integer, required — The ID of the ticket the message is associated with.
    - `external_id` string, required — ID of the message in a foreign system (Aircall, Zendesk, etc...). This field is not used by Gorgias, feel free to set it as you wish.
    - `public` boolean — Whether the message was sent/receive by a customer. Internal notes are not public.
    - `channel` union, required — The channel used to send the message.
      - 'aircall' | 'api' | 'chat' | 'contact_form' | 'email' | 'facebook' | 'facebook-mention' | 'facebook-messenger' | 'facebook-recommendations' | 'help-center' | 'instagram-ad-comment' | 'instagram-comment' | 'instagram-direct-message' | 'instagram-mention' | 'internal-note' | 'phone' | 'sms' | 'twitter' | 'twitter-direct-message' | 'whatsapp' | 'yotpo-review'
      - string
    - `via` 'aircall' | 'api' | 'chat' | 'contact_form' | 'email' | 'facebook' | 'facebook-mention' | 'facebook-messenger' | 'facebook-recommendations' | 'form' | 'gorgias_chat' | 'help-center' | 'helpdesk' | 'instagram' | 'instagram-ad-comment' | 'instagram-comment' | 'instagram-direct-message' | 'instagram-mention' | 'internal-note' | 'offline_capture' | 'phone' | 'rule' | 'self_service' | 'shopify' | 'sms' | 'twilio' | 'twitter' | 'twitter-direct-message' | 'whatsapp' | 'yotpo' | 'yotpo-review' | 'zendesk', required
    - `source` TicketMessageSource, required
      - `type` string, required — Describes a more detailed channel information of how the message was sent/received. Either the slug of a non-legacy channel or one of aircall,api,app,chat,chat-contact-form,chat-offline-capture,contact-form,email,facebook-comment,facebook-message,facebook-messenger,facebook-post,facebook-mention-post,facebook-mention-comment,facebook,facebook-review,facebook-review-comment,form,help-center,helpdesk,instagram-ad-comment,instagram-ad-media,instagram-comment,instagram-mention-comment,instagram-media,instagram-mention-media,instagram,instagram-direct-message,internal-note,ottspott-call,phone,rule,self_service,shopify,sms,system-message,twilio,yotpo-review,yotpo-review-public-comment,yotpo-review-private-comment,twitter-tweet,twitter-quoted-tweet,twitter-mention-tweet,twitter-direct-message,help-center-contact-form,whatsapp-message.
      - `to` TicketMessageSourceAddress[] — A list of To addresses. To and From are usually present for most channel types.
        - `name` string
        - `address` string
      - `cc` TicketMessageSourceAddress[] — A list of CC addresses. Only present in an email context.
        - `name` string
        - `address` string
      - `bcc` TicketMessageSourceAddress[] — A list of BCC addresses. Only present in an email context.
        - `name` string
        - `address` string
      - `from` TicketMessageSourceAddress
        - `name` string
        - `address` string
      - `extra` unknown
    - `sender` TicketMessageUserOrCustomer, required
      - `id` integer, required
      - `email` string, required
      - `name` string, required
      - `firstname` string, required
      - `lastname` string, required
      - `meta` unknown, required
    - `auth_customer_identity` TicketMessageAuthCustomerIdentity, required
      - `service` TicketMessageAuthCustomerIdentityService, required
        - `id` string, required — The ID of the service the identity belongs to.
        - `name` string, required — The name of the service the identity belongs to.
      - `identifier` string, required — The ID of the customer related to the service. E.g.: email address, phone number, Shopify customer ID, etc.
    - `integration_id` integer, required — ID of the integration that either received or sent the message.
    - `intents` TicketMessageIntent[], required
      - `name` string, required — The intention the message probably has, example: discount/request
      - `rejected` boolean, required — Whether or not the intent was rejected
      - `is_user_feedback` boolean, required — Whether or not the intent comes from a user feedback
    - `rule_id` integer, required — ID of the rule which sent the message, if any.
    - `from_agent` boolean, required — Whether the message was sent by your company to a customer, or the opposite.
    - `receiver` TicketMessageUserOrCustomer, required
      - `id` integer, required
      - `email` string, required
      - `name` string, required
      - `firstname` string, required
      - `lastname` string, required
      - `meta` unknown, required
    - `subject` string, required — The subject of the message.
    - `body_text` string, required — The full text version of the body of the message, if any.
    - `body_html` string, required — The full HTML version of the body of the message, if any.
    - `stripped_text` string, required — The text version of the body of the message without email signatures and previous replies.
    - `stripped_html` string, required — The HTML version of the body of the message without email signatures and previous replies.
    - `stripped_signature` string, required
    - `attachments` TicketMessageAttachment[], required — A list of files attached to the message.
      - `url` string, required — The URL to access to the attached file.
      - `name` string — The name of the file.
      - `size` integer — The size of the file, in bytes.
      - `content_type` string, required — The MIME type of the file.
      - `public` boolean — Whether or not the attachment can be accessed.
      - `extra` unknown
    - `macros` TicketMessageMacro[] — A list of macros.
      - `id` integer, required
    - `actions` object[], required — A list of actions executed before the message was sent. These actions are set by macros.
    - `headers` object — Message headers. Used for email messages.
    - `imported` boolean, required — Whether the message was created by a historical import.
    - `meta` unknown, required
    - `created_datetime` string, date-time, required — When the message was created.
    - `processed_datetime` string, date-time, required — When the message was processed by Gorgias. Differs from `created_datetime` which refers to the external service.
    - `deleted_datetime` string, date-time — When the message was deleted.
    - `sent_datetime` string, date-time, required — When the message was sent. If omitted, the message will be sent by Gorgias.
    - `failed_datetime` string, date-time, required — When the message failed to be sent. Messages that couldn't be sent can be resend.
    - `opened_datetime` string, date-time, required — When the message was opened by the primary receiver.
    - `last_sending_error` TicketMessageSendingError, required
      - `error` string, required
    - `is_retriable` boolean, required — It determines if the message can be retried or not.
    - `replied_by` TicketMessageRepliedByOrTo
      - `integration_id` integer, required — ID of the integration which created the message.
      - `message_id` string, required — ID of the message in Gorgias.
      - `created_datetime` string, date-time, required — When the message was created.
      - `body_text` string, required — The full text version of the body of the message, if any.
      - `source` TicketMessageSource, required
        - `type` string, required — Describes a more detailed channel information of how the message was sent/received. Either the slug of a non-legacy channel or one of aircall,api,app,chat,chat-contact-form,chat-offline-capture,contact-form,email,facebook-comment,facebook-message,facebook-messenger,facebook-post,facebook-mention-post,facebook-mention-comment,facebook,facebook-review,facebook-review-comment,form,help-center,helpdesk,instagram-ad-comment,instagram-ad-media,instagram-comment,instagram-mention-comment,instagram-media,instagram-mention-media,instagram,instagram-direct-message,internal-note,ottspott-call,phone,rule,self_service,shopify,sms,system-message,twilio,yotpo-review,yotpo-review-public-comment,yotpo-review-private-comment,twitter-tweet,twitter-quoted-tweet,twitter-mention-tweet,twitter-direct-message,help-center-contact-form,whatsapp-message.
        - `to` TicketMessageSourceAddress[] — A list of To addresses. To and From are usually present for most channel types.
          - `name` string
          - `address` string
        - `cc` TicketMessageSourceAddress[] — A list of CC addresses. Only present in an email context.
          - `name` string
          - `address` string
        - `bcc` TicketMessageSourceAddress[] — A list of BCC addresses. Only present in an email context.
          - `name` string
          - `address` string
        - `from` TicketMessageSourceAddress
          - `name` string
          - `address` string
        - `extra` unknown
      - `customer` TicketMessageUserOrCustomer, required
        - `id` integer, required
        - `email` string, required
        - `name` string, required
        - `firstname` string, required
        - `lastname` string, required
        - `meta` unknown, required
      - `user` TicketMessageUserOrCustomer, required
        - `id` integer, required
        - `email` string, required
        - `name` string, required
        - `firstname` string, required
        - `lastname` string, required
        - `meta` unknown, required
    - `replied_to` TicketMessageRepliedByOrTo
      - `integration_id` integer, required — ID of the integration which created the message.
      - `message_id` string, required — ID of the message in Gorgias.
      - `created_datetime` string, date-time, required — When the message was created.
      - `body_text` string, required — The full text version of the body of the message, if any.
      - `source` TicketMessageSource, required
        - `type` string, required — Describes a more detailed channel information of how the message was sent/received. Either the slug of a non-legacy channel or one of aircall,api,app,chat,chat-contact-form,chat-offline-capture,contact-form,email,facebook-comment,facebook-message,facebook-messenger,facebook-post,facebook-mention-post,facebook-mention-comment,facebook,facebook-review,facebook-review-comment,form,help-center,helpdesk,instagram-ad-comment,instagram-ad-media,instagram-comment,instagram-mention-comment,instagram-media,instagram-mention-media,instagram,instagram-direct-message,internal-note,ottspott-call,phone,rule,self_service,shopify,sms,system-message,twilio,yotpo-review,yotpo-review-public-comment,yotpo-review-private-comment,twitter-tweet,twitter-quoted-tweet,twitter-mention-tweet,twitter-direct-message,help-center-contact-form,whatsapp-message.
        - `to` TicketMessageSourceAddress[] — A list of To addresses. To and From are usually present for most channel types.
          - `name` string
          - `address` string
        - `cc` TicketMessageSourceAddress[] — A list of CC addresses. Only present in an email context.
          - `name` string
          - `address` string
        - `bcc` TicketMessageSourceAddress[] — A list of BCC addresses. Only present in an email context.
          - `name` string
          - `address` string
        - `from` TicketMessageSourceAddress
          - `name` string
          - `address` string
        - `extra` unknown
      - `customer` TicketMessageUserOrCustomer, required
        - `id` integer, required
        - `email` string, required
        - `name` string, required
        - `firstname` string, required
        - `lastname` string, required
        - `meta` unknown, required
      - `user` TicketMessageUserOrCustomer, required
        - `id` integer, required
        - `email` string, required
        - `name` string, required
        - `firstname` string, required
        - `lastname` string, required
        - `meta` unknown, required
  - `meta` CursorPaginationMeta, required
    - `prev_cursor` string, required
    - `next_cursor` string, required
    - `total_resources` integer, required

---

[API](https://skmtc.net/gorgias/apis/gorgias-rest-api.md) · [All operations](https://skmtc.net/gorgias/apis/gorgias-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gorgias/gorgias-rest-api/versions/36f2e31f4e81/schema)
