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
| Code | Message | Description |
|---|---|---|
| 200 OK | Request Successful | The request was completed successfully and the response contains the requested data. |
| 201 Created | Resource Created | A new resource (e.g., uploaded file or transcription job) was created successfully. |
| 202 Accepted | Processing | The request has been accepted for processing but is not completed yet. |
⚠️ Error Codes
| Code | Error | Description |
|---|---|---|
| 400 Bad Request | Invalid Request | The request was malformed or missing required parameters. Review input fields. |
| 401 Unauthorized | Authentication Failed | Missing or invalid API key. Ensure the Authorization header is set correctly. |
| 403 Forbidden | Access Denied | You don’t have permission to access this resource. Contact support if unexpected. |
| 404 Not Found | Resource Missing | The requested resource could not be found (e.g., invalid file ID). |
| 429 Too Many Requests | Rate Limited | You’ve exceeded the API rate limit. Retry after the time specified in response headers. |
| 500 Internal Server Error | Server Error | Something went wrong on Hasab’s side. Retry later or contact support. |
| 503 Service Unavailable | Service Down | The 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"
}