发送委托邀请
邀请另一个 X 账号代 cookie 所属账号操作。用 username 或 user_id 指定被邀请人;role 为 Admin(默认)或 Contributor。成功时返回被邀请人的成员记录,status 为 Pending,被邀请人用自己的 cookie 调用接受邀请接口即可接受。未指定被邀请人、用户不存在、邀请自己,或 X 拒绝邀请(例如 BadRequest: DELEGATE_ERR_002)时返回 HTTP 400 和原因。必须同时提供 TwexAPI Bearer API Key 和发出邀请账号的有效 X Cookie 或 auth_token。
返回 API 接口列表
/Delegate Endpoints
POST
/twitter/delegate/inviteAPI 鉴权
AuthorizationBearer token · header必填TwexAPI 平台的全局身份凭据 (Bearer Token)。所有接口调用均需在 Header 中携带:Authorization: Bearer <YOUR_TWEXAPI_KEY>。可在 TwexAPI 用户控制台获取。
请求体
必填application/jsoncookiestring必填Authorized X session cookie or auth_token for the account sending the invitation. Required in addition to the TwexAPI Bearer key.
min length 1
proxystring | any展开属性折叠属性
Any of:
string
stringany
anyusernamestring | any展开属性折叠属性
Any of:
string
stringany
anyuser_idstring | any展开属性折叠属性
Any of:
string
stringany
anyrolestring | anyRole to grant. Defaults to Admin.
default: "Admin"
展开属性折叠属性
Any of:
string
stringany
any响应结果
200Success
codeinteger必填msgstring必填dataDelegateMember必填展开属性折叠属性
user_idstring必填screen_namestring必填namestring必填avatarstring | any必填Profile image URL.
展开属性折叠属性
Any of:
string
stringany
anymembership_idstring | any必填ID of this membership in the delegation group.
展开属性折叠属性
Any of:
string
stringany
anyrolestring | any必填Admin or Contributor.
展开属性折叠属性
Any of:
string
stringany
anystatusstring | any必填Accepted, or Pending while the invitation is not yet accepted.
展开属性折叠属性
Any of:
string
stringany
any400BadRequest: DELEGATE_ERR_002
codeinteger必填msgstring必填dataany[] | any必填展开属性折叠属性
Any of:
any[]
Array of
anyanyany
any403Authentication or credit access denied
codeinteger必填msgstring必填dataany[] | any必填展开属性折叠属性
Any of:
any[]
Array of
anyanyany
any422Invalid request
codeinteger必填msgstring必填dataany[] | any必填展开属性折叠属性
Any of:
any[]
Array of
anyanyany
any500Upstream or server error
codeinteger必填msgstring必填dataany[] | any必填展开属性折叠属性
Any of:
any[]
Array of
anyanyany
any⚡交互式测试POST
⚡交互式测试 / Try APIPOSTLive Console
🌐目标服务器:
https://api.twexapi.io● 生产环境就绪
✍️
写入接口凭证指引(TwexAPI 密钥 + 目标推特 Cookie)
1. TwexAPI 平台密钥 (Bearer Token):在下方「API 鉴权」中填入,用于 TwexAPI 计费与接口调用鉴权。
2. 推特账号 Cookie:本接口为代发/点赞/关注等写操作,需在下方请求体 (Request Body) 的 cookie 字段中填入目标 Twitter 账号的 Cookie 凭据(如 auth_token=...; ct0=...)。
🔑API 鉴权
📝请求体application/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
请求示例
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
}