メインコンテンツへスキップ
POST
/
2
/
tweets
/
search
/
stream
/
rules
ストリームルールを更新
curl --request POST \
  --url https://api.x.com/2/tweets/search/stream/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "add": [
    {
      "value": "coffee -is:retweet",
      "tag": "Non-retweeted coffee Posts"
    }
  ]
}
'
{
  "meta": {
    "sent": "<string>",
    "next_token": "<string>",
    "result_count": 123,
    "summary": {
      "created": 1,
      "invalid": 1,
      "not_created": 1,
      "valid": 1
    }
  },
  "data": [
    {
      "value": "coffee -is:retweet",
      "id": "120897978112909812",
      "tag": "Non-retweeted coffee Posts"
    }
  ],
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

クエリパラメータ

dry_run
boolean

Dry Run は追加および削除の両方のアクションで使用でき、想定される結果がレスポンスとして返されますが、システム上では実際には何も処理されません(つまり、リクエスト送信時点から最終的な状態は変化しません)。これはルール変更を検証する際に特に有用です。

delete_all
boolean

Delete All は、このクライアント App に紐づくすべてのルールを削除するために使用できます。他のパラメータは一切指定せずに使用する必要があります。一度削除されたルールは復元できません。

ボディ

application/json

ユーザー定義ストリームフィルタリングルールを追加するためのリクエスト。

add
object[]
必須

レスポンス

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

ユーザー定義ストリームフィルタリングルールを変更した際のレスポンス。

meta
object
必須
data
object[]

作成されたすべてのユーザー定義ストリームフィルタリングルール。

errors
object[]
Minimum array length: 1

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