filters
Create and manage filters.
    
      get
    
    View all filters
  
  Returns: Filter
OAuth: User token + read:filters
Version history:
2.4.3 - added
Request
Headers
string
  Response
200: Success
Excerpts of various filters in different contexts.
[
  {
    "id": "6191",
    "phrase": ":eurovision2019:",
    "context": [
      "home"
    ],
    "whole_word": true,
    "expires_at": "2019-05-21T13:47:31.333Z",
    "irreversible": false
  },
  ...
  {
    "id": "5580",
    "phrase": "@twitter.com",
    "context": [
      "home",
      "notifications",
      "public",
      "thread"
    ],
    "whole_word": false,
    "expires_at": null,
    "irreversible": true
  },
  ...
]
401: Unauthorized
Invalid or missing Authorization header
{
  "error": "The access token is invalid"
}
    
      get
    
    View a single filter
  
  Returns: Filter
OAuth: User token + read:filters
Version history:
2.4.3 - added
Request
Path Parameters
string
  Headers
string
  Response
200: Success
Filter returned successfully
{
  "id": "8449",
  "phrase": "test",
  "context": [
    "home",
    "notifications",
    "public",
    "thread"
  ],
  "whole_word": false,
  "expires_at": "2019-11-26T09:08:06.254Z",
  "irreversible": true
}
401: Unauthorized
Invalid or missing Authorization header
{
  "error": "The access token is invalid"
}
404: Not Found
Filter ID does not exist, or is not owned by you
{
  "error": "Record not found"
}
    
      post
    
    Create a filter
  
  Returns: Filter
OAuth: User token + write:filters
Version history:
2.4.3 - added
Request
Headers
string
  Form Data Parameters
string
  array
  home, notifications, public, thread. At least one context must be specified.
  boolean
  boolean
  integer
  Response
200: Success
The newly-created filter will be returned.
{
  "id": "8449",
  "phrase": "test",
  "context": [
    "home",
    "notifications",
    "public",
    "thread"
  ],
  "whole_word": false,
  "expires_at": "2019-11-26T09:08:06.254Z",
  "irreversible": true
}
401: Unauthorized
Invalid or missing Authorization header
{
  "error": "The access token is invalid"
}
422: Unprocessable Entity
If phrase or context are not provided properly
phrase
{
  "error": "Validation failed: Phrase can't be blank"
}
context
{
  "error": "Validation failed: Context can't be blank, Context None or invalid context supplied"
}
    
      put
    
    Update a filter
  
  Returns: Filter
OAuth: User token + write:filters
Version history:
2.4.3 - added
Request
Path Parameters
string
  Headers
string
  Form Data Parameters
string
  array
  home, notifications, public, thread. At least one context must be specified.
  boolean
  boolean
  integer
  Response
200: Success
Filter updated successfully
{
  "id": "8449",
  "phrase": "test",
  "context": [
    "home",
    "notifications",
    "public",
    "thread"
  ],
  "whole_word": false,
  "expires_at": null,
  "irreversible": true
}
401: Unauthorized
Invalid or missing Authorization header
{
  "error": "The access token is invalid"
}
404: Not Found
The filter does not exist or is not owned by you
{
  "error": "Record not found"
}
422: Unprocessable Entity
If phrase or context are not provided properly
phrase
{
  "error": "Validation failed: Phrase can't be blank"
}
context
{
  "error": "Validation failed: Context can't be blank, Context None or invalid context supplied"
}
    
      delete
    
    Remove a filter
  
  Returns: Filter
OAuth: User token + write:filters
Version history:
2.4.3 - added
Request
Path Parameters
string
  Headers
string
  Response
200: Success
The filter has been deleted successfully, so an empty object will be returned.
{}
401: Unauthorized
Invalid or missing Authorization header
{
  "error": "The access token is invalid"
}
404: Not Found
The filter does not exist or is not owned by you
{
  "error": "Record not found"
}
Last updated December 27, 2020 · Improve this page