Add/Delete rules
POST
/2/tweets/search/stream/rulesAdd or delete rules from a user's active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values.
Request
Query Params
dry_run
string
optional
Dry Run can be used with both the add and delete action, with the expected result given, but without actually taking any action in the system (meaning the end state will always be as it was when the request was submitted). This is particularly useful to validate rule changes.
Body Params application/json
AddOrDeleteRulesRequest
One of
A request to add a user-specified stream filtering rule.
add
array[object (RuleNoId) {2}]
required
Example
{
"add": [
{
"tag": "Non-retweeted coffee tweets",
"value": "coffee -is:retweet"
}
]
}
Request samples
Responses
The request was successful(200)
500(500)
The request was successful
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
AddOrDeleteRulesResponse
One of
A response from adding user-specified stream filtering rules.
data
array[object (Rule) {3}]
required
All user-specified stream filtering rules that were created.
meta
object
RulesResponseMetadata
Example
{
"data": [
{
"id": "120897978112909812",
"tag": "Non-retweeted coffee tweets",
"value": "coffee -is:retweet"
}
],
"meta": {
"sent": "string",
"summary": {
"created": 1,
"invalid": 1,
"not_created": 1,
"valid": 1
}
}
}
Last modified: 2 years ago