Skip to main content

Blogs

Blog posts are the primary content type in Forja. They support localization, categories, editorial workflow, document attachments, and RSS feeds.

Endpoints

MethodPathPermissionDescription
GET/sites/{site_id}/blogs?page&per_pageReadList all blogs (paginated)
GET/sites/{site_id}/blogs/published?page&per_pageReadList published blogs
GET/sites/{site_id}/blogs/featured?limitReadList featured blogs
GET/sites/{site_id}/blogs/{id}/similar?limitReadList similar blogs by taxonomy overlap
GET/sites/{site_id}/blogs/by-slug/{slug}ReadGet blog by slug
GET/blogs/{id}ReadGet blog by ID
GET/blogs/{id}/detailReadGet blog with localizations, categories, and documents
POST/blogsAuthorCreate a blog post
PUT/blogs/{id}AuthorUpdate a blog post
DELETE/blogs/{id}EditorSoft delete a blog post
POST/blogs/{id}/cloneAuthorClone a blog as a new Draft
POST/blogs/{id}/reviewReviewerApprove or request changes
GET/blogs/{id}/localizationsReadGet all localizations
POST/blogs/{id}/localizationsAuthorCreate a localization
PUT/blogs/localizations/{loc_id}AuthorUpdate a localization
DELETE/blogs/localizations/{loc_id}EditorDelete a localization
GET/sites/{site_id}/feed.rssReadRSS 2.0 feed of published posts
POST/sites/{site_id}/blogs/bulkAuthor/EditorBulk status update or delete

List Blogs

curl -H "X-API-Key: oy_live_abc123..." \
"https://your-domain.com/api/v1/sites/{site_id}/blogs?page=1&per_page=10"

Response 200 OK -- Paginated list with data and meta fields.

Get Blog Detail

Returns the blog post with all localizations, assigned categories, and attached documents in a single response.

curl -H "X-API-Key: oy_live_abc123..." \
https://your-domain.com/api/v1/blogs/{id}/detail

Create a Blog

curl -X POST \
-H "X-API-Key: oy_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"site_ids": ["550e8400-..."],
"slug": "my-first-post",
"author": "John Doe",
"status": "Draft"
}' \
https://your-domain.com/api/v1/blogs

Response 201 Created

Similar Blogs

Returns blogs similar to the given blog post, ranked by taxonomy overlap. Scoring: shared tags (+3 each), shared categories (+2 each), primary category match (+3 bonus), same author (+1). Only published blogs with a score > 0 are returned. If nothing is similar, the response is an empty array.

curl -H "X-API-Key: oy_live_abc123..." \
"https://your-domain.com/api/v1/sites/{site_id}/blogs/{id}/similar?limit=3"

Query Parameters

ParameterDefaultMaxDescription
limit310Number of similar blogs to return

Response 200 OK -- Array of BlogListItem objects sorted by relevance score (descending), then by published_date (most recent first).

Editorial Workflow

Content follows the lifecycle: Draft -> InReview -> Published (or Scheduled). Submitting content for review notifies reviewers. Reviewers can approve (moves to Published/Scheduled) or request changes (moves back to Draft).

curl -X POST \
-H "X-API-Key: oy_live_abc123..." \
-H "Content-Type: application/json" \
-d '{"action": "Approve"}' \
https://your-domain.com/api/v1/blogs/{id}/review

RSS Feed

Returns an RSS 2.0 XML feed of the last 50 published blog posts. The response has Content-Type: application/rss+xml and is cached for 1 hour.

curl -H "X-API-Key: oy_live_abc123..." \
https://your-domain.com/api/v1/sites/{site_id}/feed.rss

Bulk Actions

Perform bulk status updates or deletes on multiple blogs at once. Delete requires Editor role; status update requires Author role.

curl -X POST \
-H "X-API-Key: oy_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"action": "UpdateStatus",
"ids": ["id1", "id2"],
"status": "Published"
}' \
https://your-domain.com/api/v1/sites/{site_id}/blogs/bulk