Skip to content

POST /v1/posts

Create a post on the site that owns the API key. With status: "published" it is published in the same call.

  • URL: https://api.canverly.com/v1/posts
  • Method: POST
  • Auth: Bearer API key — scope posts:write
  • Content-Type: application/json
  • Max body: 4 MiB
  • Rate limit: 60 req/min per key

For worked, multi-language examples see the publishing guide.

Header Required Value
Authorization yes Bearer ck_…
Content-Type yes application/json
Idempotency-Key no Opaque id (≤ 255 chars). A replay with the same key + body returns the original 201 (no duplicate). See Idempotency.
Field Type Required Notes
title string yes Post title. Must be non-empty.
blocks_json object yes Block document: { "v": 1, "blocks": [...] }. See Content blocks.
status string no "draft" (default), "published" or "scheduled" (needs a future published_at; otherwise 422 INVALID_SCHEDULE and nothing is created). A published or scheduled article goes through the SEO score gate.
published_at string no RFC 3339 with offset. With published: the publication date (past or future). With scheduled: the schedule date. Ignored for drafts.
slug string no Auto-derived from title if omitted.
excerpt string no Stored as the SEO description.
language string no BCP-47; default "pt-BR".
post_type string no "post" (default), "page", or a custom slug from /v1/post-types.
category_slugs string[] no Category slugs (drive category archives).
tag_slugs string[] no Tag slugs.
editorial object no Editorial fields of the article (executive_summary, key_points, key_facts, faq, sources). They count toward the SEO score. See Editorial fields.
focus_keyword object no Focus keyword: { "primary": "…", "secondary": ["…"] } (primary 1 to 200 characters; up to 5 secondary, no repeats). It is saved before publishing, so the gate measures with it. Outside the rules: 422 INVALID_FOCUS_KEYWORD, before anything is created. With no focus the score loses 10 points and the keyword checks are off.
featured_image_id string no Cover: the id returned by POST /v1/media, from the same site. Anything else is a 400.
{
"title": "Hello from the API",
"status": "published",
"slug": "hello-from-the-api",
"excerpt": "A short summary.",
"language": "en",
"category_slugs": ["news"],
"tag_slugs": ["api"],
"blocks_json": {
"v": 1,
"blocks": [
{ "id": "p1", "type": "paragraph", "text": "Body text." }
]
}
}
{
"id": "01K8Z9K3F7T8M2QYV5N6B4WJ8R",
"slug": "hello-from-the-api",
"status": "published",
"public_url": null
}
Field Type Notes
id string Post ULID (Crockford base32).
slug string Final slug (may be normalized from your input).
status string "published", "scheduled" or "draft".
public_url string | null May be null; build the URL as https://<primary_domain>/<slug> (see /v1/sites/me).
warnings string[] Only present when there is a warning. SEO_FOCUS_NOT_SAVED: the post was created but the focus_keyword was not saved (SEO service unavailable). Resend the focus with PATCH. If you asked to publish, the gate measured without the focus.

Envelope: { "error": { "code", "message" } }. Full table in Errors & rate limits.

Status error.code When
400 bad_request / UNKNOWN_CATEGORY Malformed JSON, empty title, published_at not RFC 3339, invalid featured_image_id, or category_slugs naming a category the site does not have (UNKNOWN_CATEGORY lists the unknown and the valid ones; nothing is created).
401 unauthorized Missing/invalid/revoked key.
403 forbidden Key lacks posts:write.
413 — Body over 4 MiB.
415 — Missing/incorrect Content-Type.
422 SEO_SCORE_BELOW_MINIMUM published/scheduled article with an SEO score below the minimum. Carries error.score, error.minimum_to_publish, error.missing, error.suggestions and error.post_id (the draft was already created: fix it, do not recreate). See SEO score and publishing.
422 INVALID_FOCUS_KEYWORD focus_keyword outside the rules (primary empty or over 200 characters, more than 5 secondary, repeats). Nothing is created.
422 INVALID_SCHEDULE status: "scheduled" without a future published_at.
422 INVALID_EDITORIAL Editorial field over its limit (the error names the field).
422 IMAGEM_EXTERNA_INVALIDA A new external image failed ingest; error.invalid_images has field, URL and reason.
422 unprocessable Missing blocks_json, wrong field type, or a key created before publishing was enabled.
503 SEO_SCORE_UNVERIFIABLE The score could not be verified right now; nothing was published. Retry after Retry-After.
429 rate_limited Over 60 req/min — honor Retry-After.
5xx upstream Transient; retry with backoff (reuse the same slug).

editorial is optional and so is every field in it. They count toward the SEO score and the site draws them in the article. Over a limit: 422 INVALID_EDITORIAL naming the field.

Field Type Limits
executive_summary string up to 2000 characters; one paragraph that answers the page’s question.
key_points string[] up to 12 items of up to 400 characters.
key_facts object[] up to 20; each { "claim" (required, up to 600), "source" (up to 300) }.
faq object[] up to 20; each { "question" (required, up to 300), "answer" (required, up to 2000) }.
sources object[] up to 30; each { "title" (required, up to 300), "url" (required, absolute http(s), up to 2000) }.

Send an Idempotency-Key header to make retries safe. The first request runs normally; its 201 response is cached for 24 hours. Any replay with the same key and the same body returns that original response with an extra Idempotency-Replayed: true header — the post is created at most once.

Janela do terminal
curl -X POST https://api.canverly.com/v1/posts \
-H "Authorization: Bearer ck_live_xxx" \
-H "Idempotency-Key: source-item-42" \
-H "Content-Type: application/json" \
-d '{ "title": "…", "blocks_json": { "v": 1, "blocks": [] } }'
  • The key is scoped per api key + request body, so it can’t collide across sites or with a different payload.
  • A request that errors caches nothing — retrying re-runs it.
  • Sending the same key with a different body is treated as a new request (different post).
  • SEO score and publishing — measure before publishing, and publish a draft.
  • PATCH /v1/posts/{id} — edit or re-date an existing post.
  • GET /v1/posts — read the published archive, with filters, keyset pagination and since for incremental sync.
  • POST /v1/import — create many posts in one NDJSON request instead of a loop.
  • Post SEO — title, description, canonical URL, no_index and schema_type are set on their own route, not in the create body.

There is no public DELETE for posts: deleting content is an admin action.