Skip to main content
Webhooks let you send data from Ansa to your server in real-time. When a form is submitted or a conversation event occurs, Ansa sends an HTTP POST request to your endpoint with the event payload.

Quick Start

  1. Create an endpoint on your server to receive webhook payloads
  2. Configure the webhook URL in your tool settings (dashboard or API)
  3. Handle incoming requests and process the data

Example Endpoint (Node.js / Express)

Form Submission Webhooks

When a form is submitted, Ansa sends the data to your configured webhook URL.

Payload Structure

Payload Fields

Configuring Form Webhooks

Set the webhook URL when creating or updating a form tool: In the Dashboard:
  1. Go to AgentsTools
  2. Edit your form tool
  3. Under Post-Submission Actions, set the Webhook URL
Via API:

Execution Modes

Control how form submissions are processed:

Handling Webhook Requests

Basic Handler

Next.js API Route

Python (Flask)

PHP (Laravel)

Post-Submission Actions

Beyond the primary webhook, you can configure additional actions:

Slack Notifications

Send form submissions to a Slack channel:
Template variables:
  • {{fieldName}} — Value of the form field
  • {{_toolName}} — Name of the form tool

Multiple Webhooks

Send data to multiple endpoints:

Retry Logic

Ansa automatically retries failed webhook deliveries: After 5 failed attempts, the submission is marked as webhook_failed. You can:
  1. Fix your endpoint and manually retry from the dashboard
  2. Query failed submissions via API and reprocess

Checking Submission Status

Response Handling

Ansa records your webhook response for debugging:

Success Response

Return a 2xx status code:

Error Response

Non-2xx responses trigger a retry:

Timeout

Webhooks have a 30-second timeout. For long-running operations:
  1. Acknowledge immediately with 200
  2. Process asynchronously (queue, background job)

Integration Examples

HubSpot CRM

Airtable

Google Sheets (via Apps Script)

Deploy a Google Apps Script as a web app:

Best Practices

Respond quickly, process later. Acknowledge webhooks immediately with a 200 response, then process data asynchronously to avoid timeouts.
  1. Return 200 quickly — Acknowledge receipt before processing
  2. Use idempotency — Handle duplicate deliveries gracefully using submissionId
  3. Log everything — Store payloads for debugging
  4. Handle errors — Return appropriate status codes so Ansa can retry
  5. Secure your endpoint — Use HTTPS and consider IP allowlisting

Debugging

Check webhook delivery status in the dashboard:
  1. Go to Leads or Form Submissions
  2. Find the submission
  3. View Webhook Response for success/error details
You can also view the raw response your server returned.

Next Steps

Form Tools

Configure form tools with webhooks

Post Actions

Set up Slack and email notifications