Tweet/Post management endpoints
21 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/tweets | Get tweets feed (تغذية المنشورات) |
POST | /api/tweets | Create a new tweet (إنشاء منشور جديد) |
DELETE | /api/tweets/{tweetId} | Delete a tweet (حذف المنشور) |
GET | /api/tweets/{tweetId} | Get tweet by ID (تفاصيل المنشور) |
PATCH | /api/tweets/{tweetId} | Edit a tweet (تعديل المنشور) |
DELETE | /api/tweets/{tweetId}/like | Remove your reaction (إلغاء التفاعل) |
POST | /api/tweets/{tweetId}/like | React to a post (تفاعل مع المنشور) |
GET | /api/tweets/{tweetId}/likes | Who reacted to a post (من تفاعل مع المنشور) |
PATCH | /api/tweets/{tweetId}/pin | Pin a tweet (تثبيت المنشور) |
GET | /api/tweets/{tweetId}/poll/results | Get poll results (نتائج الاستطلاع) |
POST | /api/tweets/{tweetId}/poll/vote | Vote on a poll (التصويت في استطلاع) |
DELETE | /api/tweets/{tweetId}/share-home | Remove a group post from the home feed (إلغاء المشاركة) |
POST | /api/tweets/{tweetId}/share-home | Share a group post to the home feed (مشاركة منشور المجموعة في الرئيسية) |
PATCH | /api/tweets/{tweetId}/unpin | Unpin a tweet (إلغاء تثبيت المنشور) |
GET | /api/tweets/pinned | Get pinned tweets (المنشورات المثبتة) |
GET | /api/tweets/scheduled | List scheduled posts (المنشورات المجدولة) |
POST | /api/tweets/scheduled | Schedule a post (جدولة منشور) |
DELETE | /api/tweets/scheduled/{id} | Cancel a scheduled post (إلغاء منشور مجدول) |
PATCH | /api/tweets/scheduled/{id} | Edit a scheduled post (تعديل منشور مجدول) |
POST | /api/tweets/scheduled/{id}/publish | Publish a scheduled post now (انشر الآن) |
GET | /api/tweets/user/{userId} | Get user's tweets (منشورات المستخدم) |
GET /api/tweetsReturns paginated tweets for the community or a specific group Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | query | yes | string (uuid) | Community ID |
groupId | query | no | string (uuid) | Filter by group (optional) |
type | query | no | enum: TEXT, IMAGE, VIDEO, DOCUMENT, POLL | Filter by tweet type |
page | query | no | integer | — |
limit | query | no | integer | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Paginated list of tweets | object |
401 | Authentication required | — |
POST /api/tweetsCreate a new tweet/post in the community or a specific group. Supports text, images, videos, documents, and polls.
- Max 10 media files per tweet
- Images: JPEG, PNG, GIF, WebP (max 10MB each)
- Videos: MP4, WebM, MOV, AVI (max 100MB each)
- Documents: PDF, Word, Excel, PowerPoint, TXT, RTF (max 10MB each)
Auth: Bearer JWT required.
Request body (required) — multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
communityId | string (uuid) | yes | Community ID |
groupId | string (uuid) | no | Optional group ID for group posts |
content | string | yes | Tweet text content |
type | enum: TEXT, IMAGE, VIDEO, DOCUMENT, POLL | no | — |
media | string (binary)[] | no | Media files (max 10) |
poll | string | no | JSON string for poll data: "question": "...", "options": ["A", "B"], "endDate": "2024-12-31T23:59:59Z", "allowMultipleVotes": false |
Responses
| Status | Description | Body |
|---|---|---|
201 | Tweet created successfully | object |
400 | Validation error | — |
401 | Authentication required | — |
403 | User is restricted from posting | — |
429 | Rate limit exceeded | — |
DELETE /api/tweets/{tweetId}Permanently delete a tweet. Only the author or moderators can delete. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Tweet deleted successfully | — |
403 | Not authorized to delete | — |
404 | Tweet not found | — |
GET /api/tweets/{tweetId}Returns detailed information about a specific tweet Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Tweet details | object |
404 | Tweet not found | — |
PATCH /api/tweets/{tweetId}Edit an existing tweet. Only the author or moderators can edit.
- Poll tweets cannot be edited after votes are cast
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
content | string | no | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Tweet updated successfully | — |
400 | Invalid request | — |
403 | Not authorized to edit | — |
404 | Tweet not found | — |
DELETE /api/tweets/{tweetId}/likeRemove your reaction from a post, whatever its type. Answers the same shape as POST. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Like removed successfully | — |
POST /api/tweets/{tweetId}/likeLeave a reaction on a post, or change it. One reaction per member per post:
sending another type replaces the first (the author is notified once, for
the first). Without type the reaction is LIKE, as it always was.
Rate limited.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Request body — application/json
| Field | Type | Required | Description |
|---|---|---|---|
type | enum: LIKE, CELEBRATE, SUPPORT, LOVE, INSIGHTFUL, FUNNY | no | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | { success, data: { success, liked, likesCount, myReaction, reactionCounts, topReactions } } — likesCount counts every type; reactionCounts has every type (zeros included); topReactions is the most used types, most first, at most 3. | — |
400 | type is not one of the six — { error: 'INVALID_REACTION_TYPE' } | — |
403 | User is restricted from liking | — |
429 | Rate limit exceeded | — |
GET /api/tweets/{tweetId}/likesThe members who reacted to a post — every type, or one (type) — newest
first, with their reaction and the name and picture
this community shows for them. Visible only to a signed-in member who may
read the post itself (private groups and hidden posts answer 404). Every
post response also carries its newest likers as recentLikers (at most 3).
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string | — |
communityId | query | yes | string | — |
page | query | no | integer | — |
limit | query | no | integer | — |
type | query | no | enum: ALL, LIKE, CELEBRATE, SUPPORT, LOVE, INSIGHTFUL, FUNNY | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | { success, data: { likers: [{ userId, firstName, familyName, avatar, reactionType, likedAt }], reactionCounts: { LIKE, CELEBRATE, SUPPORT, LOVE, INSIGHTFUL, FUNNY }, pagination: { page, limit, total, hasMore } } } — reactionCounts covers the whole post whatever type is; total is the count of the filtered list. | — |
400 | type is not ALL or one of the six — { error: 'INVALID_REACTION_TYPE' } | — |
401 | Not signed in | — |
403 | Not a member of the community | — |
404 | The post does not exist or the viewer may not read it | — |
PATCH /api/tweets/{tweetId}/pinPin a tweet to the top of the feed. Requires moderation permission. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Tweet pinned successfully | — |
403 | Permission denied | — |
GET /api/tweets/{tweetId}/poll/resultsReturns current poll results with vote counts Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Poll results | object |
404 | Tweet is not a poll | — |
POST /api/tweets/{tweetId}/poll/voteCast a vote on a poll tweet. Rate limited. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
optionId | string (uuid) | yes | Poll option ID to vote for |
Responses
| Status | Description | Body |
|---|---|---|
200 | Vote recorded successfully | — |
400 | Poll has ended or invalid option | — |
403 | User is restricted from voting | — |
429 | Rate limit exceeded | — |
DELETE /api/tweets/{tweetId}/share-homeThe post stays in its group. Same people as sharing, but the group switch is not required — removing is always allowed. Idempotent.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string | — |
communityId | query | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | The post, with sharedToHomeAt null. | — |
400 | NOT_A_GROUP_POST | — |
401 | Not signed in | — |
403 | GROUP_SHARE_FORBIDDEN or NOT_A_COMMUNITY_MEMBER | — |
404 | The post or its group does not exist | — |
POST /api/tweets/{tweetId}/share-homePuts a group post on the community home feed with a «من مجموعة …» badge. Allowed
only when the group's allowShareToHome switch is on (always off for a hidden
group), and only for the post's author, the group's admins/moderators, or a
community moderator of group posts. Once shared, the post — not the rest of the
group — is readable by every community member. Idempotent.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string | — |
communityId | query | yes | string | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | The post, with sharedToHomeAt set and group filled in. | — |
400 | NOT_A_GROUP_POST — a home post is already on the home feed | — |
401 | Not signed in | — |
403 | GROUP_SHARE_NOT_ALLOWED (the group's switch is off or the group is hidden), GROUP_SHARE_FORBIDDEN (not the author or a group moderator), NOT_A_COMMUNITY_MEMBER, or a posting restriction. | — |
404 | The post or its group does not exist | — |
PATCH /api/tweets/{tweetId}/unpinRemove pin from a tweet. Requires moderation permission. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Tweet unpinned successfully | — |
403 | Permission denied | — |
GET /api/tweets/pinnedReturns all pinned tweets for the community Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | query | yes | string (uuid) | — |
groupId | query | no | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | List of pinned tweets | — |
GET /api/tweets/scheduledScheduled posts still to come, and those that could not be published. A community admin sees every one in the community; a moderator only their own. Members get 403 SCHEDULE_NOT_ALLOWED.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | query | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | The list, soonest first | object |
403 | SCHEDULE_NOT_ALLOWED — not an admin or moderator of this community | — |
POST /api/tweets/scheduledThe create-post form (same fields and limits as POST /api/tweets) plus publishAt,
an ISO-8601 date-time WITH its offset, 5 minutes to 90 days ahead. Home posts only.
Attachments are uploaded now; the post is created at publishAt by the publisher job.
Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
communityId | query | yes | string (uuid) | — |
Request body (required) — multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
communityId | string (uuid) | yes | — |
publishAt | string (date-time) | yes | — |
content | string | no | — |
type | enum: TEXT, IMAGE, VIDEO, DOCUMENT, POLL | no | — |
allowComments | boolean | no | — |
isGuestVisible | boolean | no | — |
poll | string | no | JSON-encoded poll |
files | string (binary)[] | no | — |
Responses
| Status | Description | Body |
|---|---|---|
201 | Scheduled | — |
400 | INVALID_PUBLISH_AT, PUBLISH_AT_TOO_SOON, PUBLISH_AT_TOO_FAR, POLL_ENDS_BEFORE_PUBLISH, SCHEDULE_GROUP_POST_NOT_SUPPORTED, COMMUNITY_MISMATCH | — |
403 | SCHEDULE_NOT_ALLOWED | — |
DELETE /api/tweets/scheduled/{id}A SCHEDULED or FAILED post. Its author, or a community admin. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
communityId | query | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Cancelled | — |
403 | SCHEDULE_NOT_ALLOWED or SCHEDULED_POST_NOT_YOURS | — |
404 | SCHEDULED_POST_NOT_FOUND | — |
409 | SCHEDULED_POST_NOT_EDITABLE | — |
429 | RATE_LIMITED — 30 scheduled-post writes | — |
PATCH /api/tweets/scheduled/{id}Text and time only, and only while it is still SCHEDULED (else 409 SCHEDULED_POST_NOT_EDITABLE). Its author ONLY — an admin may publish it now or cancel it, never rewrite it (403 SCHEDULED_POST_NOT_YOURS). Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
communityId | query | yes | string (uuid) | — |
Request body — application/json
| Field | Type | Required | Description |
|---|---|---|---|
communityId | string (uuid) | no | — |
content | string | no | — |
publishAt | string (date-time) | no | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Updated | — |
403 | SCHEDULE_NOT_ALLOWED | — |
404 | SCHEDULED_POST_NOT_FOUND | — |
409 | SCHEDULED_POST_NOT_EDITABLE | — |
429 | RATE_LIMITED — 30 scheduled-post writes | — |
POST /api/tweets/scheduled/{id}/publishA SCHEDULED or FAILED post, through the same checks as posting now. Answers the new post's id. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
communityId | query | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Published | — |
403 | SCHEDULE_NOT_ALLOWED or SCHEDULED_POST_NOT_YOURS | — |
409 | SCHEDULED_POST_NOT_EDITABLE | — |
429 | RATE_LIMITED — 30 scheduled-post writes | — |
GET /api/tweets/user/{userId}Returns all tweets by a specific user Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
userId | path | yes | string (uuid) | — |
communityId | query | yes | string (uuid) | — |
page | query | no | integer | — |
limit | query | no | integer | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Paginated list of user's tweets | — |