Errors#
The Partner API uses standard HTTP status codes. Error responses follow FastAPI's convention:
Status codes#
| Code | Meaning | Example messages |
|---|---|---|
200 |
Success (GET / list / validate). | — |
400 |
Request body failed validation. | Field-level constraint errors. |
401 |
Missing or invalid authentication. | X-API-Key header required, Invalid API key |
404 |
Resource not found or not owned by caller. | Invalid or expired referral code, Referral link not found, API key not found |
409 |
Conflict during trial claim. | Username already taken, Email already registered, A trial has already been claimed with this email |
410 |
Referral link no longer usable. | Referral link has expired, Referral link has reached its usage limit |
429 |
Rate limit exceeded (trial claim). | Returned after 5 claims/hour from one IP. |
500 |
Unexpected server error. | — |
Notes#
GET /partner/referral/{code}/validatenever returns404/410for a bad code — it returns200with{ "valid": false, "trial_duration_days": 0 }instead. The404/410messages above apply toPOST /partner/trial/claim, which validates the code strictly.404on management endpoints (DELETEreferral links / API keys) covers both "does not exist" and "not owned by you" — the API does not distinguish the two.