Errors
How the Pipory public API reports errors, every status code it returns and the codes your integration should branch on.
Errors come back as JSON with a single detail key. Its value is one of three shapes:
- An object with a
codefor errors your code should handle (auth, scopes, plan, rate limit). Branch oncode, showmessage. - A string for not-found and bad-request errors.
- A list for request validation errors (
422). A few422checks on Results answer with a message string instead.
{
"detail": {
"code": "insufficient_scope",
"message": "This key cannot do that (collections.manage). It needs the 'write' scope and a creator whose role allows it."
}
}
Status codes
| Status | detail.code | When |
|---|---|---|
400 | none | The request was understood but cannot be done. detail is a message string. |
401 | invalid_api_key | No Authorization header, or the key is unknown, revoked or expired, its workspace no longer exists, or its creator left the workspace or lost access. |
403 | insufficient_scope | The key lacks the scope, or its creator's role does not allow the action. |
403 | upgrade_required | The workspace is not on a paid plan. |
404 | none | The id does not exist in this workspace. An id from another workspace looks the same. |
422 | none | A parameter is missing, has the wrong type or is out of range. detail is a list (or a string for the Results checks). |
429 | rate_limited | The key went over its requests-per-minute limit. |
401 invalid_api_key
The response also carries WWW-Authenticate: Bearer. The message says which check failed, for example:
{
"detail": {
"code": "invalid_api_key",
"message": "The person who created this key is no longer in this workspace."
}
}
Other messages: "Send Authorization: Bearer pip_...", "Invalid or revoked API key.", "This API key has expired.", "This API key's workspace no longer exists.", "The person who created this key no longer has access." Create a new key to recover.
403 insufficient_scope
The key was valid but cannot do this action. The message names the capability and the scope it needs (read or write). Either add the scope by creating a new key, or ask an Admin to change the creator's role.
403 upgrade_required
{
"detail": {
"code": "upgrade_required",
"resource": "api",
"plan": "trial",
"limit": 0,
"current": null,
"message": "The Pipory API, MCP server and webhooks are included on every paid plan. Choose a plan to use them."
}
}
plan is the workspace's current plan key. Choose a paid plan in Settings > Billing and retry.
404 not found
{ "detail": "No asset 6f1d3c2a-9b8e-4c7d-a1f0-2e3b4c5d6e7f in this workspace." }
422 validation
Standard FastAPI validation errors: one entry per problem, with loc pointing at the parameter.
{
"detail": [
{
"type": "less_than_equal",
"loc": ["query", "limit"],
"msg": "Input should be less than or equal to 100",
"input": "500",
"ctx": { "le": 100 }
}
]
}
429 rate_limited
{
"detail": {
"code": "rate_limited",
"message": "This key is limited to 120 requests a minute.",
"retry_after": 37
}
}
Wait Retry-After seconds, then retry. See Rate limits.