コンテンツにスキップ
Twexapi
日本語
Esc
移動開く⌘Jプレビュー

[Quick] One-step article publish

Publish a complete X Article in a single call. Suitable for simple, one-shot use cases.

⚠️ Recommended: use the step-by-step flow instead. The step-by-step flow gives you full control — preview the draft before publishing, retry individual steps on failure, and reuse the same article_id across multiple calls.

Step-by-step endpoints:

  1. POST /x/articles/draft → get article_id
  2. PUT /x/articles/{article_id}/cover (optional)
  3. PUT /x/articles/{article_id}/title
  4. PUT /x/articles/{article_id}/content
  5. POST /x/articles/{article_id}/publish → get tweet_id

Returns article_id and tweet_id on success.

POST/x/articles/publish
API 認証
AuthorizationBearer token · header必須
TwexAPIのグローバル認証トークン (Bearer Token)。ヘッダーに含める必要があります:Authorization: Bearer <YOUR_TWEXAPI_KEY>。
リクエストボディ
必須application/json
cookiestring必須
ユーザー自身が承認した 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) を参照。
titlestring必須
Article title
markdownstring必須
Article body in Markdown format
cover_imagestring | any
Cover image: https URL or local file path (optional)
プロパティを表示
Any of:
string
string
any
any
visibilitystring
Visibility: Public / Followers / Mentioned
default: "Public"
レスポンス
200成功時のレスポンス
codeinteger必須
HTTP ステータスコード(200 は成功)
msgstring必須
レスポンスメッセージ(例: 'success')
dataArticlePublishData | any
返却されるコアデータオブジェクトまたは配列
プロパティを表示
Any of:
ArticlePublishData
article_idstring必須
X記事の一意のID
tweet_idstring必須
ツイートの一意のID
any
any
422パラメータバリデーションエラー
detailValidationError[]
プロパティを表示
Array of ValidationError
locstring | integer[]必須
プロパティを表示
Array of string | integer
Any of:
string
string
integer
integer
msgstring必須
レスポンスメッセージ(例: 'success')
typestring必須
inputany
ctxobject
429Daily tweet limit reached
500Server error
インタラクティブテストPOST
インタラクティブテスト / Try APIPOST
Live 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/x/articles/publish" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "cookie": "string",
  "title": "string",
  "markdown": "string",
  "cover_image": "string",
  "visibility": "Public"
}'
レスポンス例
{
  "code": 0,
  "msg": "string",
  "data": {
    "article_id": "string",
    "tweet_id": "string"
  }
}