Skip to content

KeywordFilterRequest

A keyword filter as the user writes it. A field that is not one is a 422 naming it; the same word twice (once normalized) is kept once.

object
title
required

1 to 50 characters (grapheme clusters) on one line, without control characters. White space around it is removed.

string
>= 1 characters <= 400 characters
action
required

What a keyword filter does to a post that matches it: warn returns the post with the filter in its filtered, and clients fold it behind the filter’s title; hide leaves the post out, as if the user could not see it.

string
Allowed values: warn hide
contexts
required

Where the filter applies, at least one.

Array<string>
>= 1 items
Allowed values: home notifications public thread account
keywords
required

1 to 100 words. White space around each is removed. The user’s filters have at most 1,000 words in all.

Array<object>
>= 1 items <= 100 items

A word of a keyword filter.

object
keyword
required

The word or phrase, as the user typed it. It matches the text, the content warning, the poll’s choices, and the alt text of a post, each on its own, regardless of case, of half-width and full-width forms, and of katakana and hiragana; runs of white space match one space. Up to 100 characters once normalized.

string
>= 1 characters <= 400 characters
whole_word
required

Whether the word matches only where no letter, digit, or _ touches it. Characters of scripts that do not separate words with spaces (Chinese, Japanese, Thai, and the like) never count as touching, so there the word matches anywhere.

boolean
expires_at

When the filter stops applying; omit it for a filter that never does.

string format: date-time

Example generated

{
"title": "example",
"action": "warn",
"contexts": [
"home"
],
"keywords": [
{
"keyword": "example",
"whole_word": true
}
],
"expires_at": "2026-04-15T12:00:00Z"
}

For LLMs and coding agents:llms.txt,llms-full.txt, llms-small.txt

Analytics on this site