Skip to main content

Overview

The Call API block sends HTTP requests to external APIs and returns the response data. Use it to integrate with third-party services, fetch data from your own backend, or connect to any RESTful API.

Configuration

Request Method

Select the HTTP method for your API request.
MethodDescriptionUse When
GETRetrieve data from the APIFetching information, reading resources
POSTSend data to the APICreating resources, submitting data, triggering actions

API Endpoint URL

Enter the complete URL of the API endpoint. Only HTTPS URLs are supported for security. Format: https://api.example.com/endpoint This field supports placeholders to build dynamic URLs:
https://api.example.com/users/{{step_1.output.user_id}}/profile
HTTP URLs are not allowed. All API requests must use HTTPS for secure communication.

Request Headers

Add HTTP headers required by the API. Common headers include authentication tokens, content types, and API keys. Adding headers:
  1. Click “Add header”
  2. Enter the header name (e.g., Authorization)
  3. Enter the header value (e.g., Bearer {{api_token}})
Common headers:
HeaderExample ValuePurpose
AuthorizationBearer sk-xxxxxAPI authentication
X-API-Keyyour-api-keyAlternative auth method
Acceptapplication/jsonRequest JSON response
Headers support placeholders for dynamic values:
Authorization: Bearer {{step_1.output.token}}

Query Parameters

Add URL query parameters that will be appended to the endpoint URL. Adding parameters:
  1. Click “Add query parameter”
  2. Enter the parameter name (e.g., page)
  3. Enter the parameter value (e.g., {{current.page_number}})
Example:
ParameterValue
limit10
offset{{step_1.output.offset}}
sortcreated_at
This produces: https://api.example.com/items?limit=10&offset=0&sort=created_at

Request Body

For POST requests, provide the JSON payload to send. The body must be valid JSON format:
{
  "name": "{{step_1.output.name}}",
  "email": "{{step_1.output.email}}",
  "metadata": {
    "source": "workflow",
    "timestamp": "{{step_2.output.timestamp}}"
  }
}
Use placeholders within the JSON to insert dynamic values from previous steps. The Content-Type header is automatically set to application/json when a body is provided.

Retry Attempts

Configure automatic retries for failed requests.
  • Minimum: 0 (no retries)
  • Maximum: 3 retries
  • Default: 0
When retries are enabled, failed requests are automatically retried with exponential backoff (increasing wait time between attempts). Use retries when:
  • The API occasionally returns temporary errors
  • Network issues may cause intermittent failures
  • Rate limiting may temporarily block requests

Output

The block returns the API response data. JSON responses are automatically parsed into objects.

Successful Response

For a successful API call returning JSON:
{
  "id": 12345,
  "name": "John Doe",
  "email": "[email protected]",
  "created_at": "2024-01-15T10:30:00Z"
}
Accessing response data:
{{step_n.output.id}}
{{step_n.output.name}}
{{step_n.output.email}}
For array responses:
[
  {"id": 1, "name": "Item 1"},
  {"id": 2, "name": "Item 2"}
]
Accessing array data:
{{step_n.output[0].name}}
{{step_n.output | size}}

Error Response

When the API returns an error (4xx or 5xx status), the output contains error details:
{
  "error": true,
  "status": 401,
  "message": "Unauthorized",
  "body_preview": "Invalid API key provided..."
}

Non-JSON Response

If the API returns non-JSON content, the raw text is returned as a string:
{{step_n.output}}

Security

The Call API block includes built-in security protections:
  • HTTPS Only: All requests must use secure HTTPS connections
  • SSL Verification: Server certificates are validated
  • Response Size Limit: Maximum 10MB response size
  • Request Timeout: 30-second timeout for all requests
  • Safe Redirects: Redirect URLs are validated before following

Best Practices

  • Store API keys securely and reference them using placeholders
  • Use appropriate retry settings for unreliable APIs
  • Check for error responses in subsequent steps before processing data
  • Set reasonable result limits in query parameters to avoid large responses
  • Test API calls with sample data before running production workflows
  • Use GET for reading data, POST for creating or modifying data

Common Use Cases

Use CaseConfiguration Tips
CRM integrationPOST customer data to Salesforce, HubSpot, etc.
Email servicePOST to SendGrid, Mailchimp for transactional emails
Slack notificationsPOST workflow results to Slack webhooks
Data enrichmentGET additional data from Clearbit, FullContact
Custom backendConnect to your own APIs for business logic
Webhook triggersPOST to trigger external automation tools

Example: Slack Notification

Send workflow results to a Slack channel: Method: POST URL: https://hooks.slack.com/services/xxx/yyy/zzz Body:
{
  "text": "Workflow completed!",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Results:* {{step_3.output.summary}}"
      }
    }
  ]
}

Example: Fetching Paginated Data

Retrieve data from a paginated API: Method: GET URL: https://api.example.com/items Query Parameters:
ParameterValue
page{{current.page}}
per_page50
Use with a Loop block to iterate through pages.

Troubleshooting

ErrorCauseSolution
Security violationNon-HTTPS URLChange URL to use https://
401 UnauthorizedInvalid or missing authCheck Authorization header value
403 ForbiddenInsufficient permissionsVerify API key has required access
404 Not FoundInvalid endpoint URLVerify the API endpoint path
429 Too Many RequestsRate limit exceededAdd retries or reduce request frequency
TimeoutAPI too slowCheck if API is responsive, consider async patterns
Invalid JSONMalformed request bodyValidate JSON syntax in body field

What’s Next

Now that you understand the Call API block: