Introduction

When determining whether or not an API request was successful, the Penzle platform uses the standard HTTP response codes.

Any code in the 2xx range denotes a successful transaction. The 4xx field contains codes that indicate an error that could not be fixed with the provided information (e.g., Bad Request, Not Found, Unauthorized, Forbbiden).

An error has occurred with the Penzle backend system if the code is in the 5xx range.

Some of the 4xx faults that can be handled programmatically include an error code that provides a condensed explanation of the error that was reported (for example, "bad request" or "not found").

List of expected error codes

HTTP error code Description
200 - OK The request was successful. The definition of "success" varies based on the HTTP method. The resource has been retrieved and transferred as the body of the message. PUT or POST: The resource describing the action's outcome is transmitted in the body of the message.
201 - Created The request was successful, resulting in the creation of a new resource.
204 - No Content There is no content to send for this request, but the request has been completed successfully, most typically for resource updates using the PUT, PATCH, or DELETE HTTP verbs.
400 - Bad Request The request was denied, typically due to missing a needed parameter.
401 - Unauthorize The authorization header is missing, or an invalid API key is provided.
403 - Forbidden The API key does not authorize the request. There is a possibility that the project or environment are not provided correctly.
404 - Not Found The requested resource cannot be found by the Penzle server.
>= 500 - Server Errors The server has encountered a situation it does not know how to handle.

References: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status