Skip to main content

HTTP Request

The HTTP Request step allows you to make HTTP requests to any API endpoint. This enables integration with external services, webhooks, and custom APIs.

Overview

HTTP Request steps are powerful for:
  • Integrating with third-party APIs
  • Calling webhooks
  • Fetching data from external services
  • Triggering actions in other systems
  • Building custom integrations

Configuration

When you add an HTTP Request step, you’ll configure:

HTTP Method

Select the HTTP method for your request:
  • GET: Retrieve data from an endpoint
  • POST: Create new resources or send data
  • PUT: Update or replace resources
  • PATCH: Partially update resources
  • DELETE: Remove resources
  • HEAD: Retrieve headers without body
  • OPTIONS: Get allowed methods for an endpoint

URL

Enter the full URL of the API endpoint:
https://api.example.com/v1/users
URLs can include workflow variables. Use {{variable.name}} syntax to insert dynamic values into the URL.

Headers

Add custom HTTP headers for your request:
  • Authorization: API keys, Bearer tokens, etc.
  • Content-Type: Specify the request body format
  • Custom headers: Any additional headers required by the API
{
  "Authorization": "Bearer {{api.key}}",
  "Content-Type": "application/json"
}

Request Body

Configure the request body based on the body type:

Body Type

Choose the format for your request body:
  • JSON: Send JSON data (most common for REST APIs)
  • Form Data: Send form-encoded data
  • Raw Text: Send plain text
  • XML: Send XML data

Body Content

Enter the body content. You can use workflow variables to insert dynamic values:
{
  "userId": "{{user.id}}",
  "email": "{{user.email}}",
  "name": "{{user.name}}"
}

Response Handling

HTTP Request steps return response data that can be used in subsequent steps:
  • Response Body: The response content (JSON, text, etc.)
  • Status Code: HTTP status code (200, 404, 500, etc.)
  • Headers: Response headers from the API
Response data is automatically parsed and available as workflow variables in subsequent steps. JSON responses are parsed into accessible variables.

Example Use Cases

User Creation API

Create a user in an external system:
Trigger (Event: User Signs Up)

HTTP Request
  Method: POST
  URL: https://api.example.com/users
  Headers:
    Authorization: Bearer {{api.token}}
    Content-Type: application/json
  Body:
    {
      "email": "{{user.email}}",
      "name": "{{user.name}}"
    }

Webhook Notification

Send a webhook notification:
Trigger (Event: Order Completed)

HTTP Request
  Method: POST
  URL: {{webhook.url}}
  Headers:
    X-API-Key: {{webhook.key}}
    Content-Type: application/json
  Body:
    {
      "event": "order.completed",
      "orderId": "{{order.id}}",
      "amount": {{order.amount}}
    }

Data Fetching

Fetch data from an external API:
Trigger (Event: User Profile View)

HTTP Request
  Method: GET
  URL: https://api.example.com/users/{{user.id}}/preferences
  Headers:
    Authorization: Bearer {{api.token}}

Send Email (Use fetched preferences in email)

Error Handling

HTTP Request steps can fail for various reasons:
  • Network errors: Connection timeouts, DNS failures
  • HTTP errors: 4xx (client errors) or 5xx (server errors)
  • Invalid responses: Malformed JSON or unexpected formats
Use flow control steps to check response status codes and handle errors gracefully. For example, retry on 5xx errors or send notifications on 4xx errors.

Best Practices

Store sensitive data like API keys in workflow variables rather than hardcoding them. This keeps credentials secure and makes them reusable.
Use flow control steps to check response status codes and handle different outcomes appropriately.
Be aware that HTTP requests have timeout limits. For long-running operations, consider using webhooks or polling instead.
Test your HTTP requests with sample data before deploying workflows to ensure endpoints are accessible and responses are as expected.
Use GET for retrieving data, POST for creating resources, PUT/PATCH for updates, and DELETE for removals. This follows REST API conventions.
Never expose API keys or sensitive credentials in workflow configurations. Use workflow variables or secure storage for authentication credentials.
Use the preview feature in the HTTP Request configuration to test your request before saving. This helps catch configuration errors early.