BioFlow / API docs / addBlock

Add a block.

POST /v1/pages/{page_id}/blocks
scope: pages:writeCreator & Pro plansquota cost: 1send an Idempotency-Key

Append ONE block to the page DRAFT, preserving every existing block byte-for-byte. Optionally wire an uploaded file (public_path from List files) into IMAGE/FILE/CAROUSEL/PRODUCT blocks. Requires expected_updated_at.

Requires scope: pages:write. Plan entitlement: public_api (Creator and Pro).

Consequential operation — send an Idempotency-Key header.

Try it

Request.

curl "https://app.getbioflow.com/v1/pages/PAGE_ID/blocks" \ -X POST \ -H "Authorization: Bearer bf_live_YOUR_KEY" \ -H "Idempotency-Key: a-unique-id-per-attempt" \ -H "Content-Type: application/json" \ -d '{ "expected_updated_at": "string", "kind": "string", "data": {}, "file_url": "string", "file_name": "string" }'
Parameters

Path & query parameters.

Parameters accepted by addBlock
NameInTypeRequiredDescription
page_idpathstringyesPage ID from List pages
Request body

JSON body (application/json).

Request-body fields for addBlock
FieldTypeRequiredDescription
expected_updated_atstringyesConcurrency stamp: the draft.updated_at you last read. A mismatch is refused with 409 stale_snapshot — re-read the page and retry.
kindstringyesBlock kind, e.g. LINK
dataobjectno
file_urlstringnopublic_path of a workspace file from List files
file_namestringno
Response

201The page with the new block.

Fields of the 201 response for addBlock
FieldTypeDescription
idstring
titlestring
descriptionstring
slugstring
statusDRAFT | PUBLISHED | ARCHIVED
localestring
public_urlstring | nullLive URL when routed; null for unrouted drafts
themeobject
draftobject
publishedobject

Every response also carries X-Request-Id plus the IETF draft-11 RateLimit / RateLimit-Policy headers.

Errors

What can go wrong here.

Problem codes this operation can return
CodeStatusMeaning
invalid_request400The request body or parameters failed validation
invalid_api_key401Missing, malformed, unknown, disabled, or expired API key
insufficient_scope403The API key was not granted the required scope
feature_not_enabled403The workspace plan does not include public API access
test_key_read_only403Test-mode keys are restricted to read operations
rate_limited429Per-key rate limit exceeded
quota_exhausted429Monthly API quota exhausted
internal_error500Something went wrong on our side

All errors are RFC 9457 application/problem+json — branch on code, quote request_id to support. Full registry on the API docs hub; interactive playground in the API reference.