---
title: "Count Block Documents"
method: POST
path: "/api/block_documents/count"
tags: ["Block documents"]
---

# Count Block Documents

`POST /api/block_documents/count`

## Request

- The document declares no server URL.
- Auth: none declared

Count block documents.

## Headers

- `x-prefect-api-version` string

## Request body

- BodyCountBlockDocumentsBlockDocumentsCountPost
  - `block_documents` BlockDocumentFilter: Filter BlockDocuments. Only BlockDocuments matching all criteria will be returned
    - `operator` 'and_' | 'or_': Operators for combining filter criteria.
    - `id` BlockDocumentFilterId: Filter by `BlockDocument.id`.
      - `any_` string[]: A list of block ids to include
    - `is_anonymous` BlockDocumentFilterIsAnonymous: Filter by `BlockDocument.is_anonymous`.
      - `eq_` boolean: Filter block documents for only those that are or are not anonymous.
    - `block_type_id` BlockDocumentFilterBlockTypeId: Filter by `BlockDocument.block_type_id`.
      - `any_` string[]: A list of block type ids to include
    - `name` BlockDocumentFilterName: Filter by `BlockDocument.name`.
      - `any_` string[]: A list of block names to include
      - `like_` string: A string to match block names against. This can include SQL wildcard characters like `%` and `_`.
  - `block_types` BlockTypeFilter: Filter BlockTypes
    - `name` BlockTypeFilterName: Filter by `BlockType.name`
      - `like_` string: A case-insensitive partial match. For example, passing 'marvin' will match 'marvin', 'sad-Marvin', and 'marvin-robot'.
    - `slug` BlockTypeFilterSlug: Filter by `BlockType.slug`
      - `any_` string[]: A list of slugs to match
  - `block_schemas` BlockSchemaFilter: Filter BlockSchemas
    - `operator` 'and_' | 'or_': Operators for combining filter criteria.
    - `block_type_id` BlockSchemaFilterBlockTypeId: Filter by `BlockSchema.block_type_id`.
      - `any_` string[]: A list of block type ids to include
    - `block_capabilities` BlockSchemaFilterCapabilities: Filter by `BlockSchema.capabilities`
      - `all_` string[]: A list of block capabilities. Block entities will be returned only if an associated block schema has a superset of the defined capabilities.
    - `id` BlockSchemaFilterId: Filter by BlockSchema.id
      - `any_` string[]: A list of IDs to include
    - `version` BlockSchemaFilterVersion: Filter by `BlockSchema.capabilities`
      - `any_` string[]: A list of block schema versions.

## Response `200`

Successful Response

- integer

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/prefecthq/apis/prefect-versions-api.md) - [All operations](https://skmtc.dev/prefecthq/apis/prefect-versions-api/llms.txt) - [OpenAPI document](https://skmtc.dev/prefecthq/apis/prefect-versions-api/revisions/a7958ce57e96?raw)
