Connect to REST APIs

Learn how to connect REST APIs to Retool.

You can connect Retool to a wide range of APIs using our native integrations. You can also connect to any REST API and make it available as a resource. Once complete, you can write queries to interact with the API.

Requirements

All users for Retool organizations on Free or Team plans have global Edit permissions and can add, edit, and remove resources. If your organization manages user permissions for resources, you must be a member of a group with Edit all permissions.

To create your REST API resource, you need:

  • the base URL for the API.

If your REST API is behind a firewall, you must also allow access from Retool's IP addresses. Add these IP addresses to your firewall's allowlist before you create the resource.

1. Create a new resource

Sign in to your Retool organization and navigate to the Resources tab. Click Create new, then select Resource.

Retool can connect to almost any API or database, and has built-in integrations for popular data sources. Select the REST API integration.

2. Configure the resource

Provide the necessary details to configure the resource so Retool can connect to your REST API. Not all settings are required.

General

These settings configure the name and location of the resource within Retool.

Name

The name to use for the resource (e.g., REST API).

Folder

The folder in which to save the resource.

Description

A brief description of the resource (e.g., Customer data).

Credentials

These settings configure how Retool connects to your REST API.

Base URL

The base URL for the REST API. This must be an absolute URL.

URL parameters

Key-value pairs to include as URL parameters with REST API requests. You can optionally include current_user and retoolContext properties to dynamically include details about the current user or the current app.

Headers

Key-value pairs to include as headers with REST API requests. You can optionally include current_user and retoolContext properties to dynamically include details about the current user or the current app.

Body

Key-value pairs to include in the body of REST API requests.

Cookies

Cookies to include with REST API requests.

Authentication

The method of authentication to use with REST API requests.

Forward all cookies

Whether to forward all cookies. This is useful if you have dynamic cookie names.

3. Save the resource

Click Create resource to complete the setup. You can then click either Create an app to immediately start building a Retool app or Back to resources to return to the list of resources.

Wrap up

Your REST API resource is now ready to use. You write queries to make API requests by specifying the request method and endpoint, additional parameters to include, and the request body.

To verify you can successfully interact with your REST API, write a test query to retrieve some data. The following example retrieves a list of customers from a sample API.

GET https://retoolapi.dev/f8IrWi/data
[
  {
    "id": 1,
    "name": "Renata Nind",
    "email": "[email protected]",
    "blocked": false
  },
  {
    "id": 2,
    "name": "Sibylle Anten",
    "email": "[email protected]",
    "blocked": true
  },
  {
    "id": 3,
    "name": "Johannah Lauks",
    "email": "[email protected]",
    "blocked": false
  },
  {
    "id": 4,
    "name": "Stuart Cullrford",
    "email": "[email protected]",
    "blocked": true
  },
  {
    "id": 5,
    "name": "Ulick Linne",
    "email": "[email protected]",
    "blocked": false
  }
]