logo image

Hasab

API Responses

Learn about Hasab API success responses, error codes, and how to handle them.

API Responses & Error Codes

Hasab API returns consistent responses for both successful requests and errors.
Use the following reference to understand what each status code means and how to handle it.

✅ Success Codes

CodeMessageDescription
200 OKRequest SuccessfulThe request was completed successfully and the response contains the requested data.
201 CreatedResource CreatedA new resource (e.g., uploaded file or transcription job) was created successfully.
202 AcceptedProcessingThe request has been accepted for processing but is not completed yet.

⚠️ Error Codes

CodeErrorDescription
400 Bad RequestInvalid RequestThe request was malformed or missing required parameters. Review input fields.
401 UnauthorizedAuthentication FailedMissing or invalid API key. Ensure the Authorization header is set correctly.
403 ForbiddenAccess DeniedYou don’t have permission to access this resource. Contact support if unexpected.
404 Not FoundResource MissingThe requested resource could not be found (e.g., invalid file ID).
429 Too Many RequestsRate LimitedYou’ve exceeded the API rate limit. Retry after the time specified in response headers.
500 Internal Server ErrorServer ErrorSomething went wrong on Hasab’s side. Retry later or contact support.
503 Service UnavailableService DownThe API is temporarily unavailable (e.g., maintenance). Try again later.

Example Error Response

When an error occurs, the API returns a JSON object with a clear message:

{
  "status": "error",
  "code": 401,
  "message": "Invalid or missing API key"
}