---
title: "POST /api/admin/blog_posts/{id}/publish"
method: POST
path: "/api/admin/blog_posts/{id}/publish"
tags: ["Admin: Blog Posts"]
---

# POST /api/admin/blog_posts/{id}/publish

`POST /api/admin/blog_posts/{id}/publish`

## Request

- The document declares no server URL.
- Auth: API key in cookie `session`

Publish a draft or archived post. A state is not an update: each change of
      Publication State is its own operation with its own Permission. An illegal
      move, or repeating the current state, is a 409 with a localized `detail`.

## Path parameters

- `id` integer, required

## Response `200`

The request has succeeded.

- BlogPost: A blog post (legacy: `BlogPost`).
  - `id` integer, required
  - `creator` PublicUser, required: The part of a user that is safe to show anonymous visitors: the display name only, never the email or the admin flag. Embedded in public review and blog responses in place of `User`.
    - `id` integer, required
    - `firstName` string, nullable, required
    - `lastName` string, nullable, required
    - `name` string, nullable, required
  - `name` string, nullable, required
  - `slug` string, nullable, required
  - `description` string, nullable, required
  - `state` 'draft' | 'published' | 'archived', required: Blog post publication state.
  - `locale` string, nullable, required
  - `richBodyHtml` string, required
  - `readingTime` integer, required
  - `likesCount` integer, required
  - `relatedCourseIds` integer[], required: Promoted-course ids in display order, so the admin related-courses editor can round-trip the set it writes.
  - `coverUrl` string, nullable, required: The cover image, served by the asset store; null for a post without one.
  - `createdAt` string, date-time, required

## Other responses

- `default`: Default error response shared by every operation. `@error` emits an OpenAPI `default` response, keeping central transport failures typed without enumerating every status on every operation.

## Changes

- **2026-10-18** `9380d4c85a04`: 3 info
  - removed the non-success response with the status `401`
  - removed the non-success response with the status `403`
  - added the optional property `errors` to the response with the `default` status
- **2026-10-17** `023e7c2cd140`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/hexlet-basics/apis/hexlet-basics-api/changes/api/admin/blog_posts/:id/publish/post.md)

---

[API](https://skmtc.dev/hexlet-basics/apis/hexlet-basics-api.md) · [All operations](https://skmtc.dev/hexlet-basics/apis/hexlet-basics-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hexlet-basics/apis/hexlet-basics-api/revisions/51c7f596b47c?raw)
