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
user string required

User identifier (id or uid).

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
skip string

The number of items to skip. Used together with take to return a specific range of items (for pagination).

take string

Maximum number of items to return in the listing. Should be a value between 1 and 100. Default is 25.

count_only boolean

true to count the number of matching items instead of listing them; when specified the response will only contain the count property.

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
user string required

User identifier (id or uid).

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