API Reference
Error Handling
Standard error codes, rate limit headers, and troubleshooting.
Error Handling
All error responses follow a consistent format with an error code and human-readable message:
{
"error": {
"code": "ERROR_CODE",
"message": "Description of what went wrong"
}
}Error Codes
| HTTP Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid or missing request parameters |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 402 | PAYMENT_REQUIRED | Insufficient credits |
| 403 | FORBIDDEN | API access requires Business plan, or action not permitted |
| 403 | LIMIT_EXCEEDED | Plan limits reached (projects, builds, etc.) |
| 404 | NOT_FOUND | Resource not found or not accessible |
| 409 | CONFLICT | Resource conflict (deployment in progress, domain taken, etc.) |
| 429 | RATE_LIMITED | Too many requests — check rate limit headers |
| 500 | INTERNAL_ERROR | Server error — please retry or contact support |
Rate Limit Headers
Every response includes these headers:
X-RateLimit-Remaining— Number of requests remaining in the current windowX-RateLimit-Reset— Seconds until the rate limit window resets
When you receive a 429 response, wait for the number of seconds indicated by X-RateLimit-Reset before retrying.
Credit Costs
API actions that consume credits:
| Action | Credits |
|---|---|
| Create project (initial build) | 5 |
| Refinement | 1 |
| Code edit | 1 |
| Redeploy | 1 |
| Rollback | 1 |
| Clone | 2 |
| Reactivate | 1 |
Administrators are exempt from credit charges.
Troubleshooting
- 401 Unauthorized — Check that your API key starts with
flp_and is included as a Bearer token - 403 Forbidden — Verify your account has an active Business subscription
- 409 Conflict on deploy — Wait for the current deployment to complete, or cancel it first
- Subdomain errors — Subdomains must be lowercase, 3-63 characters, and contain only letters, numbers, and hyphens