Skip to main content
GET
/
workers
/
{id}
/
chats
/
{chat_id}
/
messages
Get Chat Messages
curl --request GET \
  --url https://api.roostedhr.com/api/1_12/workers/{id}/chats/{chat_id}/messages \
  --header 'X-API-KEY: <api-key>'
{
  "messages": [
    {
      "id": "rxsVGOYHC9u",
      "message": "Hello there",
      "sender_id": "5",
      "sender_name": "Chris Davis",
      "date_created": "2024-01-05T17:10:00.000Z",
      "read": "1"
    },
    {
      "id": "HavJuiLxDiR",
      "message": "Hi, how are you?",
      "sender_id": "12",
      "sender_name": "Jane Smith",
      "date_created": "2024-01-05T17:11:00.000Z",
      "read": "0"
    }
  ],
  "has_more": true
}
This endpoint uses cursor-based pagination for infinite scroll. Pass last_seen_id with the ID of the last message from the previous page to fetch the next set of results. Omit it for the first page.

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

Worker ID

chat_id
string
required

Chat ID

Query Parameters

last_seen_id
string

ID of the last message from the previous page. Omit for the first page.

limit
integer
default:20

Maximum number of messages to return per page.

Response

OK

messages
object[]

List of chat messages.

has_more
boolean

Whether there are more messages available beyond this page.