Blog Posts API

Create and manage blog content, categories, and tags programmatically.

List Posts

GET/api/v1/posts

Retrieve a list of blog posts

Query Parameters

ParameterTypeDescription
site_idstringFilter posts to a specific site UUID
statusstringFilter by status (draft, published, scheduled, archived)
category_idstringFilter by category ID
categorystringFilter by category slug
tag_idstringFilter by tag ID
tagstringFilter by tag slug
author_idstringFilter by author
featuredbooleanOnly featured posts
searchstringFull-text search
order_bystringSort field
Default: published_at
orderstringSort direction (asc or desc)
Default: desc
limitnumberMax results
Default: 20
offsetnumberSkip results
Default: 0
Request
curl -X GET "https://api.webkasa.app/api/v1/posts?site_id=1e22232e-0461-477b-9097-158b262aee0d&status=published&limit=10" \
  -H "Authorization: Bearer wk_live_xxx..."

Response

200 OK
{
  "data": [
    {
      "id": "post_abc123",
      "site_id": "1e22232e-0461-477b-9097-158b262aee0d",
      "title": "Introduction to Meditation",
      "slug": "introduction-to-meditation",
      "excerpt": "Learn the basics of meditation practice",
      "featured_image_url": "https://example.com/image.jpg",
      "author_name": "Jane Doe",
      "author_avatar": "https://example.com/jane.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-or-slug}

Retrieve a single post by ID, or by slug when site_id is provided

Request
curl -X GET "https://api.webkasa.app/api/v1/posts/introduction-to-meditation?site_id=1e22232e-0461-477b-9097-158b262aee0d" \
  -H "Authorization: Bearer wk_live_xxx..."

Create Post

POST/api/v1/posts

Create a new blog post

Request Body

ParameterTypeDescription
site_idstringSite UUID that owns the post
title requiredstringPost title
slug requiredstringURL-friendly identifier
excerptstringShort summary of the post
contentarrayPost content blocks (structured content)
featured_image_urlstringURL to featured image
author_namestringDisplay author name
author_avatarstringDisplay author avatar URL
category_idstringCategory ID
statusstringPost status
Default: draft
is_featuredbooleanWhether 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 '{
    "site_id": "1e22232e-0461-477b-9097-158b262aee0d",
    "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",
    "author_name": "Jane Doe",
    "author_avatar": "https://example.com/jane.jpg",
    "category_id": "cat_abc123",
    "status": "published",
    "is_featured": true
  }'

Response

201 Created
{
  "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/categories

Retrieve all blog categories

Request
curl -X GET "https://api.webkasa.app/api/v1/posts/categories" \
  -H "Authorization: Bearer wk_live_xxx..."

Response

200 OK
{
  "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/tags

Retrieve 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" }
  ]
}