13 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 | Unlike a tweet (إلغاء الإعجاب) |
POST | /api/tweets/{tweetId}/like | Like a tweet (إعجاب بالمنشور) |
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 (التصويت في استطلاع) |
PATCH | /api/tweets/{tweetId}/unpin | Unpin a tweet (إلغاء تثبيت المنشور) |
GET | /api/tweets/pinned | Get pinned tweets (المنشورات المثبتة) |
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 like from a tweet 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}/likeAdd a like to a tweet. Rate limited. Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Tweet liked successfully | — |
403 | User is restricted from liking | — |
429 | Rate limit exceeded | — |
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 | — |
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/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 | — |