Overview
The Blog API provides comprehensive content management endpoints for articles, authors, categories, comments, and media. All Blog API endpoints require admin authentication.Articles
List Articles
Query Parameters
integer
default:"1"
Page number (1-indexed)
integer
default:"20"
Items per page (max: 100)
string
Search by slug
string
Filter by status:
draft, published, scheduled, archivedboolean
Filter featured articles (
true or false)boolean
Filter articles displayed on homepage
boolean
Filter articles displayed in blog listing
string
Filter by category ID
string
Filter by organization ID
string
Fetch single article by ID (returns full details with translations, authors, categories, media)
Create Article
From/src/pages/api/admin/blog/articles.ts:197-297:
Request Body
string
required
Must be
"create"string
required
URL-friendly slug (auto-generated if not provided)
string
default:"draft"
Article status:
draft, published, scheduled, archivedstring
default:"fr"
Primary language code (ISO 639-1)
string
Organization ID (nullable)
boolean
default:"false"
Show on homepage
boolean
default:"true"
Show in blog listing
boolean
default:"false"
Mark as featured
boolean
default:"true"
Enable comments
string
Estimated reading time (e.g., “5 min”)
string
Article word count
array
Array of translation objects (see structure above)
string[]
Array of author IDs
string[]
Array of category IDs
array
Array of media objects with
mediaId, type, positionUpdate Article
From/src/pages/api/admin/blog/articles.ts:299-409:
Other Article Actions
From/src/pages/api/admin/blog/articles.ts:411-534:
Publish Article
status to "published" and sets publishedAt to current timestamp.
Unpublish Article
Delete Article
Duplicate Article
"draft" and unique slug.
Authors
List Authors
From/src/pages/api/admin/blog/authors.ts:19-98:
Query Parameters
string
Fetch single author by ID (includes article count)
boolean
Return all authors (for selectors) with minimal fields
string
Search by slug
boolean
Filter featured authors
boolean
Filter authors displayed on homepage
boolean
Filter authors displayed in blog
Create Author
From/src/pages/api/admin/blog/authors.ts:122-166:
Response
Update/Delete Author
From/src/pages/api/admin/blog/authors.ts:168-238:
Categories
List Categories
From/src/pages/api/admin/blog/categories.ts:18-102:
Query Parameters
string
Fetch single category by ID
boolean
Return all categories (for selectors)
string
Filter by parent ID (use
"root" for top-level)Filter categories shown in menu
Create Category
From/src/pages/api/admin/blog/categories.ts:126-165:
Comments
List Comments
From/src/pages/api/admin/blog/comments.ts:13-66:
Query Parameters
string
Filter by status:
pending, approved, rejectedstring
Filter by post type
string
Search by author name or email
Response
Moderate Comments
From/src/pages/api/admin/blog/comments.ts:72-162:
Media
List Media
From/src/pages/api/admin/blog/media.ts:20-51:
Query Parameters
string
Filter by media type:
image, video, audiostring
Search by URL
Upload Media
From/src/pages/api/admin/blog/media.ts:57-210:
Configuration
- Upload directory:
public/uploads/blog - Max file size: 10 MB
- Allowed types: JPEG, PNG, WebP, AVIF, GIF, SVG
Form Fields
File
required
Image file to upload
string
Custom filename (auto-sanitized)
string
Alt text for accessibility
string
Image caption
string
Detailed description
Update/Delete Media
From/src/pages/api/admin/blog/media.ts:66-115:
Common Response Codes
Audit Logging
All Blog API actions are logged toaudit_log table:
blog.article.createblog.article.updateblog.article.deleteblog.article.publishblog.article.unpublishblog.article.duplicateblog.author.createblog.author.updateblog.author.deleteblog.category.createblog.category.updateblog.category.deleteblog.comment.approveblog.comment.rejectblog.comment.deleteblog.media.uploadblog.media.delete
Related Resources
API Overview
Authentication and rate limiting
Services API
Manage service listings