Allmine API
Messages

List messages in a chat room

List messages in a chat room. Retrieves messages chat through GET /api/v1/messages/chat/{chatId}.

GET
/api/v1/messages/chat/{chatId}

List messages in a chat room. Retrieves messages chat through GET /api/v1/messages/chat/{chatId}.

Authorization

JWT-auth
AuthorizationBearer <token>

Paste the JWT access token without the Bearer prefix.

In: header

Path Parameters

chatId*string

Chat identifier

Query Parameters

page?number

Page number (starts at 1)

Default1
Range1 <= value
limit?number

Number of messages per page (max 100)

Default20
Range1 <= value <= 100

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/messages/chat/68cafe40b1b87fb90d9d4435"
{
  "messages": [
    {
      "_id": "64d15f9e2e6c8f4d5a123456",
      "chatId": "64d15f9e2e6c8f4d5a654321",
      "senderId": "64d15f9e2e6c8f4d5a111111",
      "type": "text",
      "content": "Hello there!",
      "media": {
        "url": "https://cdn.example.com/message/file.jpg",
        "type": "image",
        "name": "file.jpg",
        "size": 102400,
        "duration": 60,
        "width": 1920,
        "height": 1080,
        "thumbnail_url": "https://cdn.example.com/message/file-thumb.jpg"
      },
      "creditTransfer": {
        "amount": 25,
        "recipientId": "64d15f9e2e6c8f4d5a654321",
        "senderId": "64d15f9e2e6c8f4d5a123456"
      },
      "readBy": [
        "64d15f9e2e6c8f4d5a654321"
      ],
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "participants": [
    {
      "_id": "64d15f9e2e6c8f4d5a123456",
      "username": "johndoe",
      "profilePhoto": {
        "_id": "64d15f9e2e6c8f4d5a777777",
        "url": "https://cdn.example.com/uploads/profile.jpg",
        "type": "image"
      },
      "availabilityStatus": "available"
    }
  ],
  "page": 1,
  "limit": 20,
  "total": 125,
  "totalPages": 7,
  "hasNextPage": true,
  "hasPreviousPage": false
}
{
  "isSuccess": false,
  "statusCode": 400,
  "data": null,
  "errors": [
    "Validation failed"
  ],
  "timestamp": "2026-01-15T10:30:00.000Z"
}
{
  "isSuccess": false,
  "statusCode": 401,
  "data": null,
  "errors": [
    "Authentication required"
  ],
  "timestamp": "2026-01-15T10:30:00.000Z"
}
{
  "isSuccess": false,
  "statusCode": 403,
  "data": null,
  "errors": [
    "Insufficient permissions"
  ],
  "timestamp": "2026-01-15T10:30:00.000Z"
}
{
  "isSuccess": false,
  "statusCode": 404,
  "data": null,
  "errors": [
    "Resource not found"
  ],
  "timestamp": "2026-01-15T10:30:00.000Z"
}