Reusable HTTP requests

HTTP request steps call other tools' APIs from a workflow, for example to create a ticket, comment on one, or post to a Slack channel. Save a request once, and any workflow can use it as a step.

Create a reusable HTTP request

  1. Go to Workflows and open HTTP requests.
  2. Select New HTTP request.
  3. Give it a name that says what it does, such as "Slack: Post message to channel" or "Linear: Create issue."
  4. Set the request:
    • Method, such as POST
    • URL, such as https://api.linear.app/graphql
    • Headers, such as Content-Type: application/json
    • Body, if the API needs one
  5. Save the request.
🚧

Keep credentials out of request bodies and URLs

Store API keys and tokens as secrets, and reference them in headers, instead of pasting them into the request.

Use values from the run

Request URLs, headers, and bodies can use Liquid to insert values from the run, such as kickoff inputs or an earlier step's output. For example, a Slack message body:

{
  "channel": "#dependency-updates",
  "text": "{{ steps.check_versions.output.summary }}"
}

Values that change from workflow to workflow, like the channel or the message, can come from the step that uses the request.

Use a request in a workflow

  1. In the workflow editor, add an HTTP request step.
  2. Choose the saved request.
  3. Fill in any values the request expects from this workflow.

The step shows the request's name and the host it calls, such as slack.com, on the canvas.

Edit or delete a request

Changes to a saved request apply to every workflow that uses it. Before editing or deleting one, check which workflows use it.

Use the response

A later step can read the request's response at steps.<step id>.output, for example to use the ID of a ticket the request just created.



Did this page help you?