latestOpenAPI 3.1.02026-08-193894215.9 MB

23dfbe1a0d1f

Messages

List messages

Returns a paginated list of messages within a specific experience chat, DM, or group chat channel, sorted by creation time.

Required permissions (one of):

  • chat:read
  • dms:read
  • support_chat:read
get/messages

Query parameters

afterstring

Returns the elements in the list that come after the specified cursor.

beforestring

Returns the elements in the list that come before the specified cursor.

firstinteger

Returns the first n elements from the list.

Example:42
lastinteger

Returns the last n elements from the list.

Example:42
channel_idstring required

The unique identifier of the channel or experience to list messages for.

direction'asc' | 'desc'

The direction of the sort.

Response

A successful response

Example response

{
  "data": [
    {
      "content": "Hey, are you available for a **quick call**?",
      "created_at": "2023-12-01T05:00:00.401Z",
      "poll_votes": [
        {
          "count": 42
        }
      ],
      "reaction_counts": [
        {
          "count": 42
        }
      ],
      "updated_at": "2023-12-01T05:00:00.401Z",
      "user": {
        "id": "user_xxxxxxxxxxxxx",
        "name": "John Doe",
        "username": "johndoe42"
      },
      "view_count": 42
    }
  ]
}