Skip to content

Guide: bulk rewriting with Chimpee

This guide is for teams connecting a writing platform with AI and human reviewers, such as Chimpee, to Canverly in order to rewrite and restructure the articles of a site. It replaces the old autoposting example: that example published straight away, with the whole HTML in a single paragraph, which is exactly what you must not do to an article that already ranks.

  1. Step −1: read the site’s niche and briefing before writing a single line.
  2. Pick what to rewrite (SEO backlog) and read the source of the post, keeping the original.
  3. Rewrite in Chimpee, preserving the URL, non-text blocks and the search focus.
  4. Measure the SEO score through the API up to the minimum (currently 85).
  5. Human review in Chimpee (and, if you want, in the Canverly admin).
  6. Write: draft for a new article; PATCH only after approval for a published one.
  7. Verify, log the batch and wait for measurement before the next one.

The public API is per site: each ck_… key sees a single site, and site_id never comes from the body. To rewrite 30 sites you need 30 keys, each kept in the tool’s vault and never in logs, front ends or repositories. See Keys, scopes and restrictions.

Who issues it: the Canverly operator, not the integration. No API key can create another one. The operator uses canverly-ops (the key text is generated on the operator’s machine and only the hash goes to the server, so it is shown once):

Janela do terminal
./install.sh mint-api-keys --apply --site=<site-slug> --nome=chimpee-<site-slug> --perfil redacao

The redacao profile grants these scopes, and only these:

Scope What it is for in this flow
posts:read List what exists and avoid duplicates.
posts:write Read the source (/source), create drafts, edit, publish.
post_types:read Confirm the post type.
sites:read Niche (GET /v1/sites/me) and briefing (GET /v1/sites/me/briefing).
media:write Upload new images.
seo:read Measure the score and read the backlog.
plan:read, plan:write Content plan (opt-in per site; see the note below).
  • Need the site categories (GET /v1/sites/me/settings)? Ask for site:read separately with --escopos=.
  • Want to track visits per post between batches? Add analytics:read (read only).
  • Do not ask for seo:write or site:write without the site owner’s decision: site:write also writes the briefing.
  • One name per purpose (chimpee-<site>) lets you revoke the tool’s key without dropping the others.
  • If the key carries an IP or time-window restriction, it applies to every request.

2. Step −1: niche and briefing before writing

Section titled “2. Step −1: niche and briefing before writing”

Before planning or rewriting any article of the site, read who the site is. Never infer the niche from the brand name. Rewriting “in the right tone” for the wrong site has already produced hundreds of off-niche articles in an earlier batch.

Janela do terminal
# Niche (vertical + label). editorial: null = the site has no niche set
curl -s https://api.canverly.com/v1/sites/me -H "Authorization: Bearer $CANVERLY_API_KEY"
# Briefing: audience, tone, goal, writing module, pillars, banned topics, rules,
# glossary, trusted sources, competitors, CTA, key pages, region
curl -s https://api.canverly.com/v1/sites/me/briefing -H "Authorization: Bearer $CANVERLY_API_KEY"

Stop and ask the operator (do not write) when:

  • editorial is null (site without a niche);
  • the briefing comes back with version: 0 and empty texts (not filled in yet);
  • the briefing’s skill_module is a sensitive topic (finance, health, legal, betting, pets) and you have no human reviewer who knows that module.

The briefing is the source of tone, audience, banned topics and trusted sources. Its skill_module field says which module of the writing kit applies to the site. See Editorial briefing.

3. The writing kit: what the tool must meet

Section titled “3. The writing kit: what the tool must meet”

Canverly writes with a single kit (the redator skill): a common core and one module per site type. The writing tool receives the current text of the kit from the Canverly team together with the batch, versioned by SHA, and applies it in full; any change to the kit is sent again. A summary of the floors that are not negotiable:

  • Niche and module confirmed (Step −1); when in doubt, the strictest one applies.
  • Nothing invented: a figure, dose, study, price or testimonial without a source becomes [VERIFICAR], and the article does not ship with an open [VERIFICAR].
  • Every fact checked against trustworthy sources, with external links to them (never to a home page).
  • No promise of results; risks next to every benefit; the module’s disclaimer when the topic needs it (finance, health, legal, betting).
  • Punctuation and style: at most one : per subheading, no choppy sentences, no decorative em dash.
  • Minimum depth of the kit (a 1,600-word body floor on full-brief articles) and an expert-position paragraph per section.
  • Absolute dates; when rewriting, update the data and the review date, without changing the original publication date.

4. Choosing what to rewrite, and reading the source

Section titled “4. Choosing what to rewrite, and reading the source”

Start with what has little to lose. The backlog lists posts with their stored score, how many points are missing and the easy gain:

Janela do terminal
curl -s "https://api.canverly.com/v1/seo/backlog?order=easiest&below=85&limit=20" \
-H "Authorization: Bearer $CANVERLY_API_KEY"

Do not start with the site’s traffic champions. Cross-check with Search Console (which the operator reads; there is no public route for it) or with GET /v1/analytics/posts, and leave out whatever already ranks well unless the owner asks for it.

Always read through the source, never through HTML. GET /v1/posts/{reference} returns rendered content_html, where ads, product cards and stories come out empty: turning that HTML back into a PATCH deletes content (it already happened with product cards). The right route returns the blocks exactly as stored:

Janela do terminal
curl -s "https://api.canverly.com/v1/posts/how-to-do-x/source" \
-H "Authorization: Bearer $CANVERLY_API_KEY" > original.json

Keep original.json (and the updated_at it carries) before any write. It is your rollback and your comparison point.

  • Keep the URL. The API does not change a post’s slug: PATCH does not accept slug (an unknown field is a 400). Rewriting changes the text, not the address.
  • Preserve every non-text block (product_card, ad, embed, image, story…) in the same place as in the original. The tool only rewrites paragraph, heading, list and quote, and returns the rest untouched.
  • Keep the search focus of a post that already ranks. The API does not return the saved focus (the backlog only says whether there is one: has_focus); ask the operator. Changing the focus of a ranking post changes the page Google already knows.
  • Search intent: restructuring is fine, changing the subject is not. If the new text answers another question, it is a new article.
  • Cannibalization: two articles fighting for the same keyword are merged with a redirect, not by rewriting both. See “Changing or merging URLs” below.
  • Dates: do not send published_at in a rewrite PATCH. Resending the date counts as an edit and pings IndexNow again.

The same body you are about to write can be measured without saving anything:

Janela do terminal
curl -s -X POST https://api.canverly.com/v1/posts/seo/analyze \
-H "Authorization: Bearer $CANVERLY_API_KEY" -H "Content-Type: application/json" \
-d '{
"title": "How to request payroll-loan portability",
"excerpt": "A short step by step.",
"focus_keyword": { "primary": "payroll loan portability", "secondary": ["interest rate"] },
"blocks_json": { "v": 1, "blocks": [ { "id": "p1", "type": "paragraph", "text": "…" } ] }
}'
  • Read score, minimum_to_publish (currently 85), missing and suggestions[]. Read the minimum from the response; do not hardcode it.
  • Without focus_keyword the article is measured with no focus (minus 10 points): always send it.
  • Compare scores only between measurements with the same engine_version.
  • The editorial fields (executive summary, key points, facts, FAQ and sources) count toward the score.
Situation What to do Goes live?
New article (new topic or replacement text) POST /v1/posts with status: "draft" and Idempotency-Key. After human approval, POST /v1/posts/{ref}/publish. Only on publish.
Existing draft PATCH /v1/posts/{ref} with the new text; measure; after approval, publish. Only on publish.
Already-published article The new text stays in the tool until human approval. Once approved, PATCH /v1/posts/{ref} with the approved body. Immediately, with no score gate.

For a published article there is no “draft mode” of the same post: PATCH changes the live version. That is why the review draft lives in Chimpee, not in Canverly. (A second post with another slug would serve as a draft, but it would become a duplicate URL, and the API does not delete posts. Do not do it.)

  1. Re-read the source right before the PATCH and compare updated_at with the one from step 4. The API does not use If-Match: the last write wins. If it changed, someone edited in the admin; stop and reassess.
  2. Confirm the approved body carries every non-text block of the original (product_card, image, table, callout, ad and the rest: see Content blocks and, for the product card, Product card).
  3. Send only what is needed: title, excerpt, blocks_json, editorial, focus_keyword, category_slugs/tag_slugs if the structure changed. No published_at.
  4. Right after, GET /v1/posts/{ref}/seo/score: confirm the score and engine_version.
  5. If something is wrong, put the original back (original.json) with another PATCH. Avoid repeating PATCH on the same post: each one triggers IndexNow and a cache purge.
Janela do terminal
curl -s -X PATCH "https://api.canverly.com/v1/posts/how-to-do-x" \
-H "Authorization: Bearer $CANVERLY_API_KEY" -H "Content-Type: application/json" \
-d @approved.json # title, excerpt, blocks_json, editorial, focus_keyword; no slug, no published_at

If the response carries warnings: ["SEO_FOCUS_NOT_SAVED"], the text was saved but the focus was not: resend only focus_keyword in a new PATCH.

  • Creation: send a stable Idempotency-Key per topic (for example chimpee:<site>:<topic-id>). A replay with the same key and the same body returns the original 201; a different body with the same key creates another post. On retry, resend the identical body, and before creating check GET /v1/posts?q=<title> so you do not duplicate an existing article.
  • Editing: PATCH is partial and repeatable (resending the same body leaves the same state), but every call on a published post triggers external effects. Keep the updated_at from the last result and do not resend without need.
  • Limits: 60 writes per minute and 600 reads per minute, per key. On 429, wait for Retry-After. On 503 (SEO_SCORE_UNVERIFIABLE, SEO_SCORE_UNAVAILABLE) nothing was published: wait for Retry-After and repeat the same call. 5xx errors: exponential backoff, at most three tries.
  • Small batches. Start with 10 articles per site, human review every 10, and measure position, clicks and impressions for 2 to 4 weeks before the next batch. The request limit is not the bottleneck; the risk is losing ranking at scale.
  • Do not rewrite a post someone is editing in the admin. Agree on a window with the site team.
  • There are no post webhooks. The only webhook event today is lead.created. To sync, use GET /v1/posts?since=<RFC 3339> (published) and GET /v1/posts?status=draft,scheduled (drafts and scheduled, posts:write only).

The public API does not create 301 redirects and does not rename slugs. If the restructuring needs a new URL, or merging two articles:

  1. Create the target article (POST /v1/posts, the desired slug, as a draft; publish after approval).
  2. Ask the site operator to register the 301 from the old URL to the new one, in the Redirects screen of the site admin (the redirect route is session-based, with no API key).
  3. Only then take the source offline with POST /v1/posts/{ref}/unpublish (the post becomes archived and the page is purged). There is no deletion through the API.

Without step 2 the old URL starts answering 404 and its ranking is lost.

import os, time, requests
API = "https://api.canverly.com"
KEY = os.environ["CANVERLY_API_KEY"] # one key per site, from the vault
H = {"Authorization": f"Bearer {KEY}"}
def call(method, path, **kw):
"""Retries on 429/503 honouring Retry-After (at most 3 retries)."""
headers = {**H, **kw.pop("headers", {})}
for attempt in range(4):
r = requests.request(method, API + path, headers=headers, timeout=30, **kw)
if r.status_code in (429, 503) and attempt < 3:
time.sleep(int(r.headers.get("Retry-After", 30)))
continue
return r
return r
def rewrite(ref, rewrite_with_human):
site = call("GET", "/v1/sites/me").json()
briefing = call("GET", "/v1/sites/me/briefing").json()
if site.get("editorial") is None or briefing["version"] == 0:
raise SystemExit("Step -1 incomplete: ask the operator for niche and briefing")
src = call("GET", f"/v1/posts/{ref}/source")
src.raise_for_status()
original = src.json() # keep it: it is the rollback
new = rewrite_with_human(original, site, briefing) # Chimpee + review; returns the approved body
score = call("POST", "/v1/posts/seo/analyze", json=new).json()
if score["score"] < score["minimum_to_publish"]:
return {"status": "rejected", "missing": score["missing"], "suggestions": score["suggestions"]}
now = call("GET", f"/v1/posts/{ref}/source").json()
if now["updated_at"] != original["updated_at"]:
return {"status": "conflict", "reason": "the post changed since it was read"}
r = call("PATCH", f"/v1/posts/{ref}", json=new) # published post: goes live now
r.raise_for_status()
return {"status": "written", "original": original, "warnings": r.json().get("warnings", [])}

Before the first batch

  • ☐ One key per site, redacao profile, kept in the vault; no seo:write, no site:write.
  • ☐ Step −1 automated: with no niche or no briefing, the tool stops.
  • ☐ Current text of the writing kit embedded in the brief, with the version’s SHA.
  • ☐ Human reviewer defined per module (mandatory for finance, health, legal, betting and pets).
  • ☐ Original kept before any write; rollback plan tested on a draft.
  • ☐ Tested in a staging environment agreed with the team, not straight in production.
  • ☐ No key in logs, in front ends or in the repository.

For each article

  • ☐ Read through the source (/source), never through content_html.
  • ☐ Slug, published_at and non-text blocks preserved; search focus kept.
  • ☐ analyze with focus_keyword: score ≥ minimum_to_publish (85) and no open [VERIFICAR].
  • ☐ Human review approved before any PATCH on a published post.
  • ☐ updated_at re-read before writing; PATCH without published_at.
  • ☐ Score checked afterwards (GET …/seo/score) and the page answering 200.
  • ☐ Batch log: post, score before and after, reviewer, time, original kept.

Between batches

  • ☐ 2 to 4 weeks measuring position, clicks and impressions; next batch only if there was no drop.
  • ☐ 301 requested from the operator for every URL that changed or was merged.
Response Cause What to do
401 Missing, wrong or revoked key Check the header; ask the operator for another.
403 Missing scope (posts:write, seo:read…) The message names the scope; ask for the key again.
400 Invalid JSON, empty PATCH body, slug sent, a category the site does not have (UNKNOWN_CATEGORY) Fix the field the error names.
404 The post does not exist on this site Check the id; do not enumerate.
409 NOT_PUBLISHABLE publish on a post that is already live or archived Do not repeat.
422 SEO_SCORE_BELOW_MINIMUM Score below the minimum when publishing Apply error.suggestions, measure, publish the draft in error.post_id.
422 INVALID_FOCUS_KEYWORD Focus outside the rules One primary and up to 5 secondary, 1 to 200 characters, no repeats.
429 Rate limit Wait for Retry-After.
503 Score cannot be verified right now Wait for Retry-After and repeat the same call.

Full list in Errors and rate limits. The view for AI agents is in the Agent guide.