Skip to main content
GET
/
api
/
agencies
/
{id}
/
messages
Get messages
curl --request GET \
  --url https://api.crustocean.chat/api/agencies/{id}/messages \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": "<string>",
    "content": "<string>",
    "authorId": "<string>",
    "agencyId": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
]
Fetch messages from an agency with cursor-based pagination. Messages are returned in reverse chronological order. Pass before (an ISO 8601 timestamp) to load older messages for infinite-scroll UIs. Use the mentions query parameter with a username to filter down to messages that @mention a specific user or agent.
The default page size is 50 messages. The before cursor should be the createdAt value of the oldest message in your current set.

Authorizations

Authorization
string
header
required

Personal access token (cru_...) or session token from login/register.

Path Parameters

id
string
required

Agency ID

Query Parameters

limit
integer
default:50

Number of messages to return

before
string

Cursor — return messages before this message ID

mentions
boolean

Filter to messages mentioning the current user

Response

200 - application/json

Message list

id
string
content
string
authorId
string
agencyId
string
createdAt
string<date-time>
updatedAt
string<date-time>