Blog Posts API
Create and manage blog content, categories, and tags programmatically.
List Posts
GET
/api/v1/postsRetrieve a list of blog posts
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status (draft, published, scheduled, archived) |
category_id | string | Filter by category ID |
category | string | Filter by category slug |
tag_id | string | Filter by tag ID |
tag | string | Filter by tag slug |
author_id | string | Filter by author |
featured | boolean | Only featured posts |
search | string | Full-text search |
order_by | string | Sort field Default: published_at |
order | string | Sort direction (asc or desc) Default: desc |
limit | number | Max results Default: 20 |
offset | number | Skip results Default: 0 |
Request
curl -X GET "https://api.webkasa.app/api/v1/posts?status=published&limit=10" \
-H "Authorization: Bearer wk_live_xxx..."Response
{
"data": [
{
"id": "post_abc123",
"title": "Introduction to Meditation",
"slug": "introduction-to-meditation",
"excerpt": "Learn the basics of meditation practice",
"featured_image_url": "https://example.com/image.jpg",
"status": "published",
"is_featured": true,
"published_at": "2024-01-15T10:00:00Z",
"category": {
"id": "cat_xyz",
"name": "Wellness",
"slug": "wellness"
},
"author": {
"id": "user_abc",
"name": "Jane Doe"
}
}
],
"meta": {
"total": 42,
"limit": 10,
"offset": 0,
"hasMore": true
}
}Get Post
GET
/api/v1/posts/{id}Retrieve a single post by ID
Request
curl -X GET "https://api.webkasa.app/api/v1/posts/post_abc123" \
-H "Authorization: Bearer wk_live_xxx..."Create Post
POST
/api/v1/postsCreate a new blog post
Request Body
| Parameter | Type | Description |
|---|---|---|
title required | string | Post title |
slug required | string | URL-friendly identifier |
excerpt | string | Short summary of the post |
content | array | Post content blocks (structured content) |
featured_image_url | string | URL to featured image |
category_id | string | Category ID |
status | string | Post status Default: draft |
is_featured | boolean | Whether post is featured Default: false |
Request
curl -X POST "https://api.webkasa.app/api/v1/posts" \
-H "Authorization: Bearer wk_live_xxx..." \
-H "Content-Type: application/json" \
-d '{
"title": "Introduction to Meditation",
"slug": "introduction-to-meditation",
"excerpt": "Learn the basics of meditation practice",
"content": [
{ "type": "paragraph", "text": "Meditation is a practice..." }
],
"featured_image_url": "https://example.com/image.jpg",
"category_id": "cat_abc123",
"status": "published",
"is_featured": true
}'Response
{
"data": {
"id": "post_abc123",
"title": "Introduction to Meditation",
"slug": "introduction-to-meditation",
"status": "published",
"created_at": "2024-01-01T00:00:00Z"
}
}List Categories
GET
/api/v1/posts/categoriesRetrieve all blog categories
Request
curl -X GET "https://api.webkasa.app/api/v1/posts/categories" \
-H "Authorization: Bearer wk_live_xxx..."Response
{
"data": [
{
"id": "cat_abc123",
"name": "Wellness",
"slug": "wellness",
"post_count": 15
},
{
"id": "cat_def456",
"name": "Mindfulness",
"slug": "mindfulness",
"post_count": 8
}
]
}List Tags
GET
/api/v1/posts/tagsRetrieve all blog tags
Request
curl -X GET "https://api.webkasa.app/api/v1/posts/tags" \
-H "Authorization: Bearer wk_live_xxx..."Content Format
Post content uses a structured block format:
{
"content": [
{ "type": "heading", "level": 1, "text": "Getting Started" },
{ "type": "paragraph", "text": "Welcome to our guide..." },
{ "type": "image", "url": "https://...", "alt": "Description" },
{ "type": "list", "items": ["Item 1", "Item 2"] },
{ "type": "quote", "text": "An inspiring quote", "author": "Author" }
]
}