Messages

List conversations

Changed on

This endpoint lets you list all the Conversations you have access to.

You can filter the conversations based on the Organization or the Business that they are related to.

If you want to keep an up-to-date list of ongoing conversations for your businesses, we recommend using the Message Received and Message Deleted Webhooks instead of periodically calling this endpoint.

⚠️ This endpoint is paginated using cursor pagination. This means that in order to get the next page of results, you need to provide the cursor returned in the previous call.

get/conversations

Request

Query parameters

per_pageinteger

Number of items to return per page.

cursorstring

The cursor identifiying the page of data to fetch. If no cursor is provided, the query will return the first page of data. A cursor for the next page of data is provided in the response of this request.

business__inBusinessId[]

Filter by business ids. Use a comma-separated list to provide multiple ids.

[
  "5409c35a97bbc544d8e26737"
]
last_message_date__gtestring datetime
Example:2023-01-01T00:00:00Z

Filter by the date of the last message of the conversation.

Return all the conversations whose last message date >= given_date.

For example: last_message_date__gte=2023-01-01T00:00:00Z will return all conversations whose last message was sent or received from the first of January 2023 onwards.

Note: the date must include an explicit UTC offset (e.g. the Z suffix, or +00:00). A date with no timezone information is rejected with a 400 error.

Combining this with last_message_date__lte defines a range: last_message_date__gte must not be later than last_message_date__lte, or the request is rejected with a 400 error.

last_message_date__ltestring datetime
Example:2023-01-31T23:59:59Z

Filter by the date of the last message of the conversation.

Return all the conversations whose last message date <= given_date.

For example: last_message_date__lte=2023-01-31T23:59:59Z will return all conversations whose last message was sent or received up until the 31st of January 2023.

Note: the date must include an explicit UTC offset (e.g. the Z suffix, or +00:00). A date with no timezone information is rejected with a 400 error.

Combining this with last_message_date__gte defines a range: last_message_date__gte must not be later than last_message_date__lte, or the request is rejected with a 400 error.

Response

OK

countinteger

Total number of results available for the filters and dimensions requested.

next_cursorstring nullable

The cursor to use in order to retrieve the next page of data. When all data have been fetched, the value is null.

Example response

{
  "conversations": [
    {
      "consumer_img": "https://www.example.com/profile-picture.jpg",
      "consumer_name": "John Doe",
      "consumer_phone_number": "+33612345678",
      "consumer_email": "john.doe@example.com",
      "last_message": {
        "date": "2023-01-31 16:22:17.327878+00:00",
        "sender_label": "Jane Doe"
      },
      "created_at": "2023-01-31 16:22:17.327878+00:00",
      "messaging_partner": "Facebook",
      "issues": [
        "facebook_no_page_linked"
      ],
      "last_message_date": "2023-01-31 16:22:17.327878+00:00",
      "assigned_user_id": "62d80fae74e8b11d700302b8"
    }
  ],
  "count": 1
}

Changes

    • info

      added the new optional query request parameter last_message_date__gte

    • info

      added the new optional query request parameter last_message_date__lte

    • info

      added the non-success response with the status

    • info

      added the optional property // to the response with the status