Errors
Petrominds uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error with the provided information. Codes in the 5xx range indicate a server error.
HTTP Status Codes
| Code | Status | Description |
|---|---|---|
200 | OK | Request succeeded |
400 | Bad Request | Unable to compute results with provided parameters |
401 | Unauthorized | API key is missing or invalid |
403 | Forbidden | Access denied |
422 | Unprocessable Entity | The request body failed validation |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Something went wrong on our end |
Error Response Format
All errors return a JSON object with the following attributes:
message string
A human-readable message providing details about the error.
errorCode string
A short string indicating the error type. Useful for programmatic handling.
errors object or null
For validation errors, contains field-specific error messages. The keys are field names and values are arrays of error messages. For other error types, this field is null.
Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
CALCULATION_ERROR | 400 | Unable to compute results with the provided parameters |
INVALID_API_KEY | 401 | API key is invalid, expired, or suspended |
UNAUTHORIZED | 401 | API key is missing from the request |
FORBIDDEN | 403 | Access denied |
VALIDATION_ERROR | 422 | Request parameters failed validation rules |
RATE_LIMIT_EXCEEDED | 429 | Too many requests in a given time period |
ERROR | 500 | General server error |
Examples
Missing API Key
{
"message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to this API",
"errorCode": "UNAUTHORIZED",
"errors": null
}
Invalid API Key
{
"message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription",
"errorCode": "INVALID_API_KEY",
"errors": null
}
Forbidden
{
"message": "Access denied",
"errorCode": "FORBIDDEN",
"errors": null
}
Rate Limit Exceeded
{
"message": "Rate limit exceeded",
"errorCode": "RATE_LIMIT_EXCEEDED",
"errors": null
}
Validation Error
{
"message": "One or more validation errors occurred",
"errorCode": "VALIDATION_ERROR",
"errors": {
"Tr": ["Reservoir Temperature must be greater than 0"],
"Pb": ["Bubble Point Pressure is required"]
}
}
Calculation Error
{
"message": "Unable to perform calculation with provided parameters",
"errorCode": "CALCULATION_ERROR",
"errors": null
}