API overview
The shape of the Pagebread API: its base path, the JSON:API envelope, versioning, and which routes are public and which need a signed-in account.
The Pagebread console is built on the same HTTP API described here. Every route answers JSON in the JSON:API shape, and the full list of routes, parameters and schemas is in the API reference.
Base URL and versioning
Every route lives under one versioned path:
<API host>/api/v2/The examples in these pages write the host as $PAGEBREAD_API. Version 2 is the only version; there is no version header or query parameter.
Note
This is the API the console itself uses. Routes for your workspace accept the access token of a signed-in Pagebread account, the same token the console uses; see Authentication. To connect your own systems with an API key, use the public API, which is in private beta.
Kinds of route
| Kind | Paths | Who calls it | Credential |
|---|---|---|---|
| Console | /api/v2/policies, /api/v2/flows, /api/v2/submissions (reviewing), /api/v2/organizations/me, /api/v2/billing, … | People in your workspace | Authorization: Bearer <access token> |
| Applicant | POST /api/v2/submissions, PATCH /api/v2/submissions/:id, POST /api/v2/submissions/:id/answers, POST /api/v2/submissions/:id/documents | Someone filling in a public form | None to start; then the draft's X-Applicant-Secret |
| Member portal | /api/v2/public/members/… | Members of your roster | The pagebread_member_session cookie |
| Public | Everything else under /api/v2/public/ | Anyone | None |
| Provider webhooks | /api/v2/billing/webhooks/dodo, /api/v2/public/webhooks/resend | Pagebread's payment and email providers | A signature; see Webhooks |
Public routes include the published form (/api/v2/public/flows), an application's status (/api/v2/public/submissions/:id/tracking), invitation links, branding, try-out links, the list of plans (/api/v2/public/plans) and maintenance notices.
Console routes act on the workspace the signed-in person belongs to. There is no workspace id in the path: /api/v2/organizations/me is always your own.
Requests
Send bodies as JSON, with Content-Type: application/json or application/vnd.api+json. Bodies are JSON objects of attributes, not JSON:API resource documents:
curl -X POST "$PAGEBREAD_API/api/v2/flows" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"policy_id": "<policy id>", "title": "Supplier onboarding"}'Every request is checked against the API's OpenAPI description before it reaches a route. A body or query that doesn't match is refused with 422 VALIDATION_ERROR (or 400), naming the field. Unknown query parameters are ignored.
Uploads (…/documents, logos) are multipart/form-data.
Responses
A single resource:
{
"jsonapi": { "version": "1.1" },
"data": {
"type": "flows",
"id": "7c1e…",
"attributes": { "title": "Supplier onboarding", "status": "draft" }
}
}A list has data as an array, and its paging in meta; see Errors and pagination. Some responses carry extra values in a top-level meta, for example the applicant secret when a draft is created.
An error has an errors array instead of data:
{
"jsonapi": { "version": "1.1" },
"errors": [
{ "status": "404", "code": "NOT_FOUND", "title": "Submission not found" }
]
}Every response carries an x-request-id header. Quote it when you contact support about a request.
Limits on requests
Requests are rate limited per client address and, for console routes, per workspace. See Rate limits. Some actions are also limited by your plan; those answer 402 or 403 with an explanation in meta. See Editions and limits.