Skip to content

Get Unread Count

Get the unread message count for a member across all conversations.

The get unread count endpoint allows you to retrieve the unread message count for a specific member across all conversations in your workspace. Each item in the response includes the job ID, unread count, and information about the latest message.

Endpoint

MethodUrl
GET/v1.0/members/{user_id}/unread_count

Path Parameters

user_id
•
UUID
required

The member's user ID to query unread message counts for.

Query Parameters

limit
•
number

The maximum number of conversations to return. If not provided, the service will default to 1000 conversations.

Sample Request

bash
Copied
1curl -X GET 'https://api.worklayer.com/v1.0/members/a6e5ea2f-7d96-4852-9f46-2383dfd572f7/unread_count?limit=100' \
2-H 'Authorization: Bearer {token}'

Response

data
•
list

An array of unread message count objects for each job.

job_id
•
UUID

The unique identifier for the job.

unread_count
•
number

The number of unread messages for this job.

latest_message_id
•
UUID

The unique identifier of the latest message.

latest_message_time
•
timestamp

The timestamp when the latest message was created.

next_page_token
•
string or null

The pagination token to retrieve the next page of results. If the value is null, it means no further results for the request.

Sample Response

json
Copied
1{
2 "data": [
3 {
4 "job_id": "9a8f5969-20f7-4581-9a3a-1a41f9d4f7f4",
5 "unread_count": 2,
6 "latest_message_id": "873eb165-3a9f-443d-b273-b72a1d9fa2da",
7 "latest_message_time": "2025-11-03T21:22:33.266Z"
8 },
9 {
10 "job_id": "a8020c89-d878-4e5b-b7dc-409118077d63",
11 "unread_count": 2,
12 "latest_message_id": "dd313afe-8348-4f25-b327-1faf2244710a",
13 "latest_message_time": "2025-11-03T21:15:49.588Z"
14 },
15 {
16 "job_id": "1546f8d7-4b8c-4aeb-b568-c4d8ecc27cbc",
17 "unread_count": 1,
18 "latest_message_id": "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
19 "latest_message_time": "2025-11-03T21:13:48.879Z"
20 }
21 ],
22 "next_page_token": null
23}

Errors

  1. Forbidden: API Client does not have permission to access this member's unread message count.
  2. Unauthorized: API Client does not have valid credentials.
  3. NotFound: The unread message count was not found or the workspace was not found.
  4. BadRequest: Either the user_id is in an incorrect format, or there was a malformed request.

Last updated on November 7, 2025