API & integrations

Staging article changes over the API

Staged changes let you edit an article that is already live and save your work without readers seeing it. The published version stays exactly as it is until you publish the staged copy — so you can fix a paragraph, have it reviewed, and release it when you are ready.

Everything the dashboard can do to a staged copy is available here, so an integration can prepare documentation changes and hold them until a release.

Staged changes are included in Catalyst. On other plans these endpoints return 402 with reason: STAGING_UNAVAILABLE.

Before you start

  • All requests go to https://api.helpcenter.io and carry your token in an apikey header.
  • Staging only applies to published articles. An article that has never been published has nothing to hide edits from, so save it normally instead — these endpoints return 409 with reason: NOT_PUBLISHED.
  • Translatable fields are per-language. Every staged write names one locale, and an article can carry staged changes in several languages at once.

Read an article

A single-article read, which the v1 API did not previously offer. The response includes has_staged_changes, staged_locales and staged_updated_at, so you can tell at a glance whether an article has unpublished work waiting on it.

GET/v1/articles/{articleId}

Read one article, including whether it currently has staged changes and in which languages.

Read the staged copy

Returns the staged version for one language, or every staged language when you omit locale. Useful as a probe: it answers 404 when nothing is staged.

GET/v1/articles/{articleId}/staged

Read the staged copy of an article — the text readers cannot see yet.

Stage a change

Creates the staged copy on first write and updates it afterwards. Send only the fields you are changing — anything you omit keeps its live value.

Pass etag whenever you have one. It is returned by every staged read and write, and it is what stops two integrations overwriting each other: if the staged copy moved since you read it, the write is refused with 409 rather than silently winning.

PATCH/v1/articles/{articleId}/staged

Create or update the staged copy for one language. Readers keep seeing the live version.

Staging is deliberately inert. A staged save writes nothing to search, sends no watcher notifications, and creates no URL redirect — all of that happens when you publish. That is what keeps unpublished wording out of your help center and out of search results.

Publish the staged copy

Applies the staged text to the live article. Omit locale to publish every staged language at once, which is usually what you want for a translated article.

If somebody edited the live article after you staged your changes, this refuses with 409 rather than overwriting their work. Re-read, merge, and try again — or send force: true if you are certain your version should win.

POST/v1/articles/{articleId}/staged/publish

Publish staged changes to the live article. Readers see the new text immediately.

Discard the staged copy

Throws the staged work away. The live article is untouched.

DELETE/v1/articles/{articleId}/staged

Discard staged changes without publishing them.

Version history

Every publish keeps the text it replaced, so you can see what an article used to say and put it back. Versions are per language.

GET/v1/articles/{articleId}/versions

List the previous published versions of an article, newest first.

POST/v1/articles/{articleId}/versions/{versionId}/restore

Put a previous version back on the live article. The text it replaces is itself kept, so a restore is undoable.

A worked example

Fix a paragraph on a live article, check it, then publish it:

API=https://api.helpcenter.io/v1
KEY=your-read-write-token

# 1. Stage the change. Readers still see the old text.
curl -X PATCH "$API/articles/4821/staged" \
  -H "apikey: $KEY" -H 'Content-Type: application/json' \
  -d '{"locale":"en","content":"<p>Boards now support stage gates.</p>"}'

# 2. Read it back to review, and keep the etag.
curl -s "$API/articles/4821/staged?locale=en" -H "apikey: $KEY"

# 3. Publish when you are ready.
curl -X POST "$API/articles/4821/staged/publish" \
  -H "apikey: $KEY" -H 'Content-Type: application/json' \
  -d '{"locale":"en"}'

Errors

These endpoints use the same codes as the rest of the API:

  • 401 — the apikey header is missing or unknown.
  • 402 — staged changes are not included in this site's plan.
  • 403 — a read-scoped token attempted a write.
  • 404 — the article belongs to another site, or nothing is staged.
  • 409 — the article is not published, or your etag is stale, or the live article moved.
  • 422 — validation failed.

To group several staged articles and publish them together, see Publishing a release with change sets.

Was this article helpful?