Errors

This guide will explain what to do if something goes wrong while you are working with the API. Mistakes happen, and they will mostly be yours, not ours. Let's take a look at some of the status codes and error types that you might come across.

You can check the status code in an API response to see if your request was successful. If the response is unsuccessful, you can use the error type and error message to identify the problem and perform basic debugging before contacting support.


Status codes

Here is a list of the different categories of status codes returned by the Depfloy API. Use these to understand if a request was successful.

  • Name
    2xx
    Description

    A 2xx status code indicates a successful response.

  • Name
    4xx
    Description

    A 4xx status code indicates a client error.

  • Name
    5xx
    Description

    A 5xx status code indicates a server error.


Error types

Whenever a request is unsuccessful, the Depfloy API will return an error response with a message. You can use this information to understand what has gone wrong and how to fix it. Most of the error messages are pretty helpful and actionable.

Here is an example of an error response. You can use this to understand what has gone wrong and how to fix it.

Error response

{
  "status": "error",
  "message": "No way this is happening!?",
}

Was this page helpful?