Loading…
Represents a chat, including its users, last message, unread count, and creation time.
| Field | Type | Description | Example |
|---|---|---|---|
| id | int | Unique identifier for the chat | 123 |
| users | array | List of user objects in the chat | [ { ... }, ... ] |
| last_message | object | Last message resource (nullable) | { ... } |
| unread_count | int | Number of unread messages | 0 |
| created_at | string | Creation timestamp, ISO 8601 with microseconds and Z | "2020-01-01T00:00:00.000000Z" |
| updated_at | string | Last update timestamp, same format as created_at | "2020-01-01T00:00:00.000000Z" |
Unlike most resources, created_at and updated_at are not cast to strings here, so they serialize in Carbon's
ISO 8601 form rather than YYYY-MM-DD HH:MM:SS.
users is present only when the endpoint loads it. Each user object includes all fields from the user resource,
plus:
is_owner: booleanlast_read_at: string (YYYY-MM-DD HH:MM:SS; set to the join time when the user is added){
"id": 123,
"users": [
{
/* user resource fields */
"is_owner": false,
"last_read_at": "2020-01-01 00:00:00"
}
],
"last_message": { /* chat message resource */ },
"unread_count": 0,
"created_at": "2020-01-01T00:00:00.000000Z",
"updated_at": "2020-01-01T00:00:00.000000Z"
}
For message schema, see Chat Message Resource.