Prefect Block documents API
Interact with a Workspace's Blocks.
Interact with a Workspace's Blocks.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/prefect-block-documents-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Prefect Cloud Account Billing Block documents API
description: Prefect Cloud REST API documentation.
version: 0.8.4
tags:
- name: Block documents
description: Interact with a Workspace's Blocks.
externalDocs:
description: Securely store typed configuration
url: https://docs.prefect.io/v3/develop/blocks
paths:
/api/accounts/{account_id}/workspaces/{workspace_id}/block_types/slug/{slug}/block_documents:
get:
tags:
- Block documents
summary: Read Block Documents For Block Type
description: '
Required workspace scopes: `see_blocks`'
operationId: read_block_documents_for_block_type_api_accounts__account_id__workspaces__workspace_id__block_types_slug__slug__block_documents_get
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: slug
in: path
required: true
schema:
type: string
description: The block type name
title: Slug
description: The block type name
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: include_secrets
in: query
required: false
schema:
type: boolean
description: Whether to include sensitive values in the block document.
default: false
title: Include Secrets
description: Whether to include sensitive values in the block document.
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/BlockDocument'
title: Response Read Block Documents For Block Type Api Accounts Account Id Workspaces Workspace Id Block Types Slug Slug Block Documents Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/block_types/slug/{slug}/block_documents/name/{block_document_name}:
get:
tags:
- Block documents
summary: Read Block Document By Name For Block Type
description: '
Required workspace scopes: `see_blocks`'
operationId: read_block_document_by_name_for_block_type_api_accounts__account_id__workspaces__workspace_id__block_types_slug__slug__block_documents_name__block_document_name__get
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: slug
in: path
required: true
schema:
type: string
description: The block type name
title: Slug
description: The block type name
- name: block_document_name
in: path
required: true
schema:
type: string
description: The block type name
title: Block Document Name
description: The block type name
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: include_secrets
in: query
required: false
schema:
type: boolean
description: Whether to include sensitive values in the block document.
default: false
title: Include Secrets
description: Whether to include sensitive values in the block document.
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/BlockDocument'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/block_documents/:
post:
tags:
- Block documents
summary: Create Block Document
description: 'Create a new block document.
Required workspace scopes: `manage_blocks`'
operationId: create_block_document_api_accounts__account_id__workspaces__workspace_id__block_documents__post
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BlockDocumentCreate'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/BlockDocument'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
put:
tags:
- Block documents
summary: Create Or Update Block Document
description: '
Required workspace scopes: `manage_blocks`'
operationId: create_or_update_block_document_api_accounts__account_id__workspaces__workspace_id__block_documents__put
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BlockDocumentCreate'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/BlockDocument'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/block_documents/filter:
post:
tags:
- Block documents
summary: Read Block Documents
description: 'Query for block documents.
Required workspace scopes: `see_blocks`'
operationId: read_block_documents_api_accounts__account_id__workspaces__workspace_id__block_documents_filter_post
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Body_read_block_documents_api_accounts__account_id__workspaces__workspace_id__block_documents_filter_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/BlockDocument'
title: Response Read Block Documents Api Accounts Account Id Workspaces Workspace Id Block Documents Filter Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/block_documents/count:
post:
tags:
- Block documents
summary: Count Block Documents
description: 'Count block documents.
Required workspace scopes: `see_blocks`'
operationId: count_block_documents_api_accounts__account_id__workspaces__workspace_id__block_documents_count_post
parameters:
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Body_count_block_documents_api_accounts__account_id__workspaces__workspace_id__block_documents_count_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: integer
title: Response Count Block Documents Api Accounts Account Id Workspaces Workspace Id Block Documents Count Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/block_documents/{id}:
get:
tags:
- Block documents
summary: Read Block Document By Id
description: '
Required workspace scopes: `see_blocks`'
operationId: read_block_document_by_id_api_accounts__account_id__workspaces__workspace_id__block_documents__id__get
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: id
in: path
required: true
schema:
type: string
format: uuid
description: The block document id
title: Id
description: The block document id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: include_secrets
in: query
required: false
schema:
type: boolean
description: Whether to include sensitive values in the block document.
default: false
title: Include Secrets
description: Whether to include sensitive values in the block document.
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/BlockDocument'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Block documents
summary: Delete Block Document
description: '
Required workspace scopes: `manage_blocks`'
operationId: delete_block_document_api_accounts__account_id__workspaces__workspace_id__block_documents__id__delete
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
description: The block document id
title: Id
description: The block document id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
patch:
tags:
- Block documents
summary: Update Block Document Data
description: '
Required workspace scopes: `manage_blocks`'
operationId: update_block_document_data_api_accounts__account_id__workspaces__workspace_id__block_documents__id__patch
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: id
in: path
required: true
schema:
type: string
format: uuid
description: The block document id
title: Id
description: The block document id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BlockDocumentUpdate'
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/block_documents/{id}/access:
get:
tags:
- Block documents
summary: Read Block Document Access
description: 'Read access controls for a block_document.
Required workspace scopes: `see_blocks`'
operationId: read_block_document_access_api_accounts__account_id__workspaces__workspace_id__block_documents__id__access_get
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
description: The block_document id
title: Id
description: The block_document id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/BlockDocumentAccessControl'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
put:
tags:
- Block documents
summary: Set Block Document Access
description: 'Set access controls for a block document.
The given access controls will replace any existing access controls.
Required workspace scopes: `manage_blocks`'
operationId: set_block_document_access_api_accounts__account_id__workspaces__workspace_id__block_documents__id__access_put
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
description: The block_document id
title: Id
description: The block_document id
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Body_set_block_document_access_api_accounts__account_id__workspaces__workspace_id__block_documents__id__access_put'
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/accounts/{account_id}/workspaces/{workspace_id}/block_documents/my-access:
post:
tags:
- Block documents
summary: Read Actors Block Document Access
description: 'Read access controls for a set of block documents and return the resolved
access levels for the current actor.
Required workspace scopes: `see_blocks`'
operationId: read_actors_block_document_access_api_accounts__account_id__workspaces__workspace_id__block_documents_my_access_post
parameters:
- name: account_id
in: path
required: true
schema:
type: string
format: uuid
title: Account Id
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: x-prefect-api-version
in: header
required: false
schema:
type: string
title: X-Prefect-Api-Version
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Body_read_actors_block_document_access_api_accounts__account_id__workspaces__workspace_id__block_documents_my_access_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties:
type: array
items:
type: string
title: Response Read Actors Block Document Access Api Accounts Account Id Workspaces Workspace Id Block Documents My Access Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
Body_count_block_documents_api_accounts__account_id__workspaces__workspace_id__block_documents_count_post:
properties:
block_documents:
anyOf:
- $ref: '#/components/schemas/BlockDocumentFilter'
- type: 'null'
block_types:
anyOf:
- $ref: '#/components/schemas/BlockTypeFilter'
- type: 'null'
block_schemas:
anyOf:
- $ref: '#/components/schemas/BlockSchemaFilter'
- type: 'null'
type: object
title: Body_count_block_documents_api_accounts__account_id__workspaces__workspace_id__block_documents_count_post
BlockDocumentFilterBlockTypeId:
properties:
any_:
anyOf:
- items:
type: string
format: uuid
type: array
- type: 'null'
title: Any
description: A list of block type ids to include
additionalProperties: false
type: object
title: BlockDocumentFilterBlockTypeId
description: Filter by `BlockDocument.block_type_id`.
BlockDocument:
properties:
id:
type: string
format: uuid
title: Id
created:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Created
updated:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Updated
name:
anyOf:
- type: string
pattern: ^[^/%&><]+$
- type: 'null'
title: Name
description: The block document's name. Not required for anonymous block documents.
data:
additionalProperties: true
type: object
title: Data
description: The block document's data
block_schema_id:
type: string
format: uuid
title: Block Schema Id
description: A block schema ID
block_schema:
anyOf:
- $ref: '#/components/schemas/BlockSchema'
- type: 'null'
description: The associated block schema
block_type_id:
type: string
format: uuid
title: Block Type Id
description: A block type ID
block_type_name:
anyOf:
- type: string
- type: 'null'
title: Block Type Name
description: A block type name
block_type:
anyOf:
- $ref: '#/components/schemas/BlockType'
- type: 'null'
description: The associated block type
block_document_references:
additionalProperties:
additionalProperties: true
type: object
type: object
title: Block Document References
description: Record of the block document's references
is_anonymous:
type: boolean
title: Is Anonymous
description: Whether the block is anonymous (anonymous blocks are usually created by Prefect automatically)
default: false
type: object
required:
- block_schema_id
- block_type_id
title: BlockDocument
description: An ORM representation of a block document.
BlockDocumentSort:
type: string
enum:
- NAME_DESC
- NAME_ASC
- BLOCK_TYPE_AND_NAME_ASC
title: BlockDocumentSort
description: Defines block document sorting options.
BlockDocumentFilter:
properties:
operator:
$ref: '#/components/schemas/prefect_cloud__orion__schemas__filters__Operator'
description: Operator for combining filter criteria. Defaults to 'and_'.
default: and_
id:
anyOf:
- $ref: '#/components/schemas/BlockDocumentFilterId'
- type: 'null'
description: Filter criteria for `BlockDocument.id`
is_anonymous:
anyOf:
- $ref: '#/components/schemas/BlockDocumentFilterIsAnonymous'
- type: 'null'
description: Filter criteria for `BlockDocument.is_anonymous`. Defaults to excluding anonymous blocks.
default:
eq_: false
block_type_id:
anyOf:
- $ref: '#/components/schemas/BlockDocumentFilterBlockTypeId'
- type: 'null'
description: Filter criteria for `BlockDocument.block_type_id`
name:
anyOf:
- $ref: '#/components/schemas/BlockDocumentFilterName'
- type: 'null'
description: Filter criteria for `BlockDocument.name`
additionalProperties: false
type: object
title: BlockDocumentFilter
description: Filter BlockDocuments. Only BlockDocuments matching all criteria will be returned
BlockDocumentFilterName:
properties:
any_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: Any
description: A list of block names to include
like_:
anyOf:
- type: string
- type: 'null'
title: Like
description: A string to match block names against. This can include SQL wildcard characters like `%` and `_`.
examples:
- my-block%
additionalProperties: false
type: object
title: BlockDocumentFilterName
description: Filter by `BlockDocument.name`.
BlockSchemaFilterCapabilities:
properties:
all_:
anyOf:
- items:
type: string
type: array
- type: 'null'
title: All
description: A list of block capabilities. Block entities will be returned only if an associated block schema has a superset of the defined capabilities.
examples:
- - write-storage
- read-storage
additionalProperties: false
type: object
title: BlockSchemaFilterCapabilities
description: Filter by `BlockSchema.capabilities`
BlockSchemaFilter:
properties:
operator:
$ref: '#/components/schemas/prefect_cloud__orion__schemas__filters__Operator'
description: Operator for combining filter criteria. Defaults to 'and_'.
default: and_
block_type_id:
anyOf:
- $ref: '#/components/schemas/BlockSchemaFilterBlockTypeId'
- type: 'null'
description: Filter criteria for `BlockSchema.block_type_id`
block_capabilities:
anyOf:
- $ref: '#/components/schemas/BlockSchemaFilterCapabilities'
- type: 'null'
description: Filter criteria for `BlockSchema.capabilities`
id:
anyOf:
- $ref: '#/components/schemas/BlockSchemaFilterId'
- type: 'null'
description: Filter criteria for `BlockSchema.id`
version:
anyOf:
- $ref: '#/components/schemas/BlockSchemaFilterVersion'
- type: 'null'
description: Filter criteria for `BlockSchema.version`
additionalProperties: false
type: object
title: BlockSchemaFilter
description: Filter BlockSchemas
BlockDocumentFilterId:
properties:
any_:
anyOf:
- items:
type: string
format: uuid
type: array
- type: 'null'
title: Any
description: A list of block ids to include
additionalProperties: false
type: object
title: BlockDocumentFilterId
description: Filter by `BlockDocument.id`.
BlockSchemaFilterBlockTypeId:
properties:
any_:
anyOf:
- items:
type: string
format: uuid
type: array
- type: 'null'
title: Any
description: A list of block type ids to include
additionalProperties: false
type: object
title: BlockSchemaFilterBlockTypeId
description: Filter by `BlockSchema.block_type_id`.
BlockDocumentAccessControl:
properties:
manage_actors:
items:
$ref: '#/components/schemas/ObjectActorAccess'
type: array
title: Manage Actors
description: A list of actors with access to manage the block document.
view_actors:
items:
$ref: '#/components/schemas/ObjectActorAccess'
type: array
title: View Actors
description: A list of actors with access to view the block document.
type: object
title: BlockDocumentAccessControl
description: A representation of the access control for a block document.
Body_read_actors_block_document_access_api_accounts__account_id__workspaces__workspace_id__block_documents_my_access_post:
properties:
block_document_ids:
items:
type: string
format: uuid
type: array
title: Block Document Ids
type: object
required:
- block_document_ids
title: Body_read_actors_block_document_access_api_accounts__account_id__workspaces__workspace_id__block_documents_my_access_post
BlockSchema:
properties:
id:
type: string
format: uuid
title: Id
created:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Created
updated:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Updated
checksum:
type: string
title: Checksum
description: The block schema's unique checksum
fields:
additionalProperties: true
type: object
title: Fields
description: The block schema's field schema
block_type_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Block Type Id
description: A block type ID
block_type:
anyOf:
- $ref: '#/components/schemas/BlockType'
- type: 'null'
description: The associated block type
capabilities:
items:
type: string
type: array
title: Capabilities
description: A list of Block capabilities
version:
type: string
title: Version
description: Human readable identifier for the block schema
default: non-versioned
type: object
required:
- checksum
- block_type_id
title: BlockSchema
description: An ORM representation of a block schema.
BlockTypeFilterName:
properties:
like_:
anyOf:
- type: string
- type: 'null'
title: Like
description: A case-insensitive partial match. For example, passing 'marvin' will match 'marvin', 'sad-Marvin', and 'marvin-robot'.
examples:
- marvin
additionalProperties: false
type: object
title: BlockTypeFilterName
description: Filter by `BlockType.name`
BlockType:
properties:
id:
type: string
format: uuid
title: Id
created:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Created
updated:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Updated
name:
type: string
pattern: ^[^/%&><]+$
title: Name
description: A block type's name
slug:
type: string
title: Slug
description: A block type's slug
logo_url:
anyOf:
- type: string
- type: 'null'
title: Logo Url
description: Web URL for the block type's logo
documentation_url:
anyOf:
- type: string
- type: 'null'
title: Documentation Url
description: Web URL for the block type's documentation
description:
anyOf:
- type: string
- type: 'null'
title: Description
description: A short blurb about the corresponding block's intended use
code_example:
anyOf:
- type: string
- type: 'null'
title: Code Example
description: A code snippet demonstrating u
# --- truncated at 32 KB (40 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/prefect/refs/heads/main/openapi/prefect-block-documents-api-openapi.yml