Status codes
| Status | Meaning | What to do |
|---|---|---|
| 400 | The request is not valid. For example, a file type is not supported. | Read detail and correct the request. |
| 401 | The token is missing, expired or not valid. | Get a new token and send it again. |
| 402 | A Gateway budget is used up. | Wait for the budget to reset, or ask your administrator. |
| 403 | Your role cannot do this action, or a policy blocked the content. | Ask your administrator for the role, or change the content. |
| 404 | The item does not exist, or it belongs to another tenant. | Check the identifier. |
| 409 | The action conflicts with the state of the item. For example, a tender no longer accepts bids. | Read detail. Get the item again and check its state. |
| 422 | One or more fields are not valid. | Correct the fields listed in detail. |
| 429 | A rate limit is reached. | Wait and send the request again. |
| 500 | The product had an internal error. | Try again. If it continues, contact Anar support with the time of the request. |
| 502, 503 | A service that the product needs did not answer. For example, the model provider or Guard. | Try again later. |
Validation errors
A 422 response lists each field in error:
{
"detail": [
{
"loc": ["body", "title"],
"msg": "String should have at least 1 character",
"type": "string_too_short"
}
]
}
Role errors
A 403 response for a missing role names the roles that can do the action:
{"detail": "Role 'user' not authorized. Requires: admin, manager"}
Gateway errors
The Gateway uses its own error format. Read Gateway API reference.