Errors & Troubleshooting
When something goes wrong, the FairePlace API returns structured error responses with enough detail to diagnose and fix the issue.
Error response format
Every error follows this structure:
Code
| Field | Description |
|---|---|
error.code | HTTP status code |
error.type | Machine-readable error type (e.g., VALIDATION_ERROR, NOT_FOUND) |
error.message | Human-readable description |
error.details | Additional context (field names, constraints, etc.) |
meta.request_id | Unique request identifier — include this when contacting support |
meta.timestamp | When the error occurred |
HTTP status codes
| Code | Type | When it happens |
|---|---|---|
| 400 | Bad Request | Malformed JSON, invalid UUID format, missing required fields |
| 401 | Unauthorized | Missing, expired, or malformed JWT token |
| 403 | Forbidden | Valid token but insufficient permissions |
| 404 | Not Found | Resource doesn't exist or belongs to another tenant |
| 409 | Conflict | Cannot delete resource with dependencies (e.g., place with estates) |
| 422 | Unprocessable Entity | Valid JSON but business rule violation (e.g., rent exceeds cap) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Unexpected server error — contact support with request_id |
Common errors and fixes
400 — Invalid UUID format
Code
Fix: Use a valid UUID v4 format: 550e8400-e29b-41d4-a716-446655440000.
400 — Missing required field
Code
Fix: Check the API module documentation for required fields.
401 — Token expired
Code
Fix: Re-authenticate with POST /auth/login and use the new token.
403 — Permission denied
Code
Fix: Your token is missing the required permission. See Authentication for the full permissions table.
404 — Resource not found
Code
Common causes:
- The UUID is wrong or has a typo
- The resource belongs to a different tenant (cross-tenant access returns 404, not 403)
- The resource was deleted
409 — Dependency conflict
Code
Fix: Remove dependent resources first. For example, delete all estates in a place before deleting the place itself.
422 — Rent cap violation
Code
Fix: The rent per square meter exceeds the reference rent (loyer de reference majore) for the property's legislative zone. Lower the rent amount or check if a rent complement (complement de loyer) applies.
422 — Deposit limit exceeded
Code
Fix: French law limits the security deposit to 1 month's rent (excluding charges) for unfurnished leases, and 2 months for furnished leases.
429 — Rate limit exceeded
Code
Fix: Wait until the rate limit resets. Check these response headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per hour (1,000) |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Retry-After | Seconds to wait before retrying (on 429 responses) |
Retry strategy
For transient errors (429, 500), use exponential backoff:
Code
Do not retry 400, 401, 403, 404, 409, or 422 errors — these require fixing the request.
Debugging checklist
When you get an unexpected error:
- Check the
request_id— Include it when contacting support - Verify your token — Is it expired? Decode it at jwt.io to check
expandpermissions - Check the
tenant_id— Are you targeting the right organization? - Validate UUIDs — Ensure all IDs are valid UUID v4 format
- Review required fields — Check the API module docs for the endpoint you're calling
- Check dependencies — Does the parent resource exist? (e.g., does the
estate_idexist before creating a lease?) - Inspect the full error — The
detailsfield often tells you exactly what to fix