# Errors

The PDC API uses standard HTTP status codes to indicate success or failure. This page catalogs the common error responses that appear across endpoints and explains how to diagnose and fix them.

* **Format:** JSON
* **Typical shape:** an object with `status` (number) and `message` (string/array/object).
* **Where returned:** Most endpoints define `400`, `401`, `500`, and `503` responses.

{% hint style="warning" %}
Always capture the **HTTP status**, **request path**, and the full **error body** when troubleshooting. If the error occurs in automation, log the last request payload and headers (excluding secrets).
{% endhint %}

### Standard error object

Most error responses follow this structure:

```json
{
  "status": 400,
  "message": "Invalid Request Parameters"
}
```

* `status` (number): HTTP status code.
* `message` (string | array | object): Human-readable message or structured details.
  * In many endpoints, `message` may be a string (e.g., `"Unauthorized"`), an array of issues, or an object (e.g., `{ "error": "Invalid data format" }`).

***

### Error catalog

| Status                          | When it happens                                                                     | What to check                                                                                                      | Example response                                                                |
| ------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| **400 – Bad Request**           | The request is malformed or missing required parameters/fields.                     | Validate payload types, required fields, query params, and JSON format.                                            | `json { "status": 400, "message": "Invalid Request Parameters" }`               |
| **401 – Unauthorized**          | Missing/invalid/expired bearer token or wrong credentials when authenticating.      | For protected endpoints, include `Authorization: Bearer <token>`. If calling `/v1/auth`, verify username/password. | `json { "status": 401, "message": "Unauthorized" }`                             |
| **500 – Internal Server Error** | An unexpected error occurred while processing the request.                          | Retry if transient; if persistent, collect the request + response and contact an admin.                            | `json { "status": 500, "message": "Internal Server Error" }`                    |
| **503 – Service Unavailable**   | The service is unavailable or refusing connections (maintenance, startup, network). | Check service health (`/api/public/health`), base URL, network/firewall, and try again later.                      | `json { "status": 503, "message": "Service unavailable — connection refused" }` |

{% hint style="info" %}
In PDC API, these errors are defined consistently across operations with the same descriptions and example payloads. Some endpoints may also include structured `message` bodies (array/object) when returning validation details.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdc-api-docs/v1/get-started-with-pdc-api-v1/errors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
