Errors
All error responses follow the same envelope shape:
{
"success": false,
"message": "Human-readable error description",
"error": "ERROR_CODE"
}Common error codes
| Code | HTTP | Meaning |
|---|---|---|
| API_KEY_MISSING | 401 | X-API-Key header was not provided. |
| INVALID_API_KEY | 401 | API key is invalid or has been revoked. |
| TOKEN_EXPIRED | 401 | Your JWT token has expired — re-authenticate. |
| VALIDATION_ERROR | 400 | Missing or invalid fields in your request. |
| COMPANY_NOT_FOUND | 400 | You must register a company before creating campaigns. |
| CAMPAIGN_NOT_FOUND | 404 | The post_id does not match any campaign. |
| ACCESS_DENIED | 403 | You can only modify campaigns you created. |
| FEEDBACK_NOT_ENABLED | 400 | Cannot add questions to an ad with has_feedback=false. |
| COHORT_REWARDS_NOT_ENABLED | 400 | Cohort rewards are not enabled for this campaign. |
| IMAGE_UPLOAD_FAILED | 400 | Failed to upload image to CDN. |
| SERVER_ERROR | 500 | Unexpected server error — contact support. |