Errors
Infrahub API uses HTTP response codes to indicate the success or failure of an API request. This guide provides an overview of the error codes that may be returned from API requests and solutions to help resolve each error type.
In this article
HTTP status codes in the 2xx
range indicate that the request was successful.
HTTP status codes in the 4xx
range indicate an error relating to the information provided in the request.
HTTP status codes in the 5xx
range indicate an error with Infrahub's servers. These errors are rare.
API errors
Code | Error Cause | Solution |
---|---|---|
400 - Bad Request | The format request was invalid. | Check to ensure that the format of the request follows that of the example request provided in the documentation for the endpoint being called. This is often a syntax error. To avoid this error, we recommend copying the example request. |
401 - Unauthorized | No valid API key provided | Generate a new API key to include as an authorization header. |
403 - Forbidden | Access is denied. | Ensure that you have the necessary permissions for the resource being requested. |
404 - Not Found | Requested resource does not exist. | Ensure that you have specified the appropriate resource name or id in your request. |
405 - Method Not Allowed | Invalid HTTP method. | The request method is not available for the requested resource; for example, a PUT method was used for a request that required data to be presented via GET . Refer to the documentation for the endpoint you are calling, to see which methods are supported. |
406 - Not Acceptable | Requested format not supported. | This is typically caused by query parameters that are not acceptable to the request. Refer to the documentation for the endpoint you are calling, and ensure that the requirements for the query parameters in the request are met. |
409 - Conflict | Resource being created already exists. | The resource being created is identical to an existing resource and does not need to be created. Change the name or the values of other fields within the body of the request, to create a unique resource. |
500 - Internal Server Error | Something went wrong on Infrahub's end. These errors are rare. | Retry your request after a brief wait and contact us at [email protected] if the issue persists. |
Error examples
Attributes
status boolean
The status of the request.
Possible values: true
indicating that the request has been successful, and false
indicating that an error has been returned by the request.
message string
The error response message corresponding to the endpoint that was called.
error_reason string
The error type returned by the request.
Possible values: bad_request
, unauthorized
, forbidden
, not_found
, not_allowed
, not_acceptable
, already_exist
.
Responses
{
"status": false,
"message": "Insufficient balance to create the resource",
"error_reason": "bad_request"
}
{
"status": false,
"message": "Unauthorized",
"error_reason": "unauthorized"
}
{
"status": false,
"message": "Insufficient permission to access this endpoint",
"error_reason": "forbidden"
}
{
"status": false,
"message": "The Environment does not exist.",
"error_reason": "not_found"
}
{
"status": false,
"message": "Disk size can not be less than current disk size",
"error_reason": "not_allowed"
}
{
"status": false,
"message": "Not acceptable query parameter.",
"error_reason": "not_acceptable"
}
{
"status": false,
"message": "Security Group Rule already exists",
"error_reason": "already_exist"
}
{
"message": "Internal Server Error"
}