Data API
Errors
Error response format and HTTP status codes for the Parcel Data API.
Data API errors use one of two JSON shapes, depending on where the error is raised.
Handler errors (authentication, plan and permission, not found, rate limiting, a missing workspace_id, an invalid search_after cursor, an unknown include key) use a consistent envelope:
{ "error": { "code": "<string>", "message": "<string>" }}code is a machine-readable identifier; message is a human-readable description.
Request-body validation errors (a malformed body, a value that fails schema validation such as limit over 100, an unknown filter or sort key, or an out-of-vocabulary value on an enum field) are caught by the schema validator before the handler runs. They return 400 with a different shape:
{ "success": false, "error": { "issues": [ { "code": "unrecognized_keys", "keys": ["bogus_key"], "path": ["filters"], "message": "Unrecognized key(s) in object: 'bogus_key'" } ], "name": "ZodError" }}An out-of-vocabulary value on an enum-backed filter (for example stage,
primary_use, signal_type, account_type, or role) fails validation with a
single clean issue naming the allowed values. Because a filter value may be a
single value or an array, the issue code is invalid_union, but the message
is the clean, actionable one (the same for a bad scalar and a bad array element):
{ "success": false, "error": { "issues": [ { "code": "invalid_union", "path": ["filters", "stage", "value"], "message": "Invalid value for this field. Provide one of the allowed values, or an array of them: pre_filing, filed, under_review, approved, permitted, under_construction, completed." } ], "name": "ZodError" }}Enum fields are matched exactly, so they do not accept exact_match; passing it
on an enum filter is also a 400.
When handling errors, check the HTTP status first, then branch on error.code (envelope) or error.issues (validation).
Status code reference
| Status | Code | When it occurs |
|---|---|---|
400 | bad_request (handler) or a ZodError (body validation) | A malformed body or a value that fails schema validation (e.g. limit over 100, an unknown filter or sort key, an out-of-vocabulary enum filter value) use the validation shape. An invalid search_after cursor, an unknown include key, or a missing workspace_id use the envelope. |
401 | unauthorized | Missing or invalid Authorization: Bearer token. |
402 | INSUFFICIENT_CREDITS or SPEND_LIMIT_EXCEEDED | The page holds new records the workspace cannot pay for. Nothing is returned or charged. |
403 | forbidden | API key is not permitted for this resource. |
404 | not_found | Record ID not found (GET by ID), or unknown route. |
429 | rate_limited | The key, or the workspace across all its keys and MCP clients, has made too many requests this minute. |
400 Bad request
Handler-level 400s use the envelope with code bad_request (an invalid search_after cursor, an unknown include key, or a missing workspace_id on a user-token request):
{ "error": { "code": "bad_request", "message": "workspace_id is required for user tokens." }}Request-body schema failures (a malformed body, limit over 100, an unknown filter or sort key, or an out-of-vocabulary value on an enum-backed filter) instead return the ZodError validation shape shown at the top of this page.
401 Unauthorized
{ "error": { "code": "unauthorized", "message": "Missing bearer token" }}If you are using a Supabase user JWT (e.g. via the MCP server), include ?workspace_id=<uuid> on every request. Omitting it returns a 400 bad_request (not a 401): the token is valid, but the request is missing required attribution.
402 Payment required
A page holds records your workspace has not taken out in the last 30 days, and its credits (or its spend limit) cannot cover them. Nothing is returned and nothing is charged.
{ "error": { "code": "INSUFFICIENT_CREDITS", "message": "This page needs 6 credits and the workspace cannot cover it. Nothing was charged. Ask for fewer records, or add credits.", "needed_credits": 6 }}Ask for a smaller page, or add credits in Settings → Usage. See Credits.
403 Forbidden
An API key that has been restricted or revoked returns 403 with code forbidden.
429 Rate limited
Returned when an API key passes 100 requests a minute, or a workspace passes its plan’s limit across all its keys and MCP clients (Free 100, Starter 300, Pro 1,000 a minute). See Rate limits.
{ "error": { "code": "rate_limited", "message": "Workspace rate limit exceeded. Retry after 60 seconds." }}The response includes a Retry-After: 60 header.
GET /data/usage returns your monthly credits, your balance and the records inside their 30 days. It costs nothing and is never rate limited, so a throttled workspace can always check where it stands.
curl https://api.parcelengineering.com/api/v1/data/usage \ -H "Authorization: Bearer pcl_your_api_key"Response fields: plan, monthly_credits, balance, records_unlocked, by_tool.
404 Not found
{ "error": { "code": "not_found", "message": "Project not found" }}On GET /data/{dataset}/{id}, a 404 means no record with that UUID exists. The Data API serves a global index and uses workspace_id only for usage attribution, so 404 is not workspace-scoped.