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

# block_schemas

# `prefect.server.api.block_schemas`

Routes for interacting with block schema objects.

## Functions

### `create_block_schema` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_schemas.py#L28](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_schemas.py#L28)</sup>

```python theme={null}
create_block_schema(block_schema: schemas.actions.BlockSchemaCreate, response: Response, db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.core.BlockSchema
```

Create a block schema.

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

### `delete_block_schema` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_schemas.py#L73](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_schemas.py#L73)</sup>

```python theme={null}
delete_block_schema(block_schema_id: UUID = Path(..., description='The block schema id', alias='id'), db: PrefectDBInterface = Depends(provide_database_interface), api_version: str = Depends(dependencies.provide_request_api_version)) -> None
```

Delete a block schema by id.

### `read_block_schemas` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_schemas.py#L102](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_schemas.py#L102)</sup>

```python theme={null}
read_block_schemas(block_schemas: Optional[schemas.filters.BlockSchemaFilter] = None, limit: int = dependencies.LimitBody(), offset: int = Body(0, ge=0), db: PrefectDBInterface = Depends(provide_database_interface)) -> List[schemas.core.BlockSchema]
```

Read all block schemas, optionally filtered by type

### `read_block_schema_by_id` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_schemas.py#L122](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_schemas.py#L122)</sup>

```python theme={null}
read_block_schema_by_id(block_schema_id: UUID = Path(..., description='The block schema id', alias='id'), db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.core.BlockSchema
```

Get a block schema by id.

### `read_block_schema_by_checksum` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block\_schemas.py#L139](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/block_schemas.py#L139)</sup>

```python theme={null}
read_block_schema_by_checksum(block_schema_checksum: str = Path(..., description='The block schema checksum', alias='checksum'), db: PrefectDBInterface = Depends(provide_database_interface), version: Optional[str] = Query(None, description='Version of block schema. If not provided the most recently created block schema with the matching checksum will be returned.')) -> schemas.core.BlockSchema
```
