X Articles API: draft, publish and a generated cover image

The X Articles API has POST /2/articles/draft and a publish call, with optional cover media. Make the cover with a Sume image call, then upload it to X.

4 min readSume
All posts

The X API has two Articles endpoints: POST /2/articles/draft creates a draft with a title, a DraftJS content_state and optional cover media, and POST /2/articles/{article_id}/publish makes it public. For the cover, generate an image with a Sume image call, upload it through X's media endpoints, and attach it to the draft; Sume does not call X.

X facts are from the Articles introduction, read 2026-10-01. Sume facts are from Image API and Image 1.0.

What do the two X endpoints do?

Both need a user access token, via OAuth 1.0a or OAuth 2.0 PKCE, with the tweet.read, tweet.write and users.read scopes.

X Articles endpoints, from the X Articles introduction, read 2026-10-01.
EndpointPurposeReturns
POST /2/articles/draftCreate a draft: title, content_state, optional cover mediaDraft id and title
POST /2/articles/{article_id}/publishPublish a draftpost_id of the published Article

How do I make a cover image on Sume?

Send a prompt to the image route and pick an aspect_ratio; the options are a per-model catalog, so read your model's list. One call can return up to four candidates, and each output has a durable media.sume.com URL such as https://media.sume.com/img/01J.../0.png.

How does the cover get to X?

X says cover media is uploaded through its media upload endpoints, then used in the draft. The introduction page does not state a cover size or ratio, so check X's current Articles guidance for that. Download the chosen file from its Sume URL, keep it within X's general image limit of 5 MB, which X does not say applies to covers specifically (see the 5 MB image post), and upload it.

What is the order of operations?

Generate and choose the cover, upload it to X, create the draft with the title, body and cover, review, then publish. Publishing returns a Post ID, so the Article appears as a Post.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume