Skip to main content

Connect to the Retool API

Learn how to connect the Retool API using the OpenAPI integration.

Available on:Enterprise plan

You can use the OpenAPI integration to create a Retool API resource and make it available in Retool. Once complete, your users can write queries that interact with your organization using the Retool API.

Requirements

The OpenAPI integration requirements depend on whether you have a cloud-hosted or self-hosted Retool organization. You may also need to make OpenAPI configuration changes before creating the resource.

Sufficient user permissions to create resources

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.

Retool API key

Authentication is performed using Bearer HTTP authentication with an API key. You must first create an API key with the required permission scopes. Refer to the Retool API authentication guide for instructions.

Configure the resource

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

Configuration

Specify the name, location, and description to use for your OpenAPI resource. Retool displays the resource name and type in query editors to help users identify them.

Provide the following configuration settings to create the resource. Depending on how your data source is configured, you may also need to provide optional settings for Retool to connect.

Name

The name to use for the resource.

Description

A description of the resource.

Specification URL

The URL for the OpenAPI specification to use.

Use https://api.retool.com/api/v2/spec for cloud-hosted organizations.

Authentication

The OpenAPI integration supports the following authentication methods. Depending on which authentication method you use, you may need to make changes to your OpenAPI configuration.

Bearer Token

Authentication is performed using Bearer HTTP authentication with a token. You must be able to obtain and provide these credentials to create the resource.

Refer to the Retool API authentication guide for instructions on creating an API token.

Test the connection

Click Test Connection to verify that Retool can successfully connect to the data source. If the test fails, check the resource settings and try again.

Testing a connection only checks whether Retool can successfully connect to the resource. It cannot check whether the provided credentials have sufficient privileges or can perform every supported action.

Save the resource

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

Next steps

Your Retool API resource is now ready to use. Check out related queries and code documentation to learn how to interact with Retool API data.

By default, responses include up to 100 items. When there are more items, the has_more field in the response is set to true and the next field has a pagination token.

{
"data": [
{...},
],
"has_more": true,
"next": "opaque-pagination-token"
}

To request the next page of results, include the token in the URL parameters of the request:

curl -H "Authorization: Bearer {token}" https://api.retool.com/api/v2/resources?next=opaque-pagination-token