Skip to main content

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

CodeStatusDescription
200OKRequest succeeded
400Bad RequestUnable to compute results with provided parameters
401UnauthorizedAPI key is missing or invalid
403ForbiddenAccess denied
422Unprocessable EntityThe request body failed validation
429Too Many RequestsRate limit exceeded
500Internal Server ErrorSomething 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 CodeHTTP StatusDescription
CALCULATION_ERROR400Unable to compute results with the provided parameters
INVALID_API_KEY401API key is invalid, expired, or suspended
UNAUTHORIZED401API key is missing from the request
FORBIDDEN403Access denied
VALIDATION_ERROR422Request parameters failed validation rules
RATE_LIMIT_EXCEEDED429Too many requests in a given time period
ERROR500General 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
}