Allmine API
Chats

Kendi sohbet odalarımı getir

Kullanıcının dahil olduğu tüm sohbet odalarını listeler

GET
/api/v1/chats

Kullanıcının dahil olduğu tüm sohbet odalarını listeler

Authorization

JWT-auth
AuthorizationBearer <token>

Paste the JWT access token without the Bearer prefix.

In: header

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/chats"
[
  {
    "_id": "68cafe40b1b87fb90d9d4435",
    "members": [
      {
        "_id": "64d15f9e2e6c8f4d5a123456",
        "username": "johndoe",
        "profilePhoto": {
          "_id": "64d15f9e2e6c8f4d5a777777",
          "url": "https://cdn.example.com/uploads/profile.jpg",
          "type": "image"
        },
        "availabilityStatus": "available"
      }
    ],
    "lastMessage": {
      "_id": "68cafe40b1b87fb90d9d4437",
      "chatId": "68cafe40b1b87fb90d9d4435",
      "senderId": "68ade84080177ed3b14ed4ad",
      "type": "text",
      "content": "Hey 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"
      },
      "createdAt": "2025-09-17T18:30:24.848Z",
      "updatedAt": "2025-09-17T18:30:24.848Z"
    },
    "isRecent": true,
    "createdAt": "2025-09-17T18:30:24.441Z",
    "updatedAt": "2025-09-17T18:30:24.848Z"
  }
]
{
  "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"
}