Group messaging endpoints
10 endpoints.
| Method | Path | Summary |
|---|---|---|
DELETE | /api/communities/{communityId}/groups/{groupId}/members/{userId}/messages | Delete every message one member wrote in a group (moderator) |
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 |
DELETE /api/communities/{communityId}/groups/{groupId}/members/{userId}/messagesSoft-deletes all of the member's live messages in this group in one
statement — each stays in place as «تم حذف هذه الرسالة», like a single
delete. Open chats receive ONE messages:deleted socket event with every
id. Requires groups:manage or groups:moderate; a moderator cannot
delete a community admin's or another moderator's messages
(MESSAGE_AUTHOR_OUTRANKS_ACTOR). Works for a member who was already
removed from the group.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | path | yes | string (uuid) | — |
groupId | path | yes | string (uuid) | — |
userId | path | yes | string | The author's User.id |
Responses
| Status | Description | Body |
|---|---|---|
200 | Messages deleted | object |
403 | Missing groups:manage / groups:moderate, or MESSAGE_AUTHOR_OUTRANKS_ACTOR | — |
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 |