Skip to main content
POST
/
api
/
block_documents
/
filter
Read Block Documents
curl --request POST \
  --url https://api.example.com/api/block_documents/filter \
  --header 'Content-Type: application/json' \
  --data '
{
  "block_documents": {
    "operator": "and_",
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "is_anonymous": {
      "eq_": false
    },
    "block_type_id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "name": {
      "any_": [
        "<string>"
      ],
      "like_": "my-block%"
    }
  },
  "block_types": {
    "name": {
      "like_": "marvin"
    },
    "slug": {
      "any_": [
        "<string>"
      ]
    }
  },
  "block_schemas": {
    "operator": "and_",
    "block_type_id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "block_capabilities": {
      "all_": [
        "write-storage",
        "read-storage"
      ]
    },
    "id": {
      "any_": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "version": {
      "any_": [
        "2.0.0",
        "2.1.0"
      ]
    }
  },
  "include_secrets": false,
  "sort": "NAME_ASC",
  "offset": 0,
  "limit": 123
}
'
[
  {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created": "2023-11-07T05:31:56Z",
    "updated": "2023-11-07T05:31:56Z",
    "block_schema_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "block_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "data": {},
    "block_schema": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "created": "2023-11-07T05:31:56Z",
      "updated": "2023-11-07T05:31:56Z",
      "checksum": "<string>",
      "block_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "fields": {},
      "block_type": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "created": "2023-11-07T05:31:56Z",
        "updated": "2023-11-07T05:31:56Z",
        "name": "<string>",
        "slug": "<string>",
        "logo_url": "<string>",
        "documentation_url": "<string>",
        "description": "<string>",
        "code_example": "<string>",
        "is_protected": false
      },
      "capabilities": [
        "<string>"
      ],
      "version": "non-versioned"
    },
    "block_type_name": "<string>",
    "block_type": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "created": "2023-11-07T05:31:56Z",
      "updated": "2023-11-07T05:31:56Z",
      "name": "<string>",
      "slug": "<string>",
      "logo_url": "<string>",
      "documentation_url": "<string>",
      "description": "<string>",
      "code_example": "<string>",
      "is_protected": false
    },
    "block_document_references": {},
    "is_anonymous": false
  }
]

Headers

x-prefect-api-version
string

Body

application/json
block_documents
BlockDocumentFilter · object

Filter BlockDocuments. Only BlockDocuments matching all criteria will be returned

block_types
BlockTypeFilter · object

Filter BlockTypes

block_schemas
BlockSchemaFilter · object

Filter BlockSchemas

include_secrets
boolean
default:false

Whether to include sensitive values in the block document.

sort
enum<string> | null
default:NAME_ASC

Defines block document sorting options.

Available options:
NAME_DESC,
NAME_ASC,
BLOCK_TYPE_AND_NAME_ASC
offset
integer
default:0
Required range: x >= 0
limit
integer

Defaults to PREFECT_API_DEFAULT_LIMIT if not provided.

Response

Successful Response

id
string<uuid>
required
created
string<date-time> | null
required
updated
string<date-time> | null
required
block_schema_id
string<uuid>
required

A block schema ID

block_type_id
string<uuid>
required

A block type ID

name
string | null

The block document's name. Not required for anonymous block documents.

data
Data · object

The block document's data

block_schema
BlockSchema · object

The associated block schema

block_type_name
string | null

The associated block type's name

block_type
BlockType · object

The associated block type

block_document_references
Block Document References · object

Record of the block document's references

is_anonymous
boolean
default:false

Whether the block is anonymous (anonymous blocks are usually created by Prefect automatically)