X API 403 Forbidden when creating a post: how to fix it
A 403 on create post means X understood the request and refused it. The usual causes are duplicate text, an app set to read-only, a token missing the write scope, a suspended or locked account, or empty pay-per-use credits.
Quick steps
- Read the response body. Log the full JSON error from the failed request and note the title and detail text. It often names the exact cause.
- Check for a duplicate. Open the account timeline. If the same text is already live, do not retry. If you want a new post, write genuinely different text.
- Confirm app permissions. In the developer portal, set the app to read and write and save. Confirm you are posting in user context, not with an app-only bearer token.
- Regenerate or re-authorize the token. Create a new access token and secret for OAuth 1.0a, or run the OAuth 2.0 authorization again, so the token reflects the new permissions.
- Verify scopes. Make sure the authorization request includes tweet.write, and add offline.access if you need refresh tokens. Check names against the X docs.
- Test the account manually. Log in to x.com as the posting account and publish by hand. Resolve any lock, verification prompt or suspension first.
- Check your credit balance. Open the developer console, confirm prepaid credits remain, and top up if the balance is zero.
- Retry once with new text. Send a single fresh post. If it still fails, compare the new error body with the causes above before trying again.
What a 403 means and where to look first
A 403 Forbidden from the X API means your request reached X, was understood, and was refused. That separates it from a 401, where the credentials are missing or invalid, and from a 429, which means you are rate limited (see our guide to X API 429 too many requests when posting). Something about the text, the app, the token, the account or the billing blocked the post.
The status code alone will not tell you which one. Log the full response body and read the title and detail fields, because X usually says something specific. Then work through the causes below in order of how quick they are to check: duplicate text, app permissions, token scopes, account status, and credits. Most 403s on create post are fixed by the first three.
Duplicate content
X rejects a post whose text is identical to a post the same account published recently, and the API answers with a 403. This catches people in two ways. A script posts a fixed template such as a daily status line. Or a request succeeds, your client times out before reading the answer, and the automatic retry is refused as a duplicate of a post that is already live.
Before you retry, look at the account timeline to see whether the post went out. Then store a hash or ID of every post you send, so your code never submits the same text twice. If you genuinely need to say the same thing again, rewrite it properly. Adding a random emoji or a trailing character to dodge the check is fragile and tends to look like spam. X does not publish the exact time window it checks, so do not rely on a guess.
App permissions: read-only versus read and write
In the X developer portal, your app's user authentication settings include an app permissions choice. A read-only app can fetch data but cannot create posts, so the create-post call returns a 403, often with wording about the app not being permitted to perform the action. Switch it to read and write in the portal and save.
The step people miss is that existing tokens do not inherit the change. Tokens issued while the app was read-only stay read-only. After changing permissions, regenerate the access token and secret if you use OAuth 1.0a, or send the user through authorization again if you use OAuth 2.0. Also check you are posting in user context. An app-only bearer token can read public data but cannot publish on behalf of an account.
Token scopes and revoked tokens
With OAuth 2.0 the scopes are fixed when the user authorizes your app. Creating a post needs the tweet.write scope, and the usual set also includes tweet.read and users.read. If you want refresh tokens, you also request offline.access. If your authorization URL left out tweet.write, no amount of retrying will work. Fix the scope list, send the user through the flow again, and confirm the current scope names in the X developer documentation.
Tokens can also stop working. Access tokens are short-lived and need refreshing, and a token dies if the user removes your app from their connected apps or changes their password. In general, a 401 or 403 that appears after something changed usually means the token was revoked or expired. The fix is to refresh it or have the account reconnect, then test one post.
Suspended or locked accounts
If the account you are posting for is suspended, locked, or restricted, create-post calls fail with a 403 even when your code and permissions are perfect. The quickest test is to log in to x.com as that account and try to publish a post by hand. A verification prompt, a password reset request, or a suspension notice tells you the problem is the account, not the API.
Complete whatever X asks for on a locked account, or file an appeal if it is suspended. There is no API-side workaround, and opening replacement accounts to get around a suspension risks making things worse. Check your developer account as well, since it can be restricted separately from the posting account. Spam-like patterns, such as many near-identical posts in a short time, are a common reason for locks, so slow down once access returns.
Credits depleted on pay-per-use
Since 6 Feb 2026 the X API v2 has been reported as pay-per-use with prepaid credits. Reported prices are about $0.015 for a plain post and about $0.20 for a post containing a URL, and the old free tier of 500 posts a month is reported as closed to new developers from that date. Confirm current rates and your balance in the developer console before relying on these figures.
Simple arithmetic from those numbers: $0.20 divided by $0.015 is roughly 13, so one link post costs about as much as thirteen plain ones. If your balance hits zero, creating posts can fail, and the exact error may not say "credits", so read the response body. Top up in the console, then retry. If you followed an older tutorial promising free posting, your new app may simply have no free allowance.
Where AutoPostMode fits, and where it does not
AutoPostMode is an AI content autopilot for X and LinkedIn, not a scheduler for posts you write yourself. It researches fresh articles from the last 24 hours in up to 5 niches, writes a post in your tone, scores it, and publishes at your times. You connect through the official X sign-in, so you do not handle API keys, app permissions or scopes. Its duplicate guard checks your own history and other accounts in your niche. If X revokes access, you reconnect through the same sign-in.
Credits are counted only when X confirms the post is live: a normal post uses 1 credit, a post with a link uses 12, and failed, skipped or rejected posts are free. Basic includes 300 monthly credits, Pro 525 and Agency 940. If you want to write every post yourself, native scheduling suits you better: see how to schedule posts on X, or scheduled post not posting on X if a queued post went missing.
Questions
Why do I get a 403 when posting the same text twice?
X refuses a post whose text matches a recent post from the same account and returns a 403. This often happens when a retry follows a request that actually succeeded. Check the timeline first, then change the wording properly. X does not publish the exact window it uses for this check.
I changed my app to read and write but still get 403. Why?
Tokens issued before the change keep their old read-only permission. Regenerate the access token and secret for OAuth 1.0a, or have the user authorize again for OAuth 2.0. Also confirm the request uses user context rather than an app-only bearer token.
Is 403 the same as a rate limit?
No. A rate limit returns HTTP 429, and the fix is to slow down and wait. A 403 means the request was refused for another reason, such as duplicate text, permissions, scopes, account status or billing. Our 429 guide covers the rate limit case.
Will AutoPostMode fix API 403 errors in my own script?
No. It does not repair your code or tokens. It is an autopilot that writes and publishes posts to X and LinkedIn accounts you connect through official sign-in, so there are no keys to manage. It is not built for posts you write yourself.
Do failed posts use up AutoPostMode credits?
No. Credits are used only when X confirms a post is live. Failed, skipped or rejected posts are free. A normal post uses 1 credit and a post containing a link uses 12.
Facts and prices checked 30 November 2026. Platform rules and vendor plans change, so confirm on the platform or vendor site before you rely on a limit or price.
Disclosure: AutoPostMode is our product. More guides: Fixing X API 429 Too Many Requests When Posting, Scheduled Post Not Posting on X? Diagnose It Step by Step, LinkedIn scheduled post not posting or missing: the checklist, Threads Scheduled Post Not Posting? A Step-by-Step Checklist, Scheduler Says Your X Account Is Disconnected: How to Reconnect. All troubleshooting.