Send a Delegate Invitation
Invite another X account to act as the account identified by cookie. Give the invitee as username or user_id; role is Admin (default) or Contributor. On success the response is the invitee’s membership with status Pending, and the invitee accepts it with the accept endpoint using its own cookie. A missing invitee, an unknown user, inviting the account itself, or an invitation X rejects (for example BadRequest: DELEGATE_ERR_002) returns HTTP 400 with the reason. Requires a TwexAPI Bearer key and the inviting account’s authorized X cookie or auth_token.
/twitter/delegate/inviteAuthorizationBearer token · headerrequiredapplication/jsoncookiestringrequiredproxystring | anyShow propertiesHide properties
stringanyusernamestring | anyShow propertiesHide properties
stringanyuser_idstring | anyShow propertiesHide properties
stringanyrolestring | anyShow propertiesHide properties
stringanycodeintegerrequiredmsgstringrequireddataDelegateMemberrequiredShow propertiesHide properties
user_idstringrequiredscreen_namestringrequirednamestringrequiredavatarstring | anyrequiredShow propertiesHide properties
stringanymembership_idstring | anyrequiredShow propertiesHide properties
stringanyrolestring | anyrequiredShow propertiesHide properties
stringanystatusstring | anyrequiredShow propertiesHide properties
stringanycodeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
anyanyanycodeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
anyanyanycodeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
anyanyanycodeintegerrequiredmsgstringrequireddataany[] | anyrequiredShow propertiesHide properties
anyanyany⚡Interactive Console / Try APIPOSTLive Console
https://api.twexapi.io1. 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.
Configure parameters in the Request tab and click Send Request below.
curl -X POST "https://api.twexapi.io/twitter/delegate/invite" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cookie": "YOUR_X_COOKIE_OR_AUTH_TOKEN",
"username": "example_member",
"role": "Admin"
}'const response = await fetch("https://api.twexapi.io/twitter/delegate/invite", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"cookie": "YOUR_X_COOKIE_OR_AUTH_TOKEN",
"username": "example_member",
"role": "Admin"
})
});import requests
response = requests.post(
"https://api.twexapi.io/twitter/delegate/invite",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"cookie": "YOUR_X_COOKIE_OR_AUTH_TOKEN",
"username": "example_member",
"role": "Admin"
},
){
"code": 200,
"msg": "success",
"data": {
"user_id": "1234567890123456790",
"screen_name": "example_member",
"name": "Example Member",
"avatar": "https://pbs.twimg.com/profile_images/example_normal.jpg",
"membership_id": "1234567890123456791",
"role": "Admin",
"status": "Pending"
}
}{
"code": 400,
"msg": "BadRequest: DELEGATE_ERR_002",
"data": null
}{
"code": 403,
"msg": "Authentication or credit access denied",
"data": []
}{
"code": 422,
"msg": "Invalid request",
"data": []
}{
"code": 500,
"msg": "Upstream or server error",
"data": null
}