Skip to main content

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





API errors

CodeError CauseSolution
400 - Bad RequestThe 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 - UnauthorizedNo valid API key providedGenerate a new API key to include as an authorization header.
403 - ForbiddenAccess is denied.Ensure that you have the necessary permissions for the resource being requested.
404 - Not FoundRequested resource does not exist.Ensure that you have specified the appropriate resource name or id in your request.
405 - Method Not AllowedInvalid 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 AcceptableRequested 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 - ConflictResource 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 ErrorSomething 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 code: 400 Bad Request
{
"status": false,
"message": "Insufficient balance to create the resource",
"error_reason": "bad_request"
}
Status code: 401 Unauthorized
{
"status": false,
"message": "Unauthorized",
"error_reason": "unauthorized"
}
Status code: 403 Forbidden
{
"status": false,
"message": "Insufficient permission to access this endpoint",
"error_reason": "forbidden"
}
Status code: 404 Not Found
{
"status": false,
"message": "The Environment does not exist.",
"error_reason": "not_found"
}
Status code: 405 Method Not Allowed
{
"status": false,
"message": "Disk size can not be less than current disk size",
"error_reason": "not_allowed"
}
Status code: 406 Not Acceptable
{
"status": false,
"message": "Not acceptable query parameter.",
"error_reason": "not_acceptable"
}
Status code: 409 Conflict
{
"status": false,
"message": "Security Group Rule already exists",
"error_reason": "already_exist"
}
Status code: 500 Internal Server Error
{
"message": "Internal Server Error"
}

Back to top