Update Article Content
Replace the body of an article you own with a new content_state, identified by its entity id. content_state is Draft.js editor-state JSON ({ blocks: [...], entityMap: [...] }) that you build client-side; in the shape the X Article editor produces. Blocks are forwarded with only key, text, type, data, entityRanges and inlineStyleRanges; X's schema rejects any other block field (depth included). Block types: unstyled, header-two, unordered-list-item, ordered-list-item, blockquote and atomic (a one-space block that carries an entity through entityRanges). entityMap is an ARRAY of { key, value: { type, mutability, data } }; entity data is snake_case on input and comes back camelCase: TWEET (an embedded post) { tweet_id }, MEDIA (an inline image) { caption, entity_key, media_items: [{ local_media_id, media_category: "DraftTweetImage", media_id }] } with media_id from media/upload, DIVIDER {}, LINK { url } over a text range, MARKDOWN { markdown } for tables. A field X does not know is refused with 422, reason validation_failed and the offending path in detail. Measured live 2026-09-18. Requires a registered session. Billed at $0.0016 per call. Cost: $0.0016 per call.
Request
- Base URL: https://api.twitterapis.com/twitter
- URL: https://api.twitterapis.com/twitter/article/update_content
- Auth: HTTP bearer
Request body
Example request
{
"id": "QXJ0aWNsZUVudGl0eToyMDg2NjUwMjI4OTUwNjgzNjQ4",
"content_state": "{\"blocks\":[{\"key\":\"a1b2c\",\"text\":\"Opening paragraph.\",\"type\":\"unstyled\",\"inlineStyleRanges\":[],\"entityRanges\":[]},{\"key\":\"em1\",\"text\":\" \",\"type\":\"atomic\",\"inlineStyleRanges\":[],\"entityRanges\":[{\"key\":0,\"offset\":0,\"length\":1}]},{\"key\":\"im1\",\"text\":\" \",\"type\":\"atomic\",\"inlineStyleRanges\":[],\"entityRanges\":[{\"key\":1,\"offset\":0,\"length\":1}]}],\"entityMap\":[{\"key\":\"0\",\"value\":{\"type\":\"TWEET\",\"mutability\":\"Immutable\",\"data\":{\"tweet_id\":\"2077572855194157402\"}}},{\"key\":\"1\",\"value\":{\"type\":\"MEDIA\",\"mutability\":\"Immutable\",\"data\":{\"caption\":\"\",\"entity_key\":\"img-1\",\"media_items\":[{\"local_media_id\":\"1\",\"media_category\":\"DraftTweetImage\",\"media_id\":\"2101008406014312448\"}]}}}]}"
}Response
Replace an article's body with a new Draft.js content_state.
Changes
No recorded changes to this operation across all 1 revision of this API.