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.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:
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:- Click “Add header”
- Enter the header name (e.g.,
Authorization) - Enter the header value (e.g.,
Bearer {{api_token}})
Headers support placeholders for dynamic values:
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}})
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:Retry Attempts
Configure automatic retries for failed requests.- Minimum: 0 (no retries)
- Maximum: 3 retries
- Default: 0
- 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:Error Response
When the API returns an error (4xx or 5xx status), the output contains error details: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
Example: Slack Notification
Send workflow results to a Slack channel: Method: POST URL:https://hooks.slack.com/services/xxx/yyy/zzz
Body:
Example: Fetching Paginated Data
Retrieve data from a paginated API: Method: GET URL:https://api.example.com/items
Query Parameters:
Use with a Loop block to iterate through pages.
Troubleshooting
What’s Next
Now that you understand the Call API block:- Learn about Loop Block to process paginated API responses
- See LLM Block to analyze API response data
- Explore Google Sheets Block to store API results
- Check Liquid Templating for data transformation