Skip to main content
Documentation
Docs
Esc

    Loading the search index…

    Errors and pagination

    The JSON:API error shape, the error codes you are most likely to meet, and how to page through lists.

    Every error from the API has the same shape, and every list pages the same way. This page covers both.

    The error shape

    An error response has an errors array and no data. Each error has:

    FieldAlways presentWhat it holds
    statusYesThe HTTP status, as a string
    codeYesA stable, machine-readable code such as NOT_FOUND. Act on this, not on the wording.
    titleYesA short sentence for people
    detailNoMore explanation, or the reason a field was refused
    source.pointerNoWhich part of the request was wrong, for example /body/policy_id or /query/from
    source.parameterNoWhich query parameter was wrong
    metaNoMachine-readable context, for example a plan limit and its upgrade hint
    A validation error
    {
      "jsonapi": { "version": "1.1" },
      "errors": [
        {
          "status": "422",
          "code": "VALIDATION_ERROR",
          "title": "Invalid request",
          "detail": "Flow title is required",
          "source": { "pointer": "/body/title" }
        }
      ]
    }

    A validation error lists one entry per problem, so check the whole array.

    Common codes

    CodeStatusMeaning
    MALFORMED_JSON400The body isn't valid JSON.
    VALIDATION_ERROR400 or 422The body, path or query doesn't match what the route accepts.
    UNAUTHORIZED401No valid access token. See Authentication.
    MEMBER_UNAUTHENTICATED401No valid member session.
    PLAN_LIMIT402A plan limit or allowance is used up.
    FEATURE_NOT_IN_PLAN403The feature isn't on your plan.
    SUBSCRIPTION_RESTRICTED403Billing needs attention; nothing new can be created.
    PROFILE_INCOMPLETE403Complete the workspace profile first.
    WORKSPACE_SUSPENDED403The workspace is read-only.
    NOT_FOUND404The record doesn't exist, belongs to another workspace, or your role can't use this route. These three are deliberately indistinguishable.
    WORKSPACE_SETUP_REQUIRED409The signed-in person has no workspace yet. GET /api/v2/organizations/me returns this instead of creating one; POST /api/v2/onboarding/workspace creates it.
    SUBMISSION_LOCKED409The application has already been sent and can't be changed by the applicant.
    FORM_PAUSED409The form isn't taking new applications right now.
    SELF_APPROVAL_REFUSED409You can't approve your own proposal while another approver can.
    REQUEST_TOO_LARGE413The body or file is too big.
    RATE_LIMITED429Too many requests; wait for Retry-After. See Rate limits.
    INTERNAL_ERROR500Something failed on Pagebread's side. Retry later, and quote the x-request-id header if you contact support.
    READ_ONLY_CONSOLE503Pagebread is in maintenance; reads still work.
    AUTH_UNAVAILABLE503The sign-in couldn't be checked right now, including when the identity provider is rate-limiting; wait for Retry-After.
    ORGANIZATION_UNAVAILABLE503Your workspace couldn't be loaded right now; wait for Retry-After.
    UPLOADS_BUSY503Too many uploads in progress; wait for Retry-After.
    SUBMIT_UNAVAILABLE503An application couldn't be sent in time. Nothing was changed; send it again in a few seconds.

    Routes have their own codes too, for conflicts specific to what they do. The API reference lists each route's responses.

    Plan errors

    PLAN_LIMIT and FEATURE_NOT_IN_PLAN explain themselves in meta, so a client can show what to do next:

    402 PLAN_LIMIT (values are illustrative)
    {
      "status": "402",
      "code": "PLAN_LIMIT",
      "title": "You've reached your plan's limit of …",
      "meta": {
        "limit_key": "flows.active",
        "kind": "count",
        "limit": 10,
        "used": 10,
        "plan": "<your plan>",
        "cap": null,
        "resets_at": null,
        "upgrade": { "plan": "<next plan>", "name": "<Next plan>", "url": "/console/settings/billing?upgrade=<next plan>&reason=flows.active" },
        "can_manage_billing": true
      }
    }
    FieldMeaning
    limit_keyWhich limit or allowance
    kindcount (things you have), allowance (metered this period) or rate
    limit, usedThe plan's value and the workspace's use; limit is null for unlimited
    capFor an allowance: hard, or spend_ceiling when the overage ceiling was reached
    resets_atWhen a metered allowance resets
    upgradeThe cheapest plan that would allow it, with a link to Plan & billing. When no public plan would, it points to Enterprise with contact: true.
    can_manage_billingWhether the caller can change the plan
    reasonfrozen_by_plan when the record is read-only after a downgrade

    FEATURE_NOT_IN_PLAN carries feature, plan, upgrade and can_manage_billing the same way. See Editions and limits.

    Pagination

    Most lists page by number with two query parameters:

    ParameterDefaultBounds
    page1A whole number from 1
    per_page20 on most listsAt most 100
    bash
    curl "$PAGEBREAD_API/api/v2/submissions?page=2&per_page=50" \
      -H "Authorization: Bearer $TOKEN"

    The response echoes them in meta.pagination:

    json
    {
      "data": [ … ],
      "meta": { "pagination": { "page": 2, "per_page": 50 } }
    }

    Some lists add a total to meta.pagination (total_count and total_pages, or total on the submissions list); others don't. When a list has no total, keep fetching the next page until it returns fewer items than per_page.

    Note

    A few lists use their own defaults: the updates list defaults to 50 and impact projection results to 25, both up to 100. The API reference gives each list's parameters.

    Messages: a cursor

    The messages on an application page backwards from the newest with a cursor instead:

    • limit: how many to return, at most 200.
    • before: the value of meta.next_before from the previous page.

    The response's meta.has_more says whether older messages remain. A before that wasn't returned by the endpoint answers 400 INVALID_CURSOR.