Skip to main content

What does the HTTP Request block do?

The HTTP Request block lets your bot call any external API mid-conversation — look up data, submit forms, trigger webhooks, or integrate with your own backend systems. Use it to:
  • Fetch real-time data (order status, product availability, appointment slots)
  • Submit collected contact data to your CRM or database
  • Trigger webhooks in tools like Zapier, Make, or your own systems
  • Post to internal APIs for order creation, ticket submission, etc.

Overview

HTTP Request block configuration panel showing Method, URL, Request Headers, Request Body, and Saves Response fields alongside the flow builder canvas The HTTP Request block appears as a node in the flow builder canvas. When selected, the configuration panel opens on the right side, showing all the settings you can configure. The block has two output paths — a success path (green dot) for 2xx responses and an error path (red dot) for failures.

Configuration

Method

Select the HTTP method: GET, POST, PUT, or PATCH. Use GET for data lookups, POST/PUT/PATCH for submitting or updating data.

URL

The full URL of the endpoint to call. You can include contact attribute variables in the URL:
https://api.yourcompany.com/orders/{{contact.order_number}}

Request Headers

Add request headers as key-value pairs. Click + Add Key to add a new header row. Common headers:
KeyExample value
AuthorizationBearer your_api_token
Content-Typeapplication/json
X-Api-Keyyour_api_key

Request Body

For POST/PUT/PATCH requests, enter the request body as JSON. Use {{}} to insert contact attributes collected earlier in the flow:
{
  "name": "{{contact.name}}",
  "phone": "{{contact.phone}}",
  "inquiry": "{{collected_inquiry}}",
  "source": "whatsapp_bot"
}

Save response

Optionally save the API response to a contact or conversation attribute. Click + Add Variable in the Saves response section and provide:
  • Object path — dot-notation path to the value in the response (e.g., data.status)
  • Variable — the attribute name to save the value into (e.g., order_status)
If the API returns:
{ "data": { "status": "shipped", "tracking": "1Z999..." } }
Then {{order_status}} will be set to "shipped" for use in later blocks.

Error handling

If the HTTP request fails (non-2xx status code or network error), the flow follows the error path (red dot) from the HTTP Request block. Connect a Message block to the error path to show the user a friendly fallback message:
Sorry, I couldn't retrieve your order details right now.
Please try again or contact us at support@yourcompany.com.
If no error path is connected, the flow stops silently on failure.

Example: Look up order status

Setup:
  1. Use a Collect Input block to ask “What’s your order number?” and save to order_number.
  2. Add an HTTP Request block:
    • Method: GET
    • URL: https://api.yourstore.com/orders/{{order_number}}
    • Header: Authorization: Bearer YOUR_TOKEN
    • Save response: object path status, variable order_status
  3. Add a Message block on the success path: “Your order {{order_number}} is currently: {{order_status}}.”
  4. Connect an error path with: “Sorry, I couldn’t find that order. Please check the number and try again.”

Tips

  • Test with a request bin — use a service like webhook.site to inspect what Swiftsell sends before connecting a real API.
  • Keep response paths simple — deeply nested paths (e.g., data.orders[0].items[0].status) may not be supported. Design your API to return flat, simple objects where possible.
  • Handle timeouts — if your API is slow, consider an async pattern (trigger an async job and poll for results in a later flow).
  • Always connect both paths — wire up both the success (green) and error (red) output paths so your flow handles every case gracefully.