Group messaging endpoints
9 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/communities/{communityId}/groups/{groupId}/messages | Get paginated messages for a group |
POST | /api/communities/{communityId}/groups/{groupId}/messages | Send a new message to a group |
DELETE | /api/communities/{communityId}/groups/{groupId}/messages/{messageId} | Delete a message (soft delete) |
PUT | /api/communities/{communityId}/groups/{groupId}/messages/{messageId} | Update (edit) a message |
POST | /api/communities/{communityId}/groups/{groupId}/messages/{messageId}/hide | Hide a message from your own view («حذف لدي») |
POST | /api/communities/{communityId}/groups/{groupId}/messages/{messageId}/reactions | Add an emoji reaction to a message |
DELETE | /api/communities/{communityId}/groups/{groupId}/messages/{messageId}/reactions/{emoji} | Remove an emoji reaction from a message |
POST | /api/communities/{communityId}/groups/{groupId}/messages/{messageId}/read | Mark a message as read |
GET | /api/communities/{communityId}/groups/{groupId}/unread-count | Get unread message count for current user in a group |
GET /api/communities/{communityId}/groups/{groupId}/messagesAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
page | query | no | integer | — |
limit | query | no | integer | — |
before | query | no | string (date-time) | — |
after | query | no | string (date-time) | — |
search | query | no | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Paginated list of messages | — |
POST /api/communities/{communityId}/groups/{groupId}/messagesAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
content | string | yes | — |
replyToId | string (uuid) | no | — |
Responses
| Status | Description | Body |
|---|---|---|
201 | Message sent successfully | — |
403 | User is restricted from messaging | — |
DELETE /api/communities/{communityId}/groups/{groupId}/messages/{messageId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
messageId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Message deleted successfully | — |
403 | Not authorized | — |
PUT /api/communities/{communityId}/groups/{groupId}/messages/{messageId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
messageId | path | yes | string (uuid) | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
content | string | yes | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Message updated successfully | — |
403 | Not authorized or user is restricted | — |
POST /api/communities/{communityId}/groups/{groupId}/messages/{messageId}/hideRemoves one message from the caller's own message list only — every other member still sees it. Any member of the group may hide any message in it. Idempotent. To delete a message for everyone, use DELETE on the message.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string | — |
groupId | path | yes | string | — |
messageId | path | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Hidden for the caller | — |
403 | Not a member of the community or the group | — |
404 | MESSAGE_NOT_FOUND — the message is not in this group | — |
503 | MESSAGE_HIDE_UNAVAILABLE — the migration has not run yet | — |
POST /api/communities/{communityId}/groups/{groupId}/messages/{messageId}/reactionsAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
messageId | path | yes | string (uuid) | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
emoji | string | yes | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Reaction added successfully | — |
DELETE /api/communities/{communityId}/groups/{groupId}/messages/{messageId}/reactions/{emoji}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
messageId | path | yes | string (uuid) | — |
emoji | path | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Reaction removed successfully | — |
POST /api/communities/{communityId}/groups/{groupId}/messages/{messageId}/readAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
messageId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Message marked as read | — |
GET /api/communities/{communityId}/groups/{groupId}/unread-countAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Unread count | object |