Skip to main content

REST APIs

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 in any Superblocks backend API.

Setting up REST API

Add integration

  1. In the web app, navigate to the Integrations page
  2. Click on the REST API tile
  3. Name your REST API
  4. Set your API's Base URL
  5. Set up Authentication for your API
  6. Add Headers and Query parameters that will be injected into each request for this API
  7. Click Upload OpenAPI to upload a specification for your API. Learn more in API Specifications
  8. Optionally, add more configurations to use a different Base URL or authorization credentials for different environments
  9. Click Create
info

If using Superblocks Cloud, add these Superblocks IPs to your allowlist (not necessary for On-Premise-Agent)

success

You're connected! Now you can use your 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

Fetch credentials dynamically using a workflow

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
  1. Select Upload OpenAPI in the top-right corner
  2. From the uploader, select a JSON or YAML file containing your API's OpenAPI spec (version 2.0 or later)
  3. 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.

Creating REST steps

Once your REST integration is configured, you can create REST steps to easily interact with the API. See building REST requests for more in depth details.

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