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.
| Method | Description | Use When |
|---|
| GET | Retrieve data from the API | Fetching information, reading resources |
| POST | Send data to the API | Creating 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.
Add HTTP headers required by the API. Common headers include authentication tokens, content types, and API keys.
Adding headers:
- Click “Add header”
- Enter the header name (e.g.,
Authorization)
- Enter the header value (e.g.,
Bearer {{api_token}})
Common headers:
| Header | Example Value | Purpose |
|---|
| Authorization | Bearer sk-xxxxx | API authentication |
| X-API-Key | your-api-key | Alternative auth method |
| Accept | application/json | Request 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:
- Click “Add query parameter”
- Enter the parameter name (e.g.,
page)
- Enter the parameter value (e.g.,
{{current.page_number}})
Example:
| Parameter | Value |
|---|
| limit | 10 |
| offset | {{step_1.output.offset}} |
| sort | created_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:
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 Case | Configuration Tips |
|---|
| CRM integration | POST customer data to Salesforce, HubSpot, etc. |
| Email service | POST to SendGrid, Mailchimp for transactional emails |
| Slack notifications | POST workflow results to Slack webhooks |
| Data enrichment | GET additional data from Clearbit, FullContact |
| Custom backend | Connect to your own APIs for business logic |
| Webhook triggers | POST 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:
| Parameter | Value |
|---|
| page | {{current.page}} |
| per_page | 50 |
Use with a Loop block to iterate through pages.
Troubleshooting
| Error | Cause | Solution |
|---|
| Security violation | Non-HTTPS URL | Change URL to use https:// |
| 401 Unauthorized | Invalid or missing auth | Check Authorization header value |
| 403 Forbidden | Insufficient permissions | Verify API key has required access |
| 404 Not Found | Invalid endpoint URL | Verify the API endpoint path |
| 429 Too Many Requests | Rate limit exceeded | Add retries or reduce request frequency |
| Timeout | API too slow | Check if API is responsive, consider async patterns |
| Invalid JSON | Malformed request body | Validate JSON syntax in body field |
What’s Next
Now that you understand the Call API block: