> For the complete documentation index, see [llms.txt](https://docs.jetadmin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jetadmin.io/user-guide/sql-queries-and-api-requests/api-builder.md).

# API Builder

The API Builder makes it simple to connect to external APIs, manage authentication, and preview responses. You can configure everything manually or let AI handle most of the setup for you.

### Making an API Request

To start, go to the **Component Settings** and add a new REST API **Data Resource** or choose **Make an HTTP request**. This opens the API Query Builder, where you can define your request method (GET, POST, PUT, DELETE, etc.) and specify the endpoint URL. For example, you might call:

```http
GET https://api.restful-api.dev/objects
```

This serves as the base of your request before adding headers or parameters.

{% @arcade/embed url="<https://app.arcade.software/share/xoiwsGNj5Y5L4pjLMGSY>" flowId="xoiwsGNj5Y5L4pjLMGSY" %}

### Ask AI to Build Requests

The **Ask AI** feature makes it even easier to set up your API integration. Instead of manually entering every parameter, you can simply paste your endpoint and provide any necessary details, such as the request method and expected response structure. Configure credentials in the resource's authentication settings. AI will automatically configure the request for you by placing parameters, headers, body content, and other details in the correct sections. You can also use AI later to adjust or update your request whenever requirements change.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FphENo4STBtX6QW2ZMsJF%2Fimage.png?alt=media&#x26;token=c7124074-0742-4df2-a691-c12dd1e95e2b" alt="API Builder request and response configuration"><figcaption></figcaption></figure>

### Parameters, Headers, and Tokens

Add query parameters under **Query Params** to filter or refine results. Use the **Headers** tab for authentication or custom headers, such as `Authorization` or `Content-Type`. Tokens and placeholders (e.g., `{{token}}`) are supported for secure, dynamic requests.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2F2EQJvJ8RkACuo6ryJFuc%2Fimage.png?alt=media&#x26;token=bf6b8f07-7b03-485c-9632-1f47727b5dce" alt="API Builder request and response configuration"><figcaption></figcaption></figure>

### Transforming the Response

The **Transform** feature lets you reshape the API response before using it. You can select transformations from a dropdown, or write custom JavaScript to make the response to your needs. For example, you might rename fields, extract only the necessary properties, or reformat arrays.

{% hint style="info" %}
If you’re unsure how to write the transformation logic, you can ask AI to generate JavaScript snippets that achieve the desired output. Review generated code and compare the preview with the expected output.
{% endhint %}

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FzncD9uF7zDtzhWtRPZgp%2Fimage.png?alt=media&#x26;token=42f4792f-9784-4cde-9c81-5a188ff65f9c" alt="API Builder request and response configuration"><figcaption></figcaption></figure>

### Pagination, Filtering, and Sorting

For large datasets, enable **Pagination**. Client-side pagination applies automatically, while server-side supports **Page, Offset, or Cursor** setups. Filters and sorting can also be applied directly in the builder for quick adjustments.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FbfLgr7eyBoFk92WwQpeM%2Fimage.png?alt=media&#x26;token=738fdaba-3068-4e36-ba33-b2c2a1514fd5" alt="API Builder request and response configuration"><figcaption></figcaption></figure>

{% content-ref url="/pages/MmX9ssWfEV4ceqfgUjeO" %}
[Sorting data](/user-guide/sql-queries-and-api-requests/api-builder/sorting-data.md)
{% endcontent-ref %}

{% content-ref url="/pages/Y0GucA24vzHyMzkBHctv" %}
[Pagination](/user-guide/sql-queries-and-api-requests/api-builder/pagination.md)
{% endcontent-ref %}

{% content-ref url="/pages/EBFfLg9cym4mR4wbM6Qd" %}
[Error Handling](/user-guide/sql-queries-and-api-requests/api-builder/error-handling.md)
{% endcontent-ref %}

### Running, Previewing, and Saving Requests

Click **Test Request** to run your API call and view results in the **Preview panel**. Here, you can quickly check the data, verify transformations, and confirm that filters or pagination work as expected. Once everything looks good, hit **Save** in the top-right corner to store your request for reuse across components.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FzMrZLihpZbnD8zZ9ANH7%2Fimage.png?alt=media&#x26;token=06f32ce8-ceec-4cd4-a3ff-ce35a5d2b6c0" alt="API Builder request and response configuration"><figcaption></figcaption></figure>

{% hint style="info" %}

### Verify before saving

Confirm the method and endpoint, expected records, response mapping, and pagination. Test an empty result and an error response. A successful first page does not prove that all records have been retrieved.
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.jetadmin.io/user-guide/sql-queries-and-api-requests/api-builder.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
