Content

Edit Content Draft

Changed on

Apply exact find-and-replace edits to a content draft's article body. Deterministic, no AI model involved: your replacement text lands verbatim (use the revise endpoint when you want an AI rewrite from an instruction). Each edit's find text must match the current body exactly once; zero or multiple matches fail the whole call with 400 and nothing is saved, so extend the find text until it is unique. Edits apply in order, later ones see earlier results, and the batch is recorded as one new version, recoverable via the versions endpoints. Pass expected_version_number from the draft endpoint to fail with 409 when a new version was recorded after your read (a revision, edit, or restore). An app autosave changes the body without recording a version; that drift is caught by the anchors themselves, since a moved or vanished find text fails the call.

post/api/v1/content/{content_id}/edit

Request

  • Base URL
    https://api.athenahq.ai
  • Auth
    API key in header x-api-key

Path parameters

content_idstring required

Request body

website_idstring required
expected_version_numberinteger

Response

Success

content_idstring required
bodystring required
version_numberinteger required
version_idstring required
body_word_countinteger required
previous_body_word_countinteger required

Changes