Delete Tweet API
Delete a tweet owned by the account behind your registered session. Identify it by id or url (read from the query string). Requires a registered session. Billed at $0.0008 per call, the same as a standard read. Cost: $0.0008 per call.
POST tweet/delete removes a tweet owned by the account behind your registered twitterapis.com session. Identify the tweet with either its numeric id or its status url. On success it returns ok: true, deleted: true, and tweet_id, the numeric ID of the removed tweet. The call requires an active registered session and is billed at $0.0008 per request.
Authorization
bearerAuth Pass your API key as a bearer token on every request: Authorization: Bearer <API_KEY>.
In: header
Query Parameters
Numeric ID of the tweet to delete. Provide either id or url.
Status URL of the tweet to delete, for example https://x.com/you/status/1759123456789012345. Provide either id or url.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/tweet/delete?id=1759123456789012345"{ "ok": true, "deleted": true, "tweet_id": "1759123456789012345"}{ "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."}{ "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."}{ "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.0008 |
| Per 1,000 calls | $0.80 |
When to use
Use this endpoint when your application needs to permanently remove a tweet posted by the account behind your registered session, for example after a user retracts a post, corrects a moderation issue, or cleans up automated content. Unlike the other Write Actions endpoints, it is destructive and irreversible, so reserve it for confirmed delete intents rather than draft or preview flows.
Notes
- id and url are read from the query string, not the JSON body.
- Needs a session for the account you are reading: 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.
- You can only delete tweets owned by the registered account.
Related endpoints
- Upload Media: Upload an image and get a media_id to attach to a tweet.
- Media Status: Check the async processing state of an uploaded media_id.
FAQ
Do I need to pass both id and url?
No. Both id and url are optional individually, but you must supply one of them to identify the tweet. id takes the numeric tweet ID; url takes the tweet's status URL. Passing neither leaves the endpoint unable to resolve which tweet to delete.
How do I confirm the delete actually succeeded on X, not just that my request was accepted?
Check the deleted field in the response, not just ok. ok: true confirms the API call itself succeeded, while deleted: true confirms X specifically returned confirmation the tweet was removed. The response also echoes tweet_id so you can match the result back to the ID you requested.
Create Tweet POST
Post a new tweet as the account behind your registered session. Supports plain text, up to 4 image media_ids (from a prior media/upload), a reply (reply_to), and a quote (quote). Requires a registered session. Billed at $0.0016 per call. Cost: $0.0016 per call.
Create Draft Tweet POST
Save a draft tweet on the account behind your registered session. A draft is private to that account and is never published: it appears in X's own composer under Drafts until you post or delete it. Accepts text, up to 4 media_ids, a reply_to and a quote, exactly like tweet/create. Billed at $0.0016 per call. Cost: $0.0016 per call.