---
description: >-
  API Builder is designed to provide clear and informative responses to API
  requests. This includes specific error handling mechanisms for situations
  where requests cannot be fulfilled due to various re
---

# Error handling

#### 1. Not Found (404)

If a requested resource is not found in the database, API Builder returns a `404 Not Found` status code. This response indicates that the server has not found a match for the requested endpoint or resource.

#### 2. Authentication Error (401)

When a request is made without proper authentication or with invalid credentials, API Builder responds with a `401 Not Authenticated` status code. This error signifies that the request has not been applied because it lacks valid authentication credentials for the target resource.

\
ChatGPT

Translated and adapted into documentation style, the text would be:

***

### Handling API Responses and Errors

API Builder is designed to provide clear and informative responses to API requests. This includes specific error handling mechanisms for situations where requests cannot be fulfilled due to various reasons, such as authentication issues or data not found in the database. Below are the guidelines on how API Builder handles these scenarios:

#### 1. Not Found (404)

If a requested resource is not found in the database, API Builder returns a `404 Not Found` status code. This response indicates that the server has not found a match for the requested endpoint or resource.

**Example:**

```json
jsonCopy code{
  "error": "Resource not found"
}
```

#### 2. Authentication Error (401)

When a request is made without proper authentication or with invalid credentials, API Builder responds with a `401 Not Authenticated` status code. This error signifies that the request has not been applied because it lacks valid authentication credentials for the target resource.

**Example:**

```json
jsonCopy code{
  "error": "Not authenticated"
}
```

#### 3. Parameter Validation (400)

API Builder validates request parameters to ensure they match the expected data types and formats. If a parameter is of an incorrect type—for instance, if a request expects a string type parameter but receives a boolean—the request will be rejected with a `400 Bad Request` status code. This response indicates that the server cannot process the request due to an apparent client error (e.g., malformed request syntax).
