import {Note} from "@/components/mdx";
export const description =
  'In this guide, we will talk about what happens when something goes wrong while you work with the API.'

# Errors

When working with APIs, it's important to understand the different types of HTTP errors that you might encounter. These errors can help you diagnose issues with your API requests and determine how to resolve them. {{ className: 'lead' }}

You can tell if your request was successful by checking the status code when receiving an API response. If a response comes back unsuccessful, you can use the error type and error message to figure out what has gone wrong and do some rudimentary debugging.

<Note>
   The API is still in Beta state so some errors might not be handled properly yet.
</Note>

---

## Status codes

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

<Properties>
  <Property name="2xx">
    A 2xx status code indicates a successful response.
  </Property>
  <Property name="4xx">
    A 4xx status code indicates a client error - those are mostly related to missing permissions or invalid parameters inside the request.
  </Property>
  <Property name="5xx">
    A 5xx status code indicates a server error - in this case please reach out to us via [Slack](https://join.slack.com/t/netbirdio/shared_invite/zt-vrahf41g-ik1v7fV8du6t0RwxSrJ96A) or [GitHub](https://github.com/netbirdio/netbird/issues).
  </Property>
</Properties>

---

