Article documents
X Articles (Pro plan and up) are edited as a Tiptap / ProseMirror JSON document, the same format the Xholic editor uses.
{ "type": "doc", "content": [ { "type": "heading", "attrs": { "level": 2 }, "content": [{ "type": "text", "text": "Why we rebuilt onboarding" }] }, { "type": "paragraph", "content": [ { "type": "text", "text": "We cut setup from " }, { "type": "text", "marks": [{ "type": "bold" }], "text": "nine steps to three" }, { "type": "text", "text": "." } ] }, { "type": "bulletList", "content": [ { "type": "listItem", "content": [{ "type": "paragraph", "content": [{ "type": "text", "text": "One question per screen" }] }] } ] } ]}- Every node has a
type, and may haveattrs,marks(each with atype) andcontent. - The root is always
{ "type": "doc" }. A document is at most about 1.5 MB of JSON, with up to 2,000 children per node. - The safest way to edit is to read the article (
articles.get), change the returneddocument, and send it back whole. Images in the body are uploaded article assets; keep the image nodes the editor produced.
Versions
Section titled “Versions”Every article has a version. update_article, schedule_article and publish_article take the version you last read and return the new one. If someone changed the article in the meantime, the call fails with CONFLICT instead of overwriting their edit: read it again and reapply your change.
Typical flow
Section titled “Typical flow”create_articlewith a title. It returns the new article with itsidandversion.update_articlewithid,version, andtitle,subtitleordocument.schedule_articlewith a time and timezone, orpublish_articleto post it on X now (both need thepublishscope).
Writing the article itself is your AI’s job. Xholic’s own article AI (articles.ai_run, for outlines, drafts and covers) uses Xholic AI credits and quotes them first.
