Subnano Docs API Access Settings

Publish and Unpublish

Publish draft

POST /api/v1/posts/:id/publish

Required headers:

  • Authorization: Bearer snpk_<keyId>_<secret>
  • Idempotency-Key: <unique-id>

No body is required. The server publishes the existing draft if required fields are valid.

If the post is already published, the endpoint is a no-op and still returns 200 with the current published post resource.

Validation requirements before publish:

  • non-empty title
  • non-empty description
  • non-empty content
  • positive priceRaw
  • valid primaryCategoryId
  • secondaryCategoryId (if set) must differ from primary

Success response (200):

{
  "id": "uuid",
  "slug": "post-slug",
  "status": "published",
  "publishResult": "published",
  "stateChanged": true,
  "url": "https://subnano.me/@authorHandle/post-slug",
  "publishedAt": "2026-03-05T12:00:00.000Z"
}

Notes:

  • Repeat calls for an already-published post return 200 with "publishResult": "no_op_already_published" and "stateChanged": false.
  • Reusing the same Idempotency-Key for a completed publish replay returns the stored response.
  • Replay responses include x-idempotency-replay: true.

Unpublish post

POST /api/v1/posts/:id/unpublish

Moves a published post back to draft state.

Public behavior after unpublish:

  • https://subnano.me/@handle/<slug> returns 404.