HTTP Requests
The HTTP Request step lets a workflow call an external API, such as your CRM, an analytics platform, a chat tool's incoming webhook or your own backend. You supply the URL, headers and body for each service. These are general HTTP calls, not native integrations. The step is available on the Pro and Enterprise plans.
Overview
HTTP Request steps can:
- Call external APIs with any HTTP method
- Send survey data to your systems
- Receive responses and map them to workflow parameters
- Chain requests using data from previous responses
Configuration
HTTP Methods
- GET
- POST
- PUT
- PATCH
- DELETE
Use for: Retrieving data
GET https://api.example.com/customers/{{contact.id}}
Example: Fetch customer tier before survey
Use for: Creating records, sending data
POST https://api.example.com/surveys
Example: Send survey response to CRM
Use for: Updating/replacing records
PUT https://api.example.com/customers/{{contact.id}}
Example: Update customer profile
Use for: Partial updates
PATCH https://api.example.com/customers/{{contact.id}}
Example: Update specific fields
Use for: Removing records
DELETE https://api.example.com/records/{{params.recordId}}
Example: Remove temporary data
URL Configuration
Enter the full endpoint URL. Variables are supported:
https://api.example.com/customers/{{contact.id}}
https://crm.company.com/surveys/{{survey.id}}/responses
https://hooks.slack.com/services/T00/B00/XXXX
Headers
Add custom HTTP headers for authentication and content types:
| Header | Example | Purpose |
|---|---|---|
Authorization | Bearer YOUR_API_TOKEN | API authentication |
Content-Type | application/json | Request body format |
X-API-Key | your-api-key | API key authentication |
Accept | application/json | Expected response format |
Adding Headers:
- Click Add Header
- Enter the header name (key)
- Enter the header value (supports variables)
Request Body
For POST, PUT, and PATCH requests, configure the request body:
{
"surveyId": "{{survey.id}}",
"score": {{survey.score}},
"respondent": {
"email": "{{contact.email}}",
"name": "{{contact.name}}"
},
"completedAt": "{{survey.completed_at}}",
"customTier": "{{params.customerTier}}"
}
- Strings must be quoted:
"{{contact.email}}" - Numbers should not be quoted:
{{survey.score}} - Booleans should not be quoted:
{{params.isActive}}
Response Mapping
Extract values from the API response and store them as workflow parameters:
Mapping Configuration
| JSON Path | Parameter Name | Description |
|---|---|---|
$.data.customerId | customerId | Extract customer ID |
$.status | apiStatus | Extract response status |
$.data.tier | customerTier | Extract tier value |
JSON Path Syntax
$ → Root object
$.property → Direct property access
$.data.nested → Nested property access
$.items[0] → Array index access
$.items[*].id → All IDs from array
Example Response:
{
"customer": {
"tier": "gold",
"points": 1500
}
}
Mapping:
| JSON Path | Parameter | Result |
|---|---|---|
$.customer.tier | customerTier | "gold" |
$.customer.points | loyaltyPoints | 1500 |
Common Recipes
Each tab is an HTTP Request step you configure yourself. Read Third-party API recipes before you use one.
- CRM
- Slack
- Analytics
- Your Backend
Send to CRM
// POST https://api.crm.com/contacts/{{contact.id}}/surveys
{
"surveyId": "{{survey.id}}",
"score": {{survey.score}},
"completedAt": "{{survey.completed_at}}"
}
Response Mapping:
$.contactId → params.crmContactId
$.status → params.syncStatus
Send Slack Notification
// POST https://hooks.slack.com/services/T00/B00/XXX
{
"text": "New survey response!",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Score:* {{survey.score}}\n*From:* {{contact.email}}"
}
}
]
}
Track Analytics Event
// POST https://api.analytics.com/events
{
"eventName": "survey_completed",
"userId": "{{contact.id}}",
"properties": {
"surveyId": "{{survey.id}}",
"score": {{survey.score}},
"channel": "email"
}
}
Webhook to Backend
// POST https://api.yourcompany.com/webhooks/survey
{
"event": "survey.completed",
"data": {
"surveyId": "{{survey.id}}",
"collectorId": "{{survey.collector_id}}",
"respondent": {
"id": "{{contact.id}}",
"email": "{{contact.email}}"
},
"score": {{survey.score}},
"timestamp": "{{survey.completed_at}}"
}
}
Advanced Patterns
Chaining Requests
Use response from one request in subsequent requests:
- Step 1: Get Customer
- Step 2: Apply Discount
GET https://api.example.com/customers/{{contact.email}}
Response Mapping:
$.tier → params.customerTier
$.id → params.customerId
POST https://api.example.com/customers/{{params.customerId}}/discount
{
"tier": "{{params.customerTier}}",
"surveyScore": {{survey.score}}
}
Conditional API Calls
Use conditions to call different APIs based on data:
Error Handling
Check API response status in conditions:
Authentication Patterns
- Bearer Token
- API Key
- Basic Auth
- OAuth (Dynamic)
Headers:
Authorization: Bearer YOUR_API_TOKEN
Best for: Most REST APIs, OAuth tokens
In Header:
Headers:
X-API-Key: YOUR_API_KEY
In Query String:
URL: https://api.example.com/endpoint?api_key=YOUR_KEY
Headers:
Authorization: Basic BASE64_ENCODED_CREDENTIALS
Note: Encode username:password in Base64
Step 1: Get token
POST https://auth.example.com/oauth/token
Response Mapping:
$.access_token → params.accessToken
Step 2: Use token
Headers:
Authorization: Bearer {{params.accessToken}}
Third-Party API Recipes
Each recipe below is an HTTP Request step that you configure with the vendor's API address and your own credentials. Pollarix has no native connector for these services. The recipes follow each vendor's public API documentation and were not tested against live accounts, so check the vendor's current API reference before you rely on one.
- Paste a static API token directly into the header value. Pollarix encrypts HTTP Request step URLs and header values at rest and masks header values in execution logs. Request bodies are not encrypted, so keep secrets out of the body.
- A
{{params.*}}value exists only after an earlier step sets it, for example a response mapping from a lookup request. An unset variable is sent as an empty string. {{survey.score}}is the response's total score on a 0-100 scale, not a raw 0-10 answer.- Custom fields or properties a recipe writes to must already exist in your vendor account.
HubSpot Contact Update
Set params.hubspotContactId first, for example by mapping the ID from a HubSpot contact search in an earlier HTTP Request step.
PATCH https://api.hubapi.com/crm/v3/objects/contacts/{{params.hubspotContactId}}
Headers:
Authorization: Bearer YOUR_HUBSPOT_PRIVATE_APP_TOKEN
Body:
{
"properties": {
"last_survey_score": "{{survey.score}}",
"last_survey_date": "{{survey.completed_at}}"
}
}
Zendesk Ticket Creation
The header value is the Base64 encoding of you@example.com/token:YOUR_ZENDESK_API_TOKEN.
POST https://yoursubdomain.zendesk.com/api/v2/tickets.json
Headers:
Authorization: Basic BASE64_OF_EMAIL_TOKEN_AND_API_TOKEN
Body:
{
"ticket": {
"subject": "Survey Feedback - Score: {{survey.score}}",
"requester": {
"email": "{{contact.email}}"
},
"comment": {
"body": "Customer submitted survey with score {{survey.score}}"
}
}
}
Best Practices
Security
| Practice | Description |
|---|---|
| Keep secrets in headers | Put API tokens in header values, which Pollarix encrypts at rest and masks in execution logs. Request bodies are not encrypted |
| Use HTTPS | Always use encrypted connections |
| Validate responses | Check status before using data |
Performance
| Practice | Description |
|---|---|
| Keep requests minimal | Only send required data |
| Set timeouts | Configure for slow APIs |
| Handle errors | Use condition steps for error paths |
Debugging
- Check execution logs for request/response details
- Verify URL variables are resolving correctly
- Test endpoints independently first
- Validate JSON syntax before saving
Troubleshooting
Request Failed
| Error | Cause | Solution |
|---|---|---|
Connection refused | Invalid URL or server down | Verify endpoint URL |
401 Unauthorized | Missing/invalid auth | Check authentication headers |
403 Forbidden | Insufficient permissions | Verify API credentials |
404 Not Found | Wrong endpoint | Check URL path |
500 Server Error | Target API error | Check API server logs |
Response Mapping Failed
- Verify JSON path syntax
- Check response structure matches expected format
- Use
$for root access - Test JSON path in online validator
Variable Not Resolving
- Check variable exists and has value
- Verify spelling and case
- Ensure previous step completed successfully
Timeout Errors
- External API may be slow
- Consider async processing
- Check API rate limits
Next Steps
- Parameters - Store and use API response data
- Automations Overview - Full automation capabilities