Skip to content

client.blocks

client.blocks — the blocks operations.

On AsyncKindgi every method is the same, awaited.

list(
*,
limit: int | None = None,
cursor: str | None = None,
kind: Literal['prompt', 'settings'] | None = None,
name: str | None = None,
scope_kind: Literal['tenant', 'org', 'project'] | None = None,
scope_id: str | UUID | None = None,
timeout: float | None = None,
) -> BlockCollectionPage

List data blocks (latest version of each). GET /v1/blocks

Cursor-paginated. Only the blocks of projects the caller can read. ?kind= narrows to prompts or settings, ?name= is a prefix match on the id, and ?scopeKind= + ?scopeId= narrow to a project or an org, as the other lists do.

publish(
body: PublishBlockBody | Mapping[str, Any] | None = None,
/,
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> PublishBlockResult

Publish a data block version. POST /v1/blocks

Needs write on the project. A prompt's template must parse as Liquid; a settings block's values must satisfy its schema and the latest version's. A taken version is 409 block-already-registered (versions never change); a block keeps its kind, and its versions stay in its first version's project (409 block-project-mismatch). Idempotency-Key applies.

get(block_id: str | UUID, /, *, timeout: float | None = None) -> Block

Fetch a data block (latest version). GET /v1/blocks/{blockId}