Skip to main content
Documentation
Docs
Esc

    Loading the search index…

    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:

    text
    <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

    KindPathsWho calls itCredential
    Console/api/v2/policies, /api/v2/flows, /api/v2/submissions (reviewing), /api/v2/organizations/me, /api/v2/billing, …People in your workspaceAuthorization: Bearer <access token>
    ApplicantPOST /api/v2/submissions, PATCH /api/v2/submissions/:id, POST /api/v2/submissions/:id/answers, POST /api/v2/submissions/:id/documentsSomeone filling in a public formNone to start; then the draft's X-Applicant-Secret
    Member portal/api/v2/public/members/…Members of your rosterThe pagebread_member_session cookie
    PublicEverything else under /api/v2/public/AnyoneNone
    Provider webhooks/api/v2/billing/webhooks/dodo, /api/v2/public/webhooks/resendPagebread's payment and email providersA 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:

    Create a flow
    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:

    json
    {
      "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:

    json
    {
      "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.