GetUserPresence
[POST] .../v1/chat/getuserpresence
Returns presence for users who share an active chat with the current user. Retrieve online/offline status for users that participate in chats together with the current request user. The request body is required and user_ids must contain at least one user identifier when filters are not used; filters metadata exposes user_id as the filter field. The response returns ChatUserPresence records with online and last_online_date values and access is scoped so the current user can see only users who share an active chat. Users without a shared active chat and the current user are omitted, so a successful result may be empty or contain fewer users than requested. Missing body, invalid filters or user identifiers, oversized selections, presence lookup failures and storage errors are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| filters | Array of Filter | Optional | Optional filters by fields available for this API method. |
Filterable Fields
| Field | Type | Description |
|---|---|---|
| user_id | int | User IDs whose presence should be returned. Required filter field. |
Request Example
{
"filters": [
{
"field": "user_id",
"operator": "In",
"value": "42,64"
}
]
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Array of ChatUserPresence | Result array. |
Response Example
{
"ok": true,
"result": [
{
"user_id": 42,
"online": true,
"last_online_date": 1767225600
},
{
"user_id": 64,
"online": false,
"last_online_date": 1767222000
}
]
}