Skip to content
ajan.io

Docs menu

On this page

HTTP Request

Make HTTP requests to external APIs for custom integrations and data fetching.

Overview

The HTTP Request node lets you call any external API - fetch data, send updates, trigger actions, or integrate with services that don't have native integrations.

Configuration

Import from cURL

Click "Import from cURL" to paste a cURL command and automatically populate all fields (URL, method, headers, parameters). Great for quickly setting up requests from API documentation.

URL (Required)

The API endpoint to call. Supports three input modes:

Manual mode: Enter the URL directly with optional variables

handlebars
https://api.example.com/users/{{trigger.output.user_id}}/orders

Auto mode: AI automatically determines the URL based on workflow context

Prompt AI mode: Provide instructions for the AI to generate the URL

text
Construct the API URL for fetching user {{trigger.output.user_id}} from our CRM system

Method

Select the HTTP method:

  • GET: Fetch data
  • POST: Create new resources
  • PUT: Replace existing resources
  • PATCH: Update existing resources
  • DELETE: Remove resources

Headers

Add custom headers as key-value pairs. Common headers:

Authentication:

text
Key: Authorization
Value: Bearer {{trigger.output.api_token}}

Content Type:

text
Key: Content-Type
Value: application/json

Click "Add header" to include multiple headers.

Query Parameters

Add URL query parameters as key-value pairs instead of including them in the URL.

Example:

text
URL: https://api.example.com/search
Parameters:
  - Key: query, Value: {{trigger.output.search_term}}
  - Key: limit, Value: 10

Results in: https://api.example.com/search?query=laptops&limit=10

Body (POST/PUT/PATCH only)

The request payload, typically JSON format. Supports variables from previous nodes.

json
{
  "name": "{{trigger.output.name}}",
  "email": "{{trigger.output.email}}",
  "status": "{{agent.output.structured.category}}",
  "metadata": {
    "source": "workflow",
    "processed_at": "{{trigger.output.timestamp}}"
  }
}

Example Use Cases

Fetch User Data (GET)

text
Method: GET
URL: https://api.crm.com/users/{{trigger.output.user_id}}
Headers:
  - Authorization: Bearer YOUR_TOKEN

Create Record (POST)

text
Method: POST
URL: https://api.system.com/records
Headers:
  - Content-Type: application/json
Body:
{
  "title": "{{trigger.output.title}}",
  "category": "{{agent.output.structured.category}}",
  "priority": "{{agent.output.structured.priority}}"
}

Search with Parameters (GET)

text
Method: GET
URL: https://api.example.com/search
Query Parameters:
  - q: {{trigger.output.search_term}}
  - limit: 20
  - format: json

Update Status (PATCH)

text
Method: PATCH
URL: https://api.app.com/items/{{trigger.output.id}}
Headers:
  - Content-Type: application/json
Body:
{
  "status": "completed",
  "updated_by": "workflow"
}

Accessing Response Data

After the HTTP Request executes, access the response in subsequent nodes:

handlebars
{{http_node.output.status}}              β†’ Status code (200, 404, etc.)
{{http_node.output.data}}                 β†’ Response body
{{http_node.output.data.user.name}}       β†’ Nested response data
{{http_node.output.data.items[0].id}}     β†’ Array items
{{http_node.output.headers}}              β†’ Response headers

Response Status Codes

Use the status code to check if the request succeeded:

handlebars
{{ http_node.output.status === 200 }}     β†’ Success
{{ http_node.output.status >= 400 }}      β†’ Error occurred

Best Practices

If you have a working cURL command from API docs, use "Import from cURL" to automatically set up all fields correctly.

Always add error handling. Use a Condition node after the HTTP Request to check {{ http_node.output.status === 200 }}.

Add query parameters in the Parameters section instead of hardcoding them in the URL. This makes them easier to manage.

Use the node's test button to verify the request works before building the rest of your workflow.

Next Steps