Every failure raised by the SDK is an instance of PoliPageError with a code. SDK-internal codes are lowercase; codes from the API are uppercase.
| Code | When |
invalid_options | Constructor arguments are missing or malformed. |
network_error | TCP/TLS-level failure reaching the API. Retryable. |
timeout | The request did not complete within `timeout`. Retryable. |
DOWNLOAD_FAILED | The S3 second-hop download failed. Not retried by the SDK. |
| Code | When |
MISSING_API_KEY | No API key in the request. |
INVALID_API_KEY | The API key is malformed or revoked. |
| Code | When |
PAYMENT_REQUIRED | Organization billing is past due. |
FORBIDDEN | The key does not have access to the requested resource. |
ORGANIZATION_CANCELLED | The organization has been cancelled. |
ORGANIZATION_PURGED | The organization has been purged. |
| Code | When |
NOT_FOUND | The project/template slug does not exist or is not published. |
VERSION_NOT_FOUND | The pinned version does not exist for this template. |
DOCUMENT_NOT_FOUND | No stored document matches the supplied id. |
GONE | The resource existed but has been deleted. |
| Code | When |
VALIDATION_ERROR | `data` does not satisfy the template schema. |
MISSING_DATA | Request body lacks the required `data` field. |
MISSING_PROJECT_OR_TEMPLATE | Project mode call without both `project` and `template`. |
MISSING_TEMPLATE_SLUG | Template slug is missing. |
PROJECT_REQUIRED_FOR_DOCUMENT | Inline-shaped input on a PDF-producing method. Rejected locally before any HTTP call. |
INVALID_VERSION_FORMAT | The `version` string is not a valid semver. |
VERSION_REQUIRED | Live keys require a pinned `version`. |
INVALID_VERSION_FOR_KEY_ENV | Sandbox key targeting a live-only version, or vice versa. |
| Code | When |
QUOTA_EXCEEDED | Per-key rate limit or monthly quota reached. Retryable. |
OVERAGE_CAP_EXCEEDED | Hard overage cap reached. Not retryable. |
| Code | When |
INTERNAL_ERROR | The API returned 5xx. Retryable. |