ユーザー名の変更
cookie で指定したアカウントの @ユーザー名(screen name)を変更します。TwexAPI はまず X に新しいユーザー名が使えるかを確認します。すでに使われている場合は 409、X が受け付けない場合(短すぎる・予約語・使用不可など)は X の理由とともに 400 を返し、どちらの場合も何も変更しません。成功すると X が保存したユーザー名を返します。表示名の変更には POST /twitter/profile を使ってください。TwexAPI の Bearer キーと、そのアカウントの有効な X Cookie または auth_token が必要です。
APIリファレンスに戻る
/Twitter Profile Actions Endpoints
POST
/twitter/profile/usernameAPI 認証
AuthorizationBearer token · header必須TwexAPIのグローバル認証トークン (Bearer Token)。ヘッダーに含める必要があります:Authorization: Bearer <YOUR_TWEXAPI_KEY>。
リクエストボディ
必須application/jsoncookiestring必須ユーザー自身が承認した Twitter セッション資格情報または auth_token(BYOC — Bring Your Own Cookie)。機密情報は保存されず、完全なステートレスプロキシとして実行されます。詳細は [認証・セキュリティガイド](/ja/authentication#write-operations--byoc-bring-your-own-cookie) および [Cookie 取得手順](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie) を参照。
usernamestring必須新しいユーザー名:英数字とアンダースコアで最大 15 文字。先頭の @ は無視されます。
matches ^\s*@?[A-Za-z0-9_]{1,15}\s*$
proxystring | anyThe 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
プロパティを表示プロパティを非表示
Any of:
string
stringany
anyレスポンス
200Username changed
codeinteger必須msgstring必須dataobject必須プロパティを表示プロパティを非表示
usernamestring必須The username X saved.
400Invalid username, or X will not accept it
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any401X could not authenticate the account
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any403The account is suspended or locked, or authentication or quota was denied
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any409The username is already taken
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any429Rate limit exceeded
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any500X did not confirm the change, or a server error occurred
codeinteger必須msgstring必須dataany[] | any必須プロパティを表示プロパティを非表示
Any of:
any[]
Array of
anyanyany
any⚡インタラクティブテストPOST
⚡インタラクティブテスト / Try APIPOSTLive Console
🌐対象サーバー:
https://api.twexapi.io● 本番環境レディ
✍️
書き込み操作の認証情報ガイド(TwexAPIキー + Twitter Cookie)
1. TwexAPIプラットフォームキー (Bearer Token): 下記の「API認証」に入力してください(API呼び出しと課金認証に使用)。
2. TwitterアカウントCookie: ツイート・いいね・フォロー等の書き込み操作のため、下記リクエストボディの cookie フィールドに対象TwitterアカウントのCookie(例: auth_token=...; ct0=...)を入力してください。
🔑API 認証
📝リクエストボディapplication/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
リクエスト例
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"
}'const response = await fetch("https://api.twexapi.io/twitter/profile/username", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"cookie": "YOUR_X_COOKIE_OR_AUTH_TOKEN",
"username": "new_handle"
})
});import requests
response = requests.post(
"https://api.twexapi.io/twitter/profile/username",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"cookie": "YOUR_X_COOKIE_OR_AUTH_TOKEN",
"username": "new_handle"
},
)レスポンス例
{
"code": 200,
"msg": "success",
"data": {
"username": "new_handle"
}
}{
"code": 400,
"msg": "Your username must be longer than 4 characters.",
"data": null
}{
"code": 401,
"msg": "X could not authenticate the account. (32)",
"data": null
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 409,
"msg": "That username has been taken. Please choose another.",
"data": null
}{
"code": 0,
"msg": "string",
"data": [
null
]
}{
"code": 0,
"msg": "string",
"data": [
null
]
}