Blocks
The Blocks API lets a user block and unblock another user. Blocking is one-way and receive-side: it quiets the blocker's side of the relationship -- no notifications, no unread, a muted conversation -- while the blocked user sees and sends exactly as before and is never told. Agents and the system user cannot be blocked.
Block user
Block a user on behalf of the authenticated user.
POST /api/users/{user}/blocks
Path parameters
userstringrequiredUser identifier (
idoruid).
Example request
curl -X POST {WEAVY-URL}/api/users/bugs-bunny/blocks
-H "Authorization: Bearer {ACCESS-TOKEN}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
List blocked users
List the users blocked by the authenticated user.
GET /api/user/blocks
Query parameters
skipstringThe number of items to skip. Used together with
taketo return a specific range of items (for pagination).
takestringMaximum number of items to return in the listing. Should be a value between
1and100. Default is25.
count_onlybooleantrueto count the number of matching items instead of listing them; when specified the response will only contain thecountproperty.
Example request
curl {WEAVY-URL}/api/user/blocks
-H "Authorization: Bearer {ACCESS-TOKEN}"
Response codes
200 OK
401 Unauthorized
Response schema
{
"data": [
{
"id": "string",
"uid": "string",
"name": "string",
"given_name": "string",
"middle_name": "string",
"family_name": "string",
"nickname": "string",
"email": "string",
"phone_number": "string",
"username": "string",
"avatar_url": "string",
"directories": [
"object"
],
"presence": "object",
"comment": "string",
"metadata": "object",
"tags": [
"string"
],
"created_at": "string",
"updated_at": "string",
"is_blocked": "boolean",
"is_followed": "boolean",
"is_reported": "boolean",
"is_trashed": "boolean"
}
],
"start": "string",
"end": "string",
"count": "string"
}
Unblock user
Unblock a user on behalf of the authenticated user. Unblocking a user who is not blocked succeeds and does nothing.
DELETE /api/users/{user}/blocks
Path parameters
userstringrequiredUser identifier (
idoruid).
Example request
curl -X DELETE {WEAVY-URL}/api/users/bugs-bunny/blocks
-H "Authorization: Bearer {ACCESS-TOKEN}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found