Update draft
update_draftSaves edits to the article of a content calendar topic (its newest draft), the same as saving it in Content Studio. Send only the fields to change: title, slug, seoTitle, seoDescription, contentMarkdown or structuredDataEdit; the others keep their values. contentMarkdown replaces the whole text: read the article with get_draft just before you send it, because the last save wins, and a save made in Content Studio between the two calls is lost. When the text starts with a # heading, that heading is the title: the first heading follows the title on each save (the new title, else the current one), and text without a leading heading stays as it is. Keep each [[youtube:ID]] token and each image URL that stays in the article; an image whose URL is no longer in the text is removed from the article. A slug that another article of the site uses is refused (article_slug_taken). The summary and the hero image cannot be edited here. A text edit of a published article does not change the live page: it keeps the old text until the article is published again. structuredDataEdit replaces the owner’s whole Structured Data Edit, the changes to Keytomic’s structured data (JSON-LD); read it with get_draft just before you send it, because the last save wins. When get_draft gives liveUpdate on_save for the destination, the save also sends the structured data alone to the live WordPress post: the text, the URL and the dates of the post do not change. That send needs the content:publish scope and the user’s publish permission; without them the edit saves, and structuredDataSave.liveError says why the live post did not change. Name destinationId as in get_draft. Returns the updated article, the same as get_draft, and structuredDataSave (liveUpdate, sent, liveError) when the call saved structured data. Spends no credits.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectId": "<projectId>",
"topicId": "<topicId>"
},
"name": "update_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | No | URL slug of the article, such as how-to-bake-sourdough. A slug that another article of the site uses is refused. | |
| title | No | The article title. | |
| topicId | Yes | Topic whose article to edit, from list_calendar_topics. | |
| seoTitle | No | Title for search results. null clears it. | |
| projectId | Yes | Site to act on, from list_sites. | |
| destinationId | No | Publishing destination whose live post a structured data save can update, from the destinations section of get_project. Leave it out to use the site’s only active destination. | |
| seoDescription | No | Description for search results. null clears it. | |
| contentMarkdown | No | The full article text as Markdown. It replaces the whole text. When the text starts with a `# ` heading, the first heading follows the title; keep each `[[youtube:ID]]` token and each image URL that stays in the article. | |
| structuredDataEdit | No | The owner’s whole Structured Data Edit. It replaces the saved edit: nodes holds the JSON-LD nodes that replace or add to Keytomic’s, at most one for each schema type, and removedTypes holds the schema types to remove from Keytomic’s. Send { "nodes": [], "removedTypes": [] } to clear the edit. |