Skip to main content
POST
/
2
/
tweets
ポストを作成または編集
curl --request POST \
  --url https://api.x.com/2/tweets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "card_uri": "<string>",
  "community_id": "1146654567674912769",
  "direct_message_deep_link": "<string>",
  "for_super_followers_only": false,
  "geo": {
    "place_id": "<string>"
  },
  "nullcast": false,
  "quote_tweet_id": "1346889436626259968",
  "reply_settings": "following",
  "share_with_followers": false,
  "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
}
'
{
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
card_uri
string

Card URI パラメータ。これは Quote Tweet の id、投票、メディア、ダイレクトメッセージのディープリンクとは相互排他的です。

community_id
string

このコミュニティの一意の識別子。

Pattern: ^[0-9]{1,19}$
Example:

"1146654567674912769"

パブリックタイムライン上の会話を非公開のダイレクトメッセージに移行するためのリンク。

edit_options
object

既存のポストを編集するためのオプションです。このパラメータが指定されている場合は、新規ポストを作成せず、指定されたポストが編集されます。

for_super_followers_only
boolean
default:false

スーパーフォロー限定のツイート。

geo
object

位置情報のためにツイートに関連付けられる Place ID。

media
object

作成されるツイートに関連付けられるメディア情報。これは Quote Tweet ID、Poll、Card URI と相互排他的であり、同時に指定することはできません。

nullcast
boolean
default:false

Nullcast(プロモーション専用)のポストは、公開タイムラインやフォロワーのタイムラインには表示されません。

poll
object

投票付きツイートの投票オプションです。Media、Quote Tweet ID、Card URI とは相互に排他的で、同時には指定できません。

quote_tweet_id
string

このツイートの一意の識別子。大きな整数を扱えない言語やツールでの問題を避けるため、文字列として返されます。

Pattern: ^[0-9]{1,19}$
Example:

"1346889436626259968"

reply
object

返信先となるツイートの情報。

reply_settings
enum<string>

ツイートに返信できるユーザーを指定する設定。

Available options:
following,
mentionedUsers,
subscribers,
verified
share_with_followers
boolean
default:false

コミュニティのポストをフォロワーとも共有します。

text
string

ツイートの内容。

Example:

"Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"

Response

リクエストは成功しました。

data
object
errors
object[]
Minimum array length: 1

IETF RFC 7807 (https://tools.ietf.org/html/rfc7807) で定義された HTTP Problem Details オブジェクト。