API Step

Call external API's in your workflow

API Steps allow your AirOps apps to communicate with external services via their APIs. This allows you to integrate and interact with data and functionalities that are outside of your app.

Basics

There are two types of request method that we support, read the API docs for your integration to find out the best method to use :

  • GET Requests:
    • This type of request is generally used to retrieve data from a service
  • POST Requests:
    • A POST request is used to push data to a service
    • This is typically used when you want to create or update data on the server
    • For instance, you may want to create a new record in a database or update a user's profile information

Reference Inputs or Outputs in the API Step

To dynamically set variables in your API and reference an input (defined in the "Start" step) or output variable ( generated by any step), you will need to use Liquid syntax:

StepSyntax"Start" Step InputStep OutputJSON Step Output
LLMLiquid{{ my_input }}{{ step_x.output }}{{ step_x.output.key }}

For example, if you have a user input defined as location at the start of your app, you can include {{ location }} in the URL or body of your API step to make a request to a weather API:

GET https://api.weatherapi.com/v1/current.json?key=YOUR_API_KEY&query={{ location }}

Similarly, you can use outputs from other steps as variables. If you have a step that retrieves a user's ID, you can use the output of that step as a variable in the API step:

POST https://api.example.com/user/{{ step_1.output }}/profile

This enables you to create dynamic API requests that adjust based on the inputs and outputs in your workflow.

Need more control?

For advanced API requests, use our Python step with custom code, using the Code Step, which can make external requests.