9 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/blogs | List blogs |
POST | /api/blogs | Create a new blog |
DELETE | /api/blogs/{id} | Delete a blog |
GET | /api/blogs/{id} | Get blog by ID |
PUT | /api/blogs/{id} | Update a blog |
GET | /api/blogs/{id}/like | Get blog likes |
POST | /api/blogs/{id}/like | Like or unlike a blog |
GET | /api/blogs/{id}/like-status | Check if current user has liked a blog |
PATCH | /api/blogs/{id}/toggle-visibility | Toggle blog visibility (moderator action) |
GET /api/blogsAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
page | query | no | integer | — |
limit | query | no | integer | — |
search | query | no | string | — |
categoryId | query | no | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Paginated list of blogs | — |
POST /api/blogsAuth: Bearer JWT required.
Request body (required) — multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
title | string | yes | — |
titleArabic | string | yes | — |
content | string | yes | — |
contentHtml | string | no | — |
headerImage | string (binary) | no | — |
categoryId | string (uuid) | no | — |
isPublished | boolean | no | — |
Responses
| Status | Description | Body |
|---|---|---|
201 | Blog created successfully | — |
403 | Permission denied | — |
DELETE /api/blogs/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Blog deleted successfully | — |
403 | Permission denied | — |
GET /api/blogs/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Blog details | — |
404 | Blog not found | — |
PUT /api/blogs/{id}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
Request body — multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
title | string | no | — |
titleArabic | string | no | — |
content | string | no | — |
contentHtml | string | no | — |
headerImage | string (binary) | no | — |
categoryId | string (uuid) | no | — |
isPublished | boolean | no | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Blog updated successfully | — |
403 | Permission denied | — |
GET /api/blogs/{id}/likeAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
page | query | no | integer | — |
limit | query | no | integer | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | List of likes | — |
POST /api/blogs/{id}/likeAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Like toggled successfully | — |
GET /api/blogs/{id}/like-statusAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Like status | — |
PATCH /api/blogs/{id}/toggle-visibilityAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Visibility toggled successfully | — |
403 | Permission denied | — |