> For the complete documentation index, see [llms.txt](https://docs.digitalapi.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalapi.ai/developer-portal/test-and-track-usage/testing-an-api.md).

# Testing an API

The **Test this API** tab opens an in-browser API tester, so a consumer can send live requests and read responses without leaving the portal or wiring up a client first. Use it to confirm an endpoint behaves as documented before you build against it. The tab is available on APIs where the provider has enabled it.

![Figure. The Test this API console: an endpoints list, a request builder, and a response pane.](/files/XlVAU4nZfHvUjjAhCd81)

### What you see

The console, labelled **API Tester**, has three areas:

* **Endpoints list (left)**: every operation grouped by tag, for example under **Banking - Customers**: **POST Create a new customer** and **GET Get all customers**. A **Search endpoints** box filters the list. Selecting an operation loads its method, path, and sample body into the request builder.
* **Request builder (centre)**: the **method** (for example **POST**), the request **path** (for example `/api/banking/customers`), a connection-mode control (for example **Direct**), and the **Send** button. Below the address row are the **Headers**, **Query**, **Auth**, **Body**, and **Scripts** tabs.
* **Response pane (right)**: shows the status, headers, and body once you send. Until then it reads *Send request to see response*. A **Docs** view sits alongside the response.

### Send a request

1. Open the API and click the **Test this API** tab.
2. In the endpoints list, click the operation you want, for example **GET Get all customers**. The builder fills in the method and path.
3. Open the **Auth** tab and supply the credential the API expects, for example the subscription key from one of your applications (see [Managing applications and credentials](/developer-portal/subscribe-and-get-access/managing-apps-and-credentials.md)). Calls to a protected operation need a key from an application with an active subscription.
4. For a write operation, open the **Body** tab and edit the sample payload. The **Headers** tab already carries `Content-Type: application/json`; add headers with **Add**.
5. Click **Send**.
6. Read the **Response** pane: the status code, response headers, and body.

### What you configure per request

* **Headers**: key and value pairs, such as `Content-Type` or a custom header the API requires.
* **Query**: query-string parameters for the operation.
* **Auth**: the API key or token the gateway validates.
* **Body**: the request payload for POST, PUT, and PATCH operations.

{% hint style="info" %}
Prefer to test from your own toolchain? The **Specification** tab offers **Request samples** in cURL, Java, and other languages that you can copy and run as is. See [Exploring an API](/developer-portal/discover-apis/exploring-an-api.md).
{% endhint %}

### Verify

* Choosing an operation fills the method and path in the request builder.
* After **Send**, the response pane shows a status code and body.
* A protected call with no valid key returns an authorization error, which confirms the gateway is enforcing credentials.

{% hint style="info" %}
**Note:** The console calls the gateway directly, exactly as your application will. The portal does not sit in the request path; it only builds and sends the request from your browser. **Result:** You confirm an endpoint's request shape and response before writing a line of integration code.
{% endhint %}


---

# 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.digitalapi.ai/developer-portal/test-and-track-usage/testing-an-api.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.
