REST API
Overview
The Superblocks REST API lets you create a custom integration to any internal or third-party HTTP based API. Use this integration to configure your API, including base URL for different servers, API authentication, and OpenAPI specifications, so your team can make REST requests in seconds.
Setting up REST API
- In the web app, navigate to the Integrations page
- Click on the REST API tile
- Name your REST API
- Set your API's Base URL
- Set up Authentication for your API
- Add Headers and Query parameters that will be injected into each request for this API
- Click Upload OpenAPI to upload a specification for your API. Learn more in API Specifications
- Optionally, add more configurations to use a different Base URL or authorization credentials for different environments
- Click Create
If using Superblocks Cloud, add these Superblocks IPs to your allowlist (not necessary for On-Premise-Agent).
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 specifications
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