Skip to content
Twexapi
English
Esc
↑↓navigate↵open⌘Jpreview

Change Username

Change the @username (screen name) of the account identified by cookie. TwexAPI first asks X whether the new handle is available: a handle that is already taken returns 409, and one X will not accept (too short, reserved, not allowed) returns 400 with X’s reason, without changing anything. On success it returns the username X saved. To change the display name, use POST /twitter/profile instead. Requires a TwexAPI Bearer key and the account’s authorized X cookie or auth_token.

Back to API Reference
/Twitter Profile Actions Endpoints
POST/twitter/profile/username
Authorization
AuthorizationBearer token · headerrequired
Global API Bearer Token for TwexAPI. Included as: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Request Body
requiredapplication/json
cookiestringrequired
The user's own authorized Twitter session credentials or auth_token (BYOC — Bring Your Own Cookie). Stateless proxy execution with zero credential retention. See [Authentication Security](/authentication#write-operations--byoc-bring-your-own-cookie) and [How to get Cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).
usernamestringrequired
New screen name: up to 15 letters, digits or underscores. A leading @ is ignored.
matches ^\s*@?[A-Za-z0-9_]{1,15}\s*$
proxystring | any
The proxy to use.Please use high-quality residential proxies and avoid free proxies.Required.Example: http://username:password@ip:port . You can get proxy from: https://app.proxy-cheap.com/r/qiMxub
Show properties
Any of:
string
string
any
any
Responses
200Username changed
codeintegerrequired
msgstringrequired
dataobjectrequired
Show properties
usernamestringrequired
The username X saved.
400Invalid username, or X will not accept it
codeintegerrequired
msgstringrequired
dataany[] | anyrequired
Show properties
Any of:
any[]
Array of any
any
any
any
401X could not authenticate the account
codeintegerrequired
msgstringrequired
dataany[] | anyrequired
Show properties
Any of:
any[]
Array of any
any
any
any
403The account is suspended or locked, or authentication or quota was denied
codeintegerrequired
msgstringrequired
dataany[] | anyrequired
Show properties
Any of:
any[]
Array of any
any
any
any
409The username is already taken
codeintegerrequired
msgstringrequired
dataany[] | anyrequired
Show properties
Any of:
any[]
Array of any
any
any
any
429Rate limit exceeded
codeintegerrequired
msgstringrequired
dataany[] | anyrequired
Show properties
Any of:
any[]
Array of any
any
any
any
500X did not confirm the change, or a server error occurred
codeintegerrequired
msgstringrequired
dataany[] | anyrequired
Show properties
Any of:
any[]
Array of any
any
any
any
⚡Interactive ConsolePOST
⚡Interactive Console / Try APIPOST
Live Console
🌐Target Server:https://api.twexapi.io
● Production Ready
✍️
Write Operation Credentials Guide (TwexAPI Key + Twitter Cookie)

1. TwexAPI Platform Key (Bearer Token): Enter under "API Authorization" below for request billing & authentication.

2. Twitter Account Cookie: For write operations (tweet, like, follow, etc.), provide the target Twitter account's Cookie (e.g. auth_token=...; ct0=...) in the cookie field of Request Body below.

🔑API Authorization
📝Request Bodyapplication/json
📡
No Response Yet

Configure parameters in the Request tab and click Send Request below.

Request
curl -X POST "https://api.twexapi.io/twitter/profile/username" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "cookie": "YOUR_X_COOKIE_OR_AUTH_TOKEN",
  "username": "new_handle"
}'
Response
{
  "code": 200,
  "msg": "success",
  "data": {
    "username": "new_handle"
  }
}