Response Format
All Xenia API responses follow a consistent format:Success Response
Error Response
HTTP Status Codes
| Code | Status | Description |
|---|---|---|
200 | OK | Request successful |
201 | Created | Resource created successfully |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Missing or invalid authentication |
403 | Forbidden | Insufficient permissions |
404 | Not Found | Resource does not exist |
409 | Conflict | Resource already exists |
422 | Unprocessable Entity | Validation failed |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server-side error |
Common Errors & Solutions
401 Unauthorized
Error:- Missing
x-client-keyorx-client-secretheaders - Invalid or expired credentials
- API access not enabled for workspace
- Verify your API credentials are correct
- Check that credentials haven’t been revoked
- Ensure
workspace-idheader is included - Confirm API access is enabled for your workspace
403 Forbidden
Error:- API user lacks required permission
- Resource is not accessible to this user
- Feature not enabled for workspace
- Check the API user’s role and permissions
- Verify the resource belongs to your workspace
- Contact admin to grant necessary permissions
404 Not Found
Error:- Invalid resource ID (UUID)
- Resource has been deleted
- Resource belongs to a different workspace
- Verify the resource ID is correct
- Check that the resource still exists
- Ensure you’re using the correct workspace
400 Bad Request
Error:- Missing required fields
- Invalid field format (e.g., invalid UUID, email)
- Invalid JSON syntax
- Review the API documentation for required fields
- Validate data formats before sending
- Check JSON syntax is valid
422 Unprocessable Entity
Error:- Business logic validation failed
- Invalid relationships between fields
- Constraint violations
- Review validation error details
- Ensure data meets business rules
- Check relationships between fields
429 Too Many Requests
Error:- Too many requests in a short period
- Exceeding API rate limits
- Implement exponential backoff
- Cache responses where possible
- Batch operations when available
500 Internal Server Error
Error:- Server-side issue
- Unexpected error condition
- Retry the request after a brief delay
- If persistent, contact support with the
requestId
Best Practices
1. Always Check Status
2. Validate UUIDs
Before making requests, validate that IDs are valid UUIDs:3. Handle Network Errors
4. Log Request IDs
Always log therequestId from responses for debugging:
Debugging Tips
Check request headers
Check request headers
Ensure all required headers are present:
x-client-keyx-client-secretworkspace-idContent-Type: application/json
Verify JSON payload
Verify JSON payload
Use a JSON validator to ensure your request body is valid JSON.
Common issues:
- Trailing commas
- Unquoted strings
- Invalid escape characters
Test with cURL first
Test with cURL first
Before implementing in code, test requests with cURL to isolate issues:
Check API status
Check API status
If experiencing widespread issues, check Xenia’s system status or contact support.
Getting Help
If you encounter persistent errors:-
Gather Information:
- Request ID (
requestId) - Full error message
- Request endpoint and method
- Request payload (without sensitive data)
- Request ID (
-
Contact Support:
- Email: [email protected]
- Include all gathered information