---
title: "Create post"
method: POST
path: "/blogs/{blogId}/posts"
tags: ["Posts"]
---

# Create post

`POST /blogs/{blogId}/posts`

## Request

- Base URL: `https://api-docs.justblogged.com/api`
- URL: `https://api-docs.justblogged.com/api/blogs/{blogId}/posts`
- Auth: HTTP bearer

Create a new blog post. collection_id is optional; when omitted, the blog's empty-slug default Posts collection is used. If that default does not exist, collection_id is required.

## Path parameters

- `blogId` string, required

## Request body

- CreatePostRequest
  - `title` string, required
  - `slug` string, nullable: Auto-generated from title if not provided
  - `content` string, required
  - `status` 'draft' | 'published'
  - `collection_id` string: Optional collection ID. When omitted, the blog's empty-slug default Posts collection is used. If that default does not exist, collection_id is required.
  - `author_id` string: Optional author user ID. Assigning another blog member requires owner or admin access.
  - `image` string, nullable
  - `published_at` string, date-time, nullable: Auto-set to now if status is published and not provided
  - `tags` string[]
  - `metadata` object: Custom metadata (max 20 fields, description max 200 chars)
    - `description` string

## Response `200`

Created post

- Post
  - `id` string, required
  - `title` string, required
  - `url` string, uri, required
  - `slug` string, required
  - `content` string, required: HTML content
  - `excerpt` string, required: Auto-generated excerpt from content or metadata.description
  - `image` string, uri, nullable
  - `status` 'draft' | 'published' | 'scheduled', required: scheduled is derived from published status with future published_at
  - `published_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `author` Author, required
    - `id` string, required
    - `name` string, required
    - `bio` string, required
    - `image` string, uri, nullable
    - `metadata` object, required: Public custom author metadata (max 20 fields)
    - `url` string, uri, required: Public author page URL
  - `collection` CollectionRef
    - `id` string, required
    - `name` string, required
    - `slug` string, required
    - `url` string, uri, required
  - `tags` TagRef[], required
    - `id` string, required
    - `name` string, required
  - `metadata` object, required: Custom metadata fields (max 20 fields)

## Other responses

- `400`: Invalid request data
- `401`: Authentication required
- `403`: Insufficient permissions
- `409`: Slug already exists in collection

---

[API](https://skmtc.dev/justblogged/apis/justblogged-api.md) · [All operations](https://skmtc.dev/justblogged/apis/justblogged-api/llms.txt) · [OpenAPI document](https://skmtc.dev/justblogged/apis/justblogged-api/revisions/7769318744ae?raw)
