client.blocks
client.blocks — the blocks operations.
On AsyncKindgi every method is the same, awaited.
client.blocks.list()
Section titled “client.blocks.list()”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,) -> BlockCollectionPageList 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.
client.blocks.publish()
Section titled “client.blocks.publish()”publish( body: PublishBlockBody | Mapping[str, Any] | None = None, /, *, idempotency_key: str | None = None, timeout: float | None = None, **fields: Any,) -> PublishBlockResultPublish 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.
client.blocks.get()
Section titled “client.blocks.get()”get(block_id: str | UUID, /, *, timeout: float | None = None) -> BlockFetch a data block (latest version). GET /v1/blocks/{blockId}