---
title: "Get all messages"
method: GET
path: "/messages"
tags: ["Messages"]
---

# Get all messages

`GET /messages`

Get information about messages as a list.

## Query parameters

- `count` integer
- `offset` integer
- `sort_field` string
- `sort_direction` 'ASC' | 'DESC'
- `customer_id` string
- `contact` string
- `communication_channel_id` string
- `send_time_from` string
- `send_time_to` string

## Headers

- `Accept-Language` string

## Response `200`

OK

- object
  - `data` object
    - `messages` Message[] — List of all messages.
      - `message_id` string — The unique ID of the message.
      - `status` 0 | 1 | -1 | -2 | 2 | 4 | 5 — The status ID of the message. *Possible values are: 0 - message was not sent / 1 - message was sent successfully / -1 - message was not received (it was returned) / -2 - message was not received (soft bounce) / 2 - an error occurred while sending / 4 - customer has no agreements (GDPR) / 5 - Scheduled for retry (the message was not delivered because of an error and will be sent repeatedly. If not successful, the status will change to error.)*
      - `message_template_id` string, required — The unique ID of the message template. [GET /message-templates](https://carecloud.readme.io/reference/getmessagetemplates)
      - `customer_id` string, required — The unique ID of the customer. [GET /customers](https://carecloud.readme.io/reference/getcustomers)
      - `contact` string — Email address or phone number of customer in case of send message to different contact than customer has in database.
      - `title` string — Subject of the email message/ Title of notification message / Preview of the text message . Mandatory only in case of email template.
      - `send_time` string — Timestamp when the message was sent from the server to the recipient. Format: `YYYY-MM-DD HH:MM:SS`. All times are in the local timezone.
      - `opened_time` string — Timestamp when the message was opened by the recipient. Format: `YYYY-MM-DD HH:MM:SS`. All times are in the local timezone.
      - `mail_client_user_agent` string — User agent of the mail client application where message was opened.
      - `mail_client_language` string — Language of the mail client application where message was opened.
      - `communication_channel_id` 1 | 2 | 4 | 5, required — The unique ID of the communication channel. *Possible values are: 1 - email / 2- SMS / 4 - PUSH notification (Apple or Google)/ 5 - internal system notification* [GET /communication-channels](https://carecloud.readme.io/reference/getcommunicationchannels)
      - `message_data` Parameter[] — Message data could contains array of customized parameters. They may have influence on message display or add values to message.
        - `parameter_name` string, required — Name of the parameter.
        - `value` string, required — Value of the parameter.
      - `attachments` Attachment[] — List of the attachments for the message. A single attachment has a size limit of 1 MB. File type restrictions: .jpg, .jpeg, .png, .gif, and .pdf.
        - `upload_method` 'url' | 'base64', required — Method how to upload attachment file.
        - `file_data` string, required — File data to upload. It could URL address of the file or BASE64 encoded file.
        - `cache_for` integer — CareCloud can cache the attachment for a certain amount of minutes. If the cache parameter is not set, the attachment is not cached, and it's deleted after the message is sent.
      - `last_change` string — Timestamp of the last change. Format: `YYYY-MM-DD HH:MM:SS`. All times are in the local timezone.
    - `total_items` integer — The number of all found messages.

## Other responses

- `400` — Bad input parameter. The response body's `error.error_data.invalid_params[]` array lists the parameters that caused the failure, each carrying a `reason` code. See the `BadRequestErrorBody` schema for the generic reason taxonomy. Operations with domain-specific business rules document additional reasons at the operation level.
- `401` — The client has invalid credentials or auth token.
- `403` — The client does not exist or the client tried to access an unauthorized property or resource.
- `404` — The resource was not found.
- `405` — The resource does not support the specified HTTP method.
- `429` — Too many requests - more than the resource limit.
- `500` — Server is not working as expected.
- `503` — Temporary state when the service is temporarily unavailable, overloaded or there is a maintenance window.

---

[API](https://skmtc.net/crmcarecloud/apis/rest-api-reference.md) · [All operations](https://skmtc.net/crmcarecloud/apis/rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crmcarecloud/rest-api-reference/revisions/329c06dbf8d9/schema)
