Errors
The Licentric API uses standard HTTP status codes and returns a consistent error response format for all error conditions.
Error Response Format
All error responses share the same JSON envelope: a human-readable message in error, a machine-readable code you can branch on, optional structured details (Zod issues, rate-limit metadata, etc.), and a requestId you can quote when filing a support ticket. The HTTP status itself is on the response, not the body.
Error Response (envelope)
{
"error": "Human-readable description of the error",
"code": "ERROR_CODE",
"details": { "issues": [{ "path": ["productId"], "message": "Required", "code": "invalid_type" }] },
"requestId": "01J8X3W4Y5Z6A7B8C9D0EFGHJK"
}Example Errors
Validation Error
400Invalid request body
json
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"issues": [
{ "path": ["productId"], "message": "Required", "code": "invalid_type" }
]
}
}Authentication Error
401Missing or invalid credentials
json
{
"error": "Invalid or expired API key",
"code": "UNAUTHORIZED"
}Conflict Error
409Invalid state transition
json
{
"error": "Cannot suspend a revoked license",
"code": "CONFLICT"
}HTTP Status Codes
| Status | Title | Description |
|---|---|---|
| 400 | Bad Request | The request body failed validation. Check the error message for details on which fields are invalid. |
| 401 | Unauthorized | Missing or invalid authentication credentials. Verify your API key or license key. |
| 403 | Forbidden | The authenticated key lacks the required scopes for this operation. |
| 404 | Not Found | The requested resource does not exist or has been soft-deleted. |
| 409 | Conflict | Invalid state transition. For example, attempting to suspend an already-revoked license. |
| 422 | Unprocessable Entity | The request is syntactically valid but violates a business rule, such as exceeding machine limits. |
| 429 | Too Many Requests | Rate limit exceeded. Check the Retry-After header for when to retry. |
| 500 | Internal Server Error | An unexpected error occurred. If this persists, contact support. |