Blogs

Blog post management

Get All Blogs

get

Retrieves a paginated list of blogs. Admins see all; users see only 'published'. Sorted by creation date descending.

Authorizations
AuthorizationstringRequired

JWT Access Token obtained via login/register/refresh

Query parameters
limitinteger · min: 1 · max: 50Optional

Maximum number of items to return.

Default: 20
offsetintegerOptional

Number of items to skip for pagination.

Default: 0
Responses
200

A list of blogs.

application/json
get
/blogs/

Create Blog Post (Admin)

post

Creates a new blog post. Requires banner image upload. Admin role required.

Authorizations
AuthorizationstringRequired

JWT Access Token obtained via login/register/refresh

Body
titlestring · max: 180Required
contentstringRequired

HTML content

statusstring · enumOptionalDefault: draftPossible values:
banner_imagestring · binaryRequired

Banner image file (png/jpg/webp, max 2MB)

Responses
post
/blogs/

Get Blogs by User

get

Retrieves a paginated list of blogs by a specific user. Admins see all; users see only 'published'. Sorted by creation date descending.

Authorizations
AuthorizationstringRequired

JWT Access Token obtained via login/register/refresh

Path parameters
userIdstring · objectidRequired

ID of the user.

Query parameters
limitinteger · min: 1 · max: 50Optional

Maximum number of items to return.

Default: 20
offsetintegerOptional

Number of items to skip for pagination.

Default: 0
Responses
200

A list of blogs by the specified user.

application/json
get
/blogs/user/{userId}

Get Blog by Slug

get

Retrieves a single blog post by its unique slug. Regular users cannot view 'draft' posts.

Authorizations
AuthorizationstringRequired

JWT Access Token obtained via login/register/refresh

Path parameters
slugstringRequired

Slug of the blog post.

Responses
200

The requested blog post.

application/json
get
/blogs/{slug}

Update Blog Post (Admin)

put

Updates an existing blog post. Banner update optional. Admin role required (route security).

Authorizations
AuthorizationstringRequired

JWT Access Token obtained via login/register/refresh

Path parameters
blogIdstring · objectidRequired

ID of the blog post.

Body
titlestring · max: 180Optional
contentstringOptional

HTML content

statusstring · enumOptionalPossible values:
banner_imagestring · binaryOptional

New banner image file (png/jpg/webp, max 2MB)

Responses
200

Blog post updated successfully.

application/json
put
/blogs/{blogId}

Delete Blog Post (Admin)

delete

Deletes a blog post by ID. Also removes banner. Admin role required (route security).

Authorizations
AuthorizationstringRequired

JWT Access Token obtained via login/register/refresh

Path parameters
blogIdstring · objectidRequired

ID of the blog post.

Responses
delete
/blogs/{blogId}

No content

Last updated

Was this helpful?