API REFERENCE

ZPL API Error Codes

All HTTP status codes returned by the ZPL API — with causes, fixes, and example responses. Last updated April 2026.

2xx Success 400 Bad Request 401 Unauthorized 402 Payment Required 403 Forbidden 404 Not Found 422 Validation Error 429 Rate Limited 500 Server Error 503 Service Unavailable
2xx Success
200 OK

Request succeeded. The response body contains the computation result, resource data, or confirmation message.

Example response (/compute)
{ "p_output": 0.514286, "deviation_from_0_5": 0.014286, "N": 9, "samples": 100, "bias": 0.5, "status": "STABLE" }
201 Created

A new resource was created successfully. Returned by POST /auth/register, POST /keys/create, POST /newsletter/subscribe, etc.

4xx Client Errors
400 Bad Request

The request was malformed or contained invalid parameters.

Common causes
N parameter out of valid range (must be 3–64 depending on plan)
Missing required fields in request body (email, password, etc.)
Invalid bias value — must be 0.0 to 1.0
Email already registered (on /auth/register)
Fix

Validate your request parameters. Check the API Reference for parameter constraints.

Example response
{ "detail": "N must be between 3 and 64" }
401 Unauthorized

Authentication failed. Either no credentials were provided or they are invalid.

Common causes
Missing Authorization: Bearer <token> header
Missing X-Api-Key: zpl_xxxx... header
JWT token expired (tokens expire after 7 days)
Invalid or revoked API key
Wrong email/password on /auth/login
OAuth token audience mismatch (Google/GitHub)
Fix

Re-login to get a fresh JWT token. For API key issues, check your Dashboard to verify the key is active. Include the header: X-Api-Key: zpl_yourkey or Authorization: Bearer <token>

Example response
{ "detail": "Invalid or expired token" }
402 Payment Required

Your account has exceeded its monthly quota for this endpoint. This is the primary billing-related error in the ZPL API.

Common causes
Monthly /compute call limit reached (Free: 1,000 / Basic: 15,000 / Pro: 35,000 etc.)
Monthly /sweep call limit reached
Monthly AI call limit reached (/ai/chat)
Fix — 3 options

1. Wait: limits reset on the 1st of the next calendar month.
2. Top-up: purchase extra calls from our Top-ups section (€4.99–€299.99).
3. Upgrade plan: switch to a higher tier for permanently larger monthly limits.

Example response
{ "detail": "Monthly rate limit exceeded. Upgrade your plan or purchase a top-up." }
403 Forbidden

The request is valid but not permitted for your account's plan or role.

Common causes
N value exceeds your plan's max_N limit (e.g., N=32 on Free plan which allows max N=9)
Accessing an admin-only endpoint without admin role
API key scope restriction (e.g., read-only key trying to create resources)
Accessing a feature restricted to Pro or higher plan
Account banned or deactivated
Fix

Check your plan's limits on the Pricing page. Upgrade to use larger N values or premium features. For scope issues, create a new API key with the required scope.

Example response
{ "detail": "N=32 exceeds your plan limit (max N=9). Upgrade to use larger matrices." }
404 Not Found

The requested resource does not exist.

Common causes
Wrong endpoint path (typo)
Resource ID (user_id, key_id) does not exist or was deleted
Accessing a deprecated endpoint that has been removed
Fix

Double-check the endpoint path in the API Reference. Verify that the resource ID exists in your Dashboard.

422 Unprocessable Entity (Validation Error)

The request body was syntactically valid JSON but failed semantic validation (Pydantic model validation).

Common causes
Wrong data types (string where int is expected, etc.)
Missing required fields in request body
Password too short (minimum 8 characters)
Invalid email format
Fix

Check the detail array in the response — it contains specific field-level error messages from Pydantic.

Example response
{ "detail": [{ "loc": ["body", "N"], "msg": "value is not a valid integer", "type": "type_error.integer" }] }
429 Too Many Requests

You have exceeded a short-term rate limit (distinct from the 402 monthly quota limit).

Common causes
Auth endpoints: 10 login attempts per 15 minutes per IP
Newsletter subscribe: 5 requests per hour per IP
Contact form: 3 messages per 24 hours per IP
Public demo /compute: 3 calls per 24 hours per IP (no API key)
Fix

Wait for the rate limit window to expire. For auth failures, check your credentials carefully before retrying. For API calls requiring no rate limits, use an API key.

Example response
{ "detail": "Too many login attempts. Try again in 15 minutes." }
5xx Server Errors
500 Internal Server Error

An unexpected error occurred on the server side. This is not caused by your request.

Common causes
ZPL engine computation error (rare — engine has built-in error handling)
Database connection issue
Unhandled exception in backend logic
Fix

Retry the request after a few seconds. If the error persists, check our System Status page and contact support with your request details.

Example response
{ "detail": "ZPL computation error: ..." }
501 Not Implemented

The feature exists in the API but is not configured on this deployment.

Common causes
GitHub OAuth requested but GITHUB_CLIENT_ID not configured
Feature flagged as not yet available
Fix

Check the Status page to see which features are enabled. Use an alternative authentication method.

503 Service Unavailable

The server is temporarily unavailable. Usually happens during deployment or after the free-tier cold start.

Common causes
Cold start (most common): The Render free tier sleeps after 15 minutes of inactivity. The first request after sleep takes ~30 seconds to respond.
Scheduled maintenance deployment
Database temporarily unreachable
Fix

Wait 30–60 seconds and retry. For production workloads, use an API key with a plan that keeps the server warm. Check system status for ongoing incidents.

Special ZPL-Specific Errors
402 Monthly Quota Reset

The monthly quota resets automatically on the 1st of each calendar month at midnight UTC. Your counter goes back to zero and all requests are permitted again (until the new month's limit is reached).

Check your current usage

Log in to your Dashboard to see current month usage, quota, and days until reset.

403 API Key Scope Restriction

When you create an API key, you assign it a scope: full, compute, ai, or read-only. Using a key for an endpoint outside its scope returns 403.

Scope permissions
"full":      all endpoints
"compute":   /compute, /sweep only
"ai":        /ai/* only
"read-only": GET requests only
Fix

Create a new API key with the correct scope for your use case in the Dashboard.