> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# block_documents

# `prefect.server.api.block_documents`

Routes for interacting with block objects.

## Functions

### `create_block_document` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_documents.py#L21](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_documents.py#L21)</sup>

```python theme={null}
create_block_document(block_document: schemas.actions.BlockDocumentCreate, db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.core.BlockDocument
```

Create a new block document.

For more information, see [https://www.prefect.io/docs/v3/concepts/blocks](https://www.prefect.io/docs/v3/concepts/blocks).

### `read_block_documents` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_documents.py#L57](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_documents.py#L57)</sup>

```python theme={null}
read_block_documents(limit: int = dependencies.LimitBody(), block_documents: Optional[schemas.filters.BlockDocumentFilter] = None, block_types: Optional[schemas.filters.BlockTypeFilter] = None, block_schemas: Optional[schemas.filters.BlockSchemaFilter] = None, include_secrets: bool = Body(False, description='Whether to include sensitive values in the block document.'), sort: Optional[schemas.sorting.BlockDocumentSort] = Body(schemas.sorting.BlockDocumentSort.NAME_ASC), offset: int = Body(0, ge=0), db: PrefectDBInterface = Depends(provide_database_interface)) -> List[schemas.core.BlockDocument]
```

Query for block documents.

### `count_block_documents` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_documents.py#L90](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_documents.py#L90)</sup>

```python theme={null}
count_block_documents(block_documents: Optional[schemas.filters.BlockDocumentFilter] = None, block_types: Optional[schemas.filters.BlockTypeFilter] = None, block_schemas: Optional[schemas.filters.BlockSchemaFilter] = None, db: PrefectDBInterface = Depends(provide_database_interface)) -> int
```

Count block documents.

### `read_block_document_by_id` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_documents.py#L111](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_documents.py#L111)</sup>

```python theme={null}
read_block_document_by_id(block_document_id: UUID = Path(..., description='The block document id', alias='id'), include_secrets: bool = Query(False, description='Whether to include sensitive values in the block document.'), db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.core.BlockDocument
```

### `delete_block_document` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_documents.py#L132](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_documents.py#L132)</sup>

```python theme={null}
delete_block_document(block_document_id: UUID = Path(..., description='The block document id', alias='id'), db: PrefectDBInterface = Depends(provide_database_interface)) -> None
```

### `update_block_document_data` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_documents.py#L149](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_documents.py#L149)</sup>

```python theme={null}
update_block_document_data(block_document: schemas.actions.BlockDocumentUpdate, block_document_id: UUID = Path(..., description='The block document id', alias='id'), db: PrefectDBInterface = Depends(provide_database_interface)) -> None
```
