Update Article Title API
Set the title of an article you own, identified by its entity id. Works on a draft. If X refuses an edit to a published article, the API answers 422 article_published and does not bill the call; this is detected for articles among your first 100 published ones. Requires a registered session. Billed at $0.0016 per call. Cost: $0.0016 per call.
POST article/update_title sets the title on an X article you own, specified by its base64 entity id. It accepts the article id and a new title string, updates the article, and returns ok (boolean) plus the full updated article object. It works on a draft; a published article that X refuses to edit answers 422 article_published and is not billed. Requires a registered session and costs $0.0016 per call.
Authorization
bearerAuth Pass your API key as a bearer token on every request: Authorization: Bearer <API_KEY>.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/article/update_title" \ -H "Content-Type: application/json" \ -d '{ "id": "QXJ0aWNsZUVudGl0eToyMDg2NjUwMjI4OTUwNjgzNjQ4", "title": "Why we rebuilt our onboarding from scratch" }'{ "ok": true, "article": { "id": "QXJ0aWNsZUVudGl0eToyMDg2NjUwMjI4OTUwNjgzNjQ4", "rest_id": "2086650228950683648", "title": "Why we rebuilt our onboarding from scratch", "preview_text": "", "lifecycle": "Draft", "content_state": { "blocks": [], "entityMap": [] }, "cover_media": null, "media_entities": [], "author": { "id": "44196397", "username": "elonmusk", "name": "Elon Musk" }, "created_at_secs": 1786400000, "modified_at_secs": 1786400120, "first_published_at_secs": null, "visibility_setting": null, "tweet_id": null, "public_url": null }}{ "error": "bad_request", "message": "Missing or malformed parameter. Fix the request before retrying."}{ "error": "unauthorized", "message": "The API key is missing, malformed, or revoked. Check the Authorization header."}{ "error": "insufficient_credits", "message": "Your balance is exhausted. Top up your credits to continue.", "top_up_url": "https://www.twitterapis.com/dashboard/buy-credits?utm_source=api&utm_medium=402"}{ "error": "forbidden", "message": "X refused this resource for the acting account: on a read, the account is not a participant in the DM thread, the target is protected or has blocked it, or the session was attestation-blocked for calling from a datacenter or rotating IP; on a write, the account is not authorized for the action or has no logged-in session. The credentials are still valid, so do not re-register."}{ "error": "not_found", "message": "The resource does not exist, for example a deleted tweet or a private account."}{ "ok": false, "article": null, "error": "article_published", "detail": "This article is published, and X refused the edit. Edits through this API are verified on drafts only; X's own way of editing a published article in place has not been captured. The path that avoids editing a published article: (1) POST /twitter/article/unpublish, which returns it to Draft; its announcement tweet stays up. (2) Apply article/update_title, article/update_content or article/update_cover_media. (3) POST /twitter/article/publish, which returns the announcement tweet_id. This round trip has not been verified end to end, so unpublish only an article you can afford to leave unpublished if republishing fails. If the new tweet_id differs from the old one, remove the old announcement with POST /twitter/tweet/delete if you do not want both. X said: code=214 BadRequest: Bad request. (214)", "reason": "article_published"}{ "error": "rate_limited", "message": "Too many requests. Back off and retry with exponential backoff."}{ "error": "server_error", "message": "Something failed on our side. Retry with backoff; if it persists, contact support."}Pricing
| Unit | Price |
|---|---|
| Per call | $0.0016 |
| Per 1,000 calls | $1.60 |
When to use
Use this endpoint when you need to rename a draft article you already created, without touching its body content. A published article is not edited here: unpublish it first, as the notes describe. Reach for article/update_content instead if you need to change the article body, or article/create if the article does not exist yet.
Notes
- Needs a session for the account you are writing as: either register one once (POST /customer/session), or pass per-call inline credentials as x-auth-token and x-ct0 request headers, which let a single API key act as many accounts. Returns 409 session_required if neither is supplied, 401 session_dead when the session has expired.
- A published article is not edited here. Edits are verified on drafts only: if X refuses an edit and the article is among your first 100 published ones, the call answers 422 with error article_published and is not billed. The path that avoids a published-article edit is article/unpublish (the article returns to Draft and its announcement tweet stays up), this call, then article/publish. That round trip has not been verified end to end, so only unpublish an article you can afford to leave unpublished if republishing fails.
Related endpoints
- Create Article: Start a new draft article. No request body required.
- Update Article Content: Replace an article's body with a new Draft.js content_state.
- Publish Article: Publish a draft article. This posts a real, public announcement tweet.
FAQ
Can I update the title of a published article, or only a draft?
Only a draft is verified. If X refuses the edit and the article is among your first 100 published ones, the call answers 422 with error article_published and is not billed. To change a published article, unpublish it (it returns to Draft and the announcement tweet stays up), edit it, then publish it again. That round trip has not been verified end to end, so only unpublish an article you can afford to leave unpublished if republishing fails.
Where do I get the id value to pass in?
The id parameter is the article's base64 entity id, the same identifier returned in the article object from article/create or article/list. It is not the article's URL slug or a numeric id.
What does a successful call return?
A response with ok set to true and an article object containing the updated article, including the new title. If ok is false, the title was not changed.
Create Article POST
Start a new draft Article as the account behind your registered session, and return its entity id, ready for Update Title / Update Content. The draft is empty until you call those. Requires a registered session. Billed at $0.0016 per call. Cost: $0.0016 per call.
Update Article Cover Image POST
Set the cover image on an article you own, identified by its entity id. This attaches media you have already uploaded; it does not upload anything itself, so call media/upload first and pass the media_id it returns. Works on a draft. If X refuses an edit to a published article, the API answers 422 article_published and does not bill the call; this is detected for articles among your first 100 published ones. Requires a registered session. Billed at $0.0016 per call. Cost: $0.0016 per call.