User Blocking

Blocking a user prevents the blocked user and the blocking user from seeing each other on the network except in a few necessary places.

Endpoints:

GET /users/{user_id}/blocked

Scope: any

Retrieve a list of blocked users. Users may only see their own list of blocked users.

URL Parameters

Name Description
user_id ID of the user whose list of blocked users to retrieve
Example
curl "https://api.pnut.io/v0/users/me/blocked" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of users

"call for example 1"

PUT /users/{user_id}/block

Token: user

Scope: follow

Block a user. Blocked users will not show up in future requests, the same as if they were muted. Blocked users also cannot retrieve this authorized user in their requests. Can do so even if the other user is blocking you (but will only return an ID of the blocked user).

URL Parameters

Name Description
user_id ID of the user to block
Example
curl "https://api.pnut.io/v0/users/@testuser/block" \
    -X PUT \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns the blocked user

"call for example 2"

DELETE /users/{user_id}/block

Token: user

Scope: follow

Unblock a user. Can do so even if the other user is blocking you (but will only return an ID of the blocked user).

URL Parameters

Name Description
user_id ID of the user to unblock
Example
curl "https://api.pnut.io/v0/users/@testuser/block" \
    -X DELETE \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns the unblocked user

"call for example 3"