# Debugging requests in the API Collection

The Debug panel in the API Collections allows you to see the content of the HTTP request and response messages after clicking "**Send**" button on the request panel.

The purpose of this section is to discover potential issues with the API connection and better identify what needs to be fixed in case of an [HTTP error](https://www.notion.so/Errors-in-API-requests-2f842e5243f142f69ae3ffd83cd2888f).&#x20;

<figure><img src="/files/dUfOIjqaRbeVeOvjHMQ5" alt=""><figcaption></figcaption></figure>

**Related docs:**

{% content-ref url="/pages/-Mj-f1-GSMCb9\_8uSM\_Y" %}
[Data Collection & Binding: Complete Collection](/connect-api/data-library-and-binding-complete-collection.md)
{% endcontent-ref %}

## 🔑 How to use the Debug section

Bravo exchanges data with an API by means of the [HTTP protocol](https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview). When a request is sent, either from the Data Library or the Bravo app, Bravo sends an **HTTP request** message to the correspondent API endpoint. If the HTTP message arrives successfully (which is normally the case if the domain of the request URL is correct), an **HTTP response** message will be received back from the API, together with a [**status code**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).

The purpose of the Debug section is to show the content of those HTTP messages. It's split into two sections: one for the **HTTP request** message, and the other for the **HTTP response** message.

Each of the sections contains the following information:

* Request URL (only for the HTTP Request)
* Status Code (only for the HTTP Response)
* HTTP headers.
* HTTP body, in case the message contains one.

After clicking **`Send`** in the Data Library, in case the HTTP exchange was carried out **successfully**, a `200 - OK` status code will be returned from the API, together with the data fetched from that API endpoint. This data is part of the **response body.**

In case there was an **error** with the request, or with the API server itself, an error code will be returned on the response message. Besides the [error code](https://www.notion.so/Errors-in-API-requests-2f842e5243f142f69ae3ffd83cd2888f), information about the issue will usually be included in the response body. The information will depend on the configuration of the API we're communicating with.

{% hint style="info" %}
When the remote API returns a **`4XX` error code**, check out the HTTP response body as it might contain useful information for debugging purposes.

In case the remote API returns a **`500` error code**, check the spelling of the request URL and make sure it's correct.
{% 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.bravostudio.app/connect-api/debugging-api-issues/data-library-data-library-debug-section.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.
