Skip to content
DEVELOPERS

9. Error codes

Error format and the list of codes for both authorization methods.

Errors detected while validating a request are returned in a format compatible with the OpenAI SDK:

JSON
{
  "error": {
    "type": "permission_error",
    "code": "module_not_allowed",
    "message": "The token does not grant access to the module ACADEMIC.",
    "request_id": "6f1c2a9e-4b7d-4e0a-9c55-2d8e1f3b7a10"
  }
}

Fields of the error object:

  • type is the error category: authentication_error (401), permission_error (403), not_found_error (404), invalid_request_error (400, 405, 413), rate_limit_error (429), api_error (5xx);
  • code is the machine-readable error code;
  • message is the description of the error in English;
  • request_id is the request identifier to be stated when contacting the university.

9.1. API token authorization

Checks are performed in the order given in the table; the response is produced by the first failed check.

Error codes for API token authorization
HTTPCODEMEANINGRECOMMENDED ACTION
429too_many_auth_failuresRequests from the IP address are temporarily rejected after 30 failed authorization attempts within 10 minutes.Verify the token value and repeat the request after 15 minutes.
503api_disabledAcceptance of API requests is temporarily suspended.Repeat the request later.
401invalid_api_keyThe token is missing, invalid or revoked.Verify the authorization header; if the token has been revoked, request a new token.
401token_expiredThe token has expired.Contact the university to have a new token issued.
403token_blockedThe token has been blocked by the university administration.Contact the university.
403ip_not_allowedThe request was sent from an IP address that is not permitted for the token.Send requests from a permitted address or request a change to the list of addresses.
404not_foundThe path does not belong to any module or the operation is not supported.Verify the request path.
403module_not_allowedThe module is not included in the token.Contact the university to extend access.
503module_disabledThe module is temporarily disabled.Repeat the request later.
405method_not_allowedA data module accepts only requests made with the GET method. The response contains the Allow: GET header.Use the GET method.
429rate_limit_exceededThe permitted number of requests per minute has been exceeded.Repeat the request after the period specified in the Retry-After header.
400invalid_pathThe request path contains prohibited segments: . and .., or an encoded dot, slash or backslash.Specify the path without dot segments and without encoded separators.
413request_too_largeThe size of the request body exceeds the permitted limit.Reduce the request size to the limits stated in the “Limits and headers” section.
400invalid_jsonThe body of a request to the ALEM module is not a valid JSON object.Send the request body as a JSON object.
400invalid_multipartThe body of an audio transcription request is not a valid multipart/form-data document.Send the file and the parameters as multipart/form-data with the part boundary specified.
400model_requiredThe request to the ALEM module does not specify a model.Specify the model in the model field, selecting it from the GET /os/v1/alem/models response.
404model_not_foundThe model is not in the list of models.Select a model from the GET /os/v1/alem/models response.
403model_not_allowedThe model is not permitted by the token.Use a permitted model or request extended access.
502upstream_auth_errorAn internal authorization failure occurred while accessing the information system or the Alem.Cloud platform.Repeat the request later; if the error persists, report the request identifier to the university.
502upstream_errorThe information system or the Alem.Cloud platform did not respond or completed processing with an error.Repeat the request later with an increasing interval.
503alem_unavailableThe ALEM module is temporarily unavailable.Repeat the request later.
500internal_errorAn internal error occurred while processing the request.Repeat the request later; if the error persists, report the request identifier to the university.

9.2. “Sign in with QAIRU” authorization

With a student access token, the following codes are used instead of invalid_api_key, token_expired, token_blocked, ip_not_allowed and module_not_allowed; the other codes apply unchanged.

Error codes for “Sign in with QAIRU” authorization
HTTPCODEMEANINGRECOMMENDED ACTION
401invalid_tokenThe access token is invalid: its signature failed verification, it has expired, or it was issued to an unregistered application.Refresh the access token with the refresh_token; if the refresh fails, ask the student to sign in again.
401token_revokedThe student has revoked access for the application; tokens issued before the revocation are not accepted.Ask the student to sign in again and confirm access.
403app_disabledThe application has been disabled by the university administration.Contact the university.
403student_onlyThe access token was issued to an account that is not a student account.Sign in with a student account.
403scope_not_grantedThe module scope has not been granted by the student, is not permitted for the application, or the module is disabled.Request the module scope at sign-in or contact the university to extend the list of modules of the application.

Errors that occur in the information system itself while processing a request to a data module, for example 404 for a non-existent record, are passed in the original format of the information system. Authorization server errors are listed in the “Sign in with QAIRU” section.