Connect to OpenAPI
You can connect to any OpenAPI API using Retool's Open API integration and make it available as a resource. Once complete, you can write queries to interact with your 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 OpenAPI resource, you need:
- The URL to an OpenAPI version 3.0 specification in JSON or YAML format.
- Authentication credentials for your API.
1. Create an OpenAPI resource
Retool can connect to almost any API or database, and has built-in integrations for popular data sources. Sign in to your Retool organization and create a new OpenAPI resource from the Resources tab.
2. Configure the resource
Provide the necessary details to configure the resource so Retool can connect to your API. Not all settings are required, but refer to your API's documentation to learn what is needed.
General
These settings configure the name and location of the resource within Retool.
Name
The name to use for the resource (e.g., GitLab OpenAPI).
Folder
The folder in which to save the resource.
Description
A brief description of the resource (e.g., CI data).
Credentials
These settings configure how Retool connects to your OpenAPI API.
Specification URL
The URL of the JSON or YAML file containing the OpenAPI specification. This defines the available API endpoints.
Forward custom headers when fetching OpenAPI spec
Whether to forward custom headers, such as authentication headers, when fetching the OpenAPI spec.
URL parameters
Key-value pairs to include as URL parameters with OpenAPI requests.
Headers
Key-value pairs to include as headers with OpenAPI requests.
Body
Key-value pairs to include in the body of OpenAPI requests.
Cookies
Cookies to include with OpenAPI requests.
Authentication
The method of authentication to use with OpenAPI 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 OpenAPI 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 resource, write a test query to retrieve some data.