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:
| Field | Always present | What it holds |
|---|---|---|
status | Yes | The HTTP status, as a string |
code | Yes | A stable, machine-readable code such as NOT_FOUND. Act on this, not on the wording. |
title | Yes | A short sentence for people |
detail | No | More explanation, or the reason a field was refused |
source.pointer | No | Which part of the request was wrong, for example /body/policy_id or /query/from |
source.parameter | No | Which query parameter was wrong |
meta | No | Machine-readable context, for example a plan limit and its upgrade hint |
{
"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
| Code | Status | Meaning |
|---|---|---|
MALFORMED_JSON | 400 | The body isn't valid JSON. |
VALIDATION_ERROR | 400 or 422 | The body, path or query doesn't match what the route accepts. |
UNAUTHORIZED | 401 | No valid access token. See Authentication. |
MEMBER_UNAUTHENTICATED | 401 | No valid member session. |
PLAN_LIMIT | 402 | A plan limit or allowance is used up. |
FEATURE_NOT_IN_PLAN | 403 | The feature isn't on your plan. |
SUBSCRIPTION_RESTRICTED | 403 | Billing needs attention; nothing new can be created. |
PROFILE_INCOMPLETE | 403 | Complete the workspace profile first. |
WORKSPACE_SUSPENDED | 403 | The workspace is read-only. |
NOT_FOUND | 404 | The record doesn't exist, belongs to another workspace, or your role can't use this route. These three are deliberately indistinguishable. |
WORKSPACE_SETUP_REQUIRED | 409 | The 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_LOCKED | 409 | The application has already been sent and can't be changed by the applicant. |
FORM_PAUSED | 409 | The form isn't taking new applications right now. |
SELF_APPROVAL_REFUSED | 409 | You can't approve your own proposal while another approver can. |
REQUEST_TOO_LARGE | 413 | The body or file is too big. |
RATE_LIMITED | 429 | Too many requests; wait for Retry-After. See Rate limits. |
INTERNAL_ERROR | 500 | Something failed on Pagebread's side. Retry later, and quote the x-request-id header if you contact support. |
READ_ONLY_CONSOLE | 503 | Pagebread is in maintenance; reads still work. |
AUTH_UNAVAILABLE | 503 | The sign-in couldn't be checked right now, including when the identity provider is rate-limiting; wait for Retry-After. |
ORGANIZATION_UNAVAILABLE | 503 | Your workspace couldn't be loaded right now; wait for Retry-After. |
UPLOADS_BUSY | 503 | Too many uploads in progress; wait for Retry-After. |
SUBMIT_UNAVAILABLE | 503 | An 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:
{
"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
}
}| Field | Meaning |
|---|---|
limit_key | Which limit or allowance |
kind | count (things you have), allowance (metered this period) or rate |
limit, used | The plan's value and the workspace's use; limit is null for unlimited |
cap | For an allowance: hard, or spend_ceiling when the overage ceiling was reached |
resets_at | When a metered allowance resets |
upgrade | The 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_billing | Whether the caller can change the plan |
reason | frozen_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:
| Parameter | Default | Bounds |
|---|---|---|
page | 1 | A whole number from 1 |
per_page | 20 on most lists | At most 100 |
curl "$PAGEBREAD_API/api/v2/submissions?page=2&per_page=50" \
-H "Authorization: Bearer $TOKEN"The response echoes them in meta.pagination:
{
"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 ofmeta.next_beforefrom 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.