HTTP Request

Make API calls to external services

Overview

The HTTP Request utility allows you to make HTTP/HTTPS requests to any API or web service. This is essential for integrating with external systems, fetching data, sending webhooks, or interacting with REST APIs.

Supports all common HTTP methods (GET, POST, PUT, PATCH, DELETE) with full control over headers, body, and authentication.

Configuration

Method

The HTTP method to use:

  • GET - Retrieve data
  • POST - Create/send data
  • PUT - Replace data
  • PATCH - Partial update
  • DELETE - Remove data

URL

The endpoint URL. Supports templates for dynamic values.

https://api.example.com/users/{{#1.data.userId}}

Headers

Key-value pairs for request headers. Common headers:

Content-Type: application/json
Authorization: Bearer {{token}}

Body

Request body for POST/PUT/PATCH requests. Typically JSON.

Authentication

Built-in support for: None, Basic Auth, Bearer Token, API Key.

Output

The response is available as:

Output fields:

  • data - Parsed response body (JSON automatically parsed)
  • status - HTTP status code (200, 404, etc.)
  • headers - Response headers object
  • success - Boolean (true for 2xx status)
  • error - Error message if request failed

Examples

Example 1: GET Request

Fetch user data from an API:

Method:GET
URL:https://api.example.com/users/123
Headers:Authorization: Bearer abc123

Example 2: POST with JSON Body

Create a new resource:

Method:POST
URL:https://api.example.com/orders
Body:
{
  "product": "{{#1.data.productId}}",
  "quantity": {{#1.data.quantity}},
  "customer": "{{#1.data.email}}"
}

Example 3: Dynamic URL with Query Params

Search with dynamic parameters:

URL:https://api.example.com/search?q={{#1.data.query}}&page={{#1.data.page}}&limit=20

Templates are URL-encoded automatically when inserted into the URL.

Error Handling

Use the IF utility to handle different response scenarios:

[HTTP Request] ──▶ [IF: success == true]
                          │
              ┌───────────┴───────────┐
              ▼                       ▼
           True                    False
      [Process Data]          [Handle Error]
                              Check {{#2.status}}:
                              - 401: Auth failed
                              - 404: Not found
                              - 500: Server error

Tips

Tip: For paginated APIs, combine HTTP Request with Loop to fetch all pages automatically.

Note: Requests have a default timeout. For slow APIs, check if the request completed before processing the response.

Security: Never expose API keys in URLs. Use headers or the built-in authentication options instead.

HTTP Request Utility - Flows Guide - Serenities