domain_blocks
View and update domain blocks.
getFetch domain blocks
View domains the user has blocked.
Returns: Array of strings
OAuth: User token + read:blocks
or follow
Version:
1.4.0 - added
Request
Headers
string
Query Parameters
string
string
string
Response
200: Success
Sample call with limit=2. Because domain ids are not public, you must parse the HTTP Link header to access next and previous pages.
Link: <https://mastodon.social/api/v1/domain_blocks?limit=2&max_id=16194>; rel="next", <https://mastodon.social/api/v1/domain_blocks?limit=2&since_id=16337>; rel="prev"
["nsfw.social","artalley.social"]
401: Unauthorized
Incorrect Authorization header
{
"error": "The access token is invalid"
}
postBlock a domain
Block a domain to:
- hide all public posts from it
- hide all notifications from it
- remove all followers from it
- prevent following new users from it (but does not remove existing follows)
Returns: n/a
OAuth: User token + ****write:blocks
or follow
Version:
1.4.0 - added
Request
Headers
string
Form Data Parameters
string
Response
200: Success
If the call was successful, an empty object will be returned. Note that the call will be successful even if the domain is already blocked or if the domain does not exist or if the domain is not a domain.
{}
401: Unauthorized
Incorrect Authorization header
{
"error": "The access token is invalid"
}
422: Unprocessable Entity
If domain
is not provided or contains spaces, the request will fail.
empty
{
"error": "Validation failed: Domain can't be blank"
}
invalid
{
"error": "Validation failed: Domain is not a valid domain name"
}
deleteUnblock a domain
Remove a domain block, if it exists in the user's array of blocked domains.
Returns: n/a
OAuth: User token + write:blocks
or follow
Version history:
1.4.0 - added
Request
Headers
string
Form Data Parameters
string
Response
200: Success
If the call was successful, an empty object will be returned. Note that the call will be successful even if the domain was not previously blocked.
{}
401: Unauthorized
Incorrect Authorization header
{
"error": "The access token is invalid"
}
422: Unprocessable Entity
If domain
is not provided or contains spaces, the request will fail.
empty
{
"error": "Validation failed: Domain can't be blank"
}
invalid domain
{
"error": "Validation failed: Domain is not a valid domain name"
}
Last updated December 27, 2020 · Improve this page