# Responses & Errors

{% hint style="info" %}
Our API uses standard HTTP codes to indicate if the request is successful or failed
{% endhint %}

Successful requests will return both a `“message”` and `“data”` field with a 2XX status code. Data can be represented by an object or array type.

```
{
    "message": "Response message",
    "data": {
       # Response should be here
    }
}
```

```
{
    "message": "Response message",
    "data": [
       # Response should be here
    ]
}
```

Unsuccessful requests will return a “message” field containing the error message, with 4XX or 5XX status code.

**Common error message**

```
{
    "message": "Error message."
}
```

**Error message with error id**

{% hint style="info" %}
If you experience issues or errors while using our service, we highly recommend that you contact us by providing the **`errorId`** that you get along with the error message. That way, our team can easily trace the issue
{% endhint %}

```
{
    "errors": {
        "errorId": <log_id:uuid>
    },
    "message": "Error message."
}
```

**Error message with error type**

```
{
   "errors":{
      "errorId": <log_id:uuid>,
      "errorType": <error_type:str>
   },
   "message": "Error message."
}
```

**Validation error**

```
{
    "errors": {
        "fieldName": [
            "Unknown field."
        ]
    },
    "message": "Input payload validation failed."
}
```


---

# 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.kredibel.io/responses-and-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.
