Create Article
Create (and optionally publish) long-form Twitter/X articles in one call. $0.01 per call. Premium-only when publishing. GetXAPI article endpoint.
/twitter/article/createThis endpoint costs $0.01 per API call. Premium-only when publish: true — the auth_token account must have an active X Premium subscription.
Single endpoint that creates the draft, sets title + content + cover, and (optionally) publishes — all in one call.
For 100% success rate, pass your own proxy via the proxy field. Using a custom proxy posts the article from your own clean IP and gives the most reliable results.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
auth_token | string | Yes | User's auth token (Premium account when publishing) |
title | string | Yes | Article title |
content | string | Yes | Article body in Markdown. Supports H1, H2, paragraphs, bold/italic/strikethrough, ordered + unordered lists, blockquotes |
publish | bool | No | If true, publishes immediately after creation. Default false (saved as draft) |
cover_media_id | string | No | Pre-uploaded media id (from /media/upload) |
cover_image_url | string | No | URL of an image to fetch and upload as the cover |
cover_image_base64 | string | No | Base64-encoded image data for the cover |
proxy | string | No | Your proxy URL (e.g. http://user:pass@host:port) |
Provide at most one of cover_media_id / cover_image_url / cover_image_base64.
Notes
- When
publish: false(default), the response returns adraft_urlyou can hand back to the user for in-app editing. - When
publish: true, the article goes live as a wrapper tweet —tweet_idandpublic_urlare returned. - Markdown limitations (X's article schema, not our limits):
- Only H1 and H2 render distinctly.
###(H3) and deeper coerce to H2. - Code blocks (fenced
```) degrade to plain paragraphs — X doesn't support them. - Inline code (
x) renders as plain text. - Inline links degrade to
<text> (<href>)plain text. - Inline images inside the markdown body are not yet supported — use the
cover_*fields for the header image.
- Only H1 and H2 render distinctly.
Response (200) — Draft
{
"status": "success",
"data": {
"article_id": "2055606612363202560",
"status": "draft",
"tweet_id": null,
"draft_url": "https://x.com/compose/articles/edit/2055606612363202560",
"public_url": null,
"cover_media_id": "2055606606466023424"
}
}Response (200) — Published
{
"status": "success",
"data": {
"article_id": "2055606612363202560",
"status": "published",
"tweet_id": "2055606621209002254",
"draft_url": "https://x.com/compose/articles/edit/2055606612363202560",
"public_url": "https://x.com/i/status/2055606621209002254",
"cover_media_id": "2055606606466023424"
}
}Error Responses
400 - Missing fields
{ "error": "Missing required field: title" }403 - Not Premium (when publish: true)
{ "error": "Publishing articles requires an active X Premium subscription on this account" }502 - Mutation rejected by X
{ "error": "Twitter did not return an article_id from DraftCreate" }Examples
curl -X POST "https://api.getxapi.com/twitter/article/create" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"title": "Three Books Worth Re-reading This Year",
"content": "Some books reveal more on the second pass...\n\n## The Beginning of Infinity — David Deutsch\n\nDeutsch makes the case that **knowledge is the engine of change**...",
"cover_image_url": "https://picsum.photos/1200/675",
"publish": true
}'const response = await fetch("https://api.getxapi.com/twitter/article/create", {
method: "POST",
headers: {
Authorization: "Bearer API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
auth_token: "your_auth_token",
title: "Three Books Worth Re-reading This Year",
content: "Some books reveal more on the second pass...",
cover_image_url: "https://picsum.photos/1200/675",
publish: true,
}),
});
const data = await response.json();
console.log(data);import requests
response = requests.post(
"https://api.getxapi.com/twitter/article/create",
headers={"Authorization": "Bearer API_KEY"},
json={
"auth_token": "your_auth_token",
"title": "Three Books Worth Re-reading This Year",
"content": "Some books reveal more on the second pass...",
"cover_image_url": "https://picsum.photos/1200/675",
"publish": True,
},
)
print(response.json())Save as draft (no Premium required)
curl -X POST "https://api.getxapi.com/twitter/article/create" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"title": "Draft for later",
"content": "Work in progress..."
}'ArticleUpdated
Fetch full Twitter/X article and note content by tweet ID via API. $0.001 per call. GetXAPI article endpoint with rich text and media.
Update ArticleNew
Partial-update an existing Twitter/X article — title, body markdown, or cover image. $0.005 per call. Works on drafts and published articles.