---
title: "Create Or Update Post"
method: POST
path: "/api/v1/public-blog/posts"
tags: ["Public Blog"]
---

# Create Or Update Post

`POST /api/v1/public-blog/posts`

## Request

- Base URL: `https://api.seoproai.co`
- URL: `https://api.seoproai.co/api/v1/public-blog/posts`
- Auth: none required

Create or update a public blog post (upsert by slug).

If a post with the given slug exists, it will be updated.
Otherwise, a new post will be created.

Requires API key with `blogs:publish` scope.

## Headers

- `authorization` string, nullable

## Request body

- PublicBlogPostCreate: Request model for creating/updating a public blog post
  - `title` string, required: Post title
  - `slug` string, nullable: URL slug (auto-generated from title if not provided)
  - `content` string, required: Full HTML content of the post
  - `excerpt` string, nullable: Short excerpt for previews
  - `featured_image_url` string, nullable: URL of the featured image
  - `featured_image_alt` string, nullable: Alt text for featured image
  - `meta_title` string, nullable: SEO meta title
  - `meta_description` string, nullable: SEO meta description
  - `canonical_url` string, nullable: Canonical URL if different from default
  - `focus_keyword` string, nullable: Primary SEO keyword
  - `category_slug` string, nullable: Category slug to assign
  - `tags` string[], nullable: List of tags
  - `status` string: Post status: draft, published, or archived
  - `author_name` string: Author name to display
  - `published_at` string, date-time, nullable: Publication date (auto-set on first publish)

## Response `201`

Successful Response

- PublicBlogPostResponse: Response model after creating/updating a blog post
  - `id` string, required
  - `title` string, required
  - `slug` string, required
  - `status` string, required
  - `published_at` string, nullable, required
  - `created_at` string, required
  - `updated_at` string, required
  - `url` string, required: Full URL to the published post

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/seoproai/apis/seopro-ai.md) · [All operations](https://skmtc.dev/seoproai/apis/seopro-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/seoproai/apis/seopro-ai/revisions/5b4b6391ddc9?raw)
