Connect to the Retool API
Learn how to connect the Retool API using the OpenAPI integration.
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.
- Cloud-hosted organizations
- Self-hosted organizations
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.
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.
1. 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.
- Cloud-hosted organizations
- Self-hosted organizations
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.
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://[your-instance-url].com/api/v2/spec
for a self-hosted deployment instance.
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.
- Cloud-hosted organizations
- Self-hosted organizations
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.
3. 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.
4. 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.
Wrap up
Your Retool API resource is now ready to use. To start querying data:
- Add a Resource query to an app or workflow.
- Select the Retool API resource from the resources dropdown.
- Write and run a query.