
REST API
Overview
REST APIs can be used in Application APIs, Workflows, or Scheduled Jobs, letting you call any internal or external REST API from Superblocks, just like in Postman.
Setting up REST API
Set up allowed IP Addresses
If you're using Superblocks Cloud, add Superblocks' IPs as allowed IPs for your REST API. This isn't necessary if your API is available on the public internet or you're using a public API.
If using the Superblocks On-Premise, make sure your agent can connect to your REST API.
Add integration
- In the web app, navigate to the Integrations page
- Click Add integration
- Search for REST API and select it from the list of available integrations
- Name the integration
- Fill out the integration configuration as follows:
Field
Required Descritpion Base URL The main endpoint address of the API that serves as the root for all requests Authentication The authorization type you want to use. See detailed instructions for setting up API auth in our docs on Authentication & authorization Headers List of headers that will be added to requests to your API Params List of query parameters that will be added to requests to your API - Optionally, add more configurations to set credentials for different environments
- Click Test Connection to check that Superblocks can connect
- Click Create
REST API connected
Now you can use REST API in any Application, Workflow, or Scheduled Job
Fetch Credentials Dynamically
Note, if you need to retrieve credentials on demand with a custom workflow instead of using the pre-built authentication flows, enable "Fetch credentials dynamically". This allows you to run a Superblocks Workflow (which can issue an API call or connect to a secrets manager) to fetch the token and return it for use within your REST API integration form:
Screenshot of Fetch Credentials Dynamically
OpenAPI Specifications
You can upload an existing OpenAPI specification file for your REST API. OpenAPI specs helps your team develop at lighting speed in Superblocks. You'll get access to interactive docs, autocomplete in REST request forms, data validation, and more when your provide a specification for your API.
Uploading an OpenAPI specification
- Select Upload OpenAPI in the top-right corner
- From the uploader, select a JSON or YAML file containing your API's OpenAPI spec (version 2.0 or later)
- Click Ok to upload
Once your API's spec has been uploaded, you can manage your spec and explore docs from the API Specification tab.
Replacing an OpenAPI specification
To replace an API specification, such as to upload a new version, you can click on the button in the top-right labeled with the name of specification, e.g. spec-name.yaml
, and upload a new specification.
Use REST in APIs
Once your REST integration is created, you can start creating steps in APIs that call your REST API. REST APIs can be used to make HTTP request or to consume server-sent events from your internal API or third-party APIs.
To learn more about REST requests in Superblocks, see the Building REST requests guide.
Supported OpenAPI specs
Superblocks supports uploading the following specification versions:
- OpenAPI 3.0 and 3.1
- Swagger 2.0
Specification files can be provided in any of the following formats:
- JSON
- YAML
- X-YAML