> For the complete documentation index, see [llms.txt](https://docs.matrixian.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.matrixian.com/readme/api-foutmeldingen.md).

# API Foutmeldingen

Deze pagina beschrijft hoe onze API foutmeldingen teruggeeft, welke HTTP‑statuscodes we gebruiken, en hoe de JSON‑structuur eruitziet.

### TL;DR

* Alle fouten volgen het **Google JSON error** patroon.
* Body:

  ```json
  {
    "id": "<request-id>",
    "status": "failure",
    "error": {
      "code": <http-status-code>,
      "message": "<korte samenvatting>",
      "errors": [
        { "reason": "<machine-leesb. reden>", "message": "<menselijke uitleg>" }
      ]
    }
  }
  ```
* CORS‑headers zijn aanwezig op alle foutantwoorden.
* Waar van toepassing geven we extra context via `errors[].reason`.

***

### Standaard JSON‑structuur

```json
{
  "id": "<request-id>",
  "status": "failure",
  "error": {
    "code": 404,
    "message": "Not Found",
    "errors": [
      {
        "reason": "Not Found",
        "message": "The requested route or method was not found."
      }
    ]
  }
}
```

#### Velden

* **error.code** *(number)*: De HTTP‑statuscode.
* **error.message** *(string)*: Korte samenvatting (in het Engels; stabiele API‑conventie).
* **error.errors** *(array)*: Optionele lijst met detailobjecten:
  * **reason** *(string)*: Machine‑leesbare reden (stabiele sleutel die clients kunnen mappen).
  * **message** *(string)*: Menselijke toelichting; kan in de loop der tijd verfijnen.

***

### Scenario’s & statuscodes

#### 400 — Bad Request

Wordt teruggegeven wanneer parameters onjuist zijn ingegeven.

**Voorbeelden van oorzaken**

* Verplichte parameter ontbreekt.
* Waarde van een parameter is onjuist.

**Response**

```json
{
  "id": "<request-id>",
  "status": "failure",
  "error": {
    "code": 400,
    "errors": [
      {
        "reason": "postalCode",
        "message": "this value must be of format 1234AB"
      },
      {
        "reason": "houseNumber",
        "message": "Field required"
      },
      {
        "reason": "buildYear",
        "message": "Input should be a valid integer, unable to parse string as an integer"
      }
    ],
    "message": "Bad Request"
  }
}
```

#### 401 — Unauthorized

Wordt teruggegeven wanneer authenticatie ontbreekt of ongeldig is.

**Voorbeelden van oorzaken**

* Verkeerde of ontbrekende `Authorization: Bearer <api-key>` header.
* Inactieve API‑key.

**Response**

```json
{
  "id": "<request-id>",
  "status": "failure",
  "error": { "code": 401, "message": "Unauthorized", "errors": [] }
}
```

***

#### 403 — Forbidden

Wordt teruggegeven wanneer de aanroepende klant bekend is, maar **geen rechten** heeft op de gevraagde resource.

**Mogelijke reasons**

* `access_denied` — algemene weigering.
* `missing_subscription` — endpoint valt buiten het abonnement.
* `rate_limit` — als throttling wordt afgedwongen (*dan blijft het statuscode 403*).

**Response**

```json
{
  "id": "<request-id>",
  "status": "failure",
  "error": {
    "code": 403,
    "message": "Forbidden",
    "errors": [
      { "reason": "missing_subscription", "message": "Your plan does not include access to this endpoint." }
    ]
  }
}
```

```json
{
  "id": "<request-id>",
  "status": "failure",
  "error": {
    "code": 403,
    "message": "Forbidden",
    "errors": [
      { "reason": "rate_limit", "message": "Rate limit exceeded. Please retry later." }
    ]
  }
}
```

{% hint style="warning" %}
Voordat u live gaat met uw oplossing en hogere volume API calls wilt maken, **neem dan contact met ons op** (via <support@matrixian.com>) om de **rate-limits** te verhogen.
{% endhint %}

***

#### 404 — Not Found

We gebruiken 404 in twee situaties:

1. **Route/methode bestaat niet** (bijv. `/v1/niet-bestaand`).
2. **Resource bestaat niet** (bijv. object‑ID onbekend, onbekend adres).

**Responses**

```json
{
  "id": "<request-id>",
  "status": "failure",
  "error": {
    "code": 404,
    "message": "Not Found",
    "errors": [ { "reason": "Not Found", "message": "The requested route or method was not found." } ]
  }
}
```

```json
{
  "id": "<request-id>",
  "status": "failure",
  "error": {
    "code": 404,
    "message": "Not Found",
    "errors": [ { "reason": "Not Found", "message": "The requested resource does not exist." } ]
  }
}
```

***

### CORS

Alle foutantwoorden bevatten CORS‑headers:

```
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: *
```

### Richtlijnen voor clients

* Gebruik `error.code` voor primaire afhandeling (HTTP‑niveau).
* Gebruik `errors[0].reason` voor specifieke beslissingen&#x20;
* Log de `id` , uit de body, en de header `X-Amzn-Trace-Id`  voor support/correlatie.

***

### Backwards compatibility

Het top‑level `error`‑object en de waarden van `error.code` en `error.message` blijven stabiel. We kunnen **nieuwe** `reason`‑waarden toevoegen; clients dienen onbekende reasons te negeren of als generieke fout te behandelen.

***

### Contact & support

Neem bij vragen of onduidelijkheden contact op via onze support (<support@matrixiangroup.com>). Vermeld altijd de endpoint‑URL, timestamp, en (indien mogelijk) de `id` en de `X-Amzn-Trace-Id`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.matrixian.com/readme/api-foutmeldingen.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
