User Blocking

Endpoints:

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

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/v1/users/me/blocked" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of users

{
    "meta": {
        "more": false,
        "code": 200
    },
    "data": [
        {"...User Object..."}
    ]
}

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. A user can block another user even if the other user is blocking them (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/v1/users/@testuser/block" \
    -X PUT \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns the blocked user

{
    "meta": {
        "code": 200
    },
    "data": {"....User Object..."}
}

DELETE /users/{user_id}/block

Token: user

Scope: follow

Unblock a user. A user can unblock another user even if the other user is blocking them (but will only return an ID of the unblocked user).

URL Parameters

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

Returns the unblocked user

{
    "meta": {
        "code": 200
    },
    "data": {"...User Object...."}
}