Webhooks
Get notified instantly when new feedback arrives, gets updated, or is deleted. Hub sends HTTP POST requests to your endpoints, enabling real-time integrations and custom workflows.
What You Can Buildโ
Webhooks unlock powerful automation:
- ๐ข Send Slack notifications for low NPS scores or negative sentiment
- ๐ Trigger real-time dashboard updates
- ๐ Sync data to your data warehouse or CRM
- ๐ฏ Route urgent feedback to support teams automatically
- ๐ค Chain AI enrichment results into your own workflows
Configurationโ
Configure webhook URLs via the SERVICE_WEBHOOK_URLS environment variable:
# Single webhook
SERVICE_WEBHOOK_URLS=https://api.example.com/webhooks/hub
# Multiple webhooks (comma-separated)
SERVICE_WEBHOOK_URLS=https://api.example.com/webhooks,https://analytics.example.com/events
Add to your .env file:
SERVICE_WEBHOOK_URLS=https://your-domain.com/webhooks/hub
Then restart the service:
make dev
Event Typesโ
Hub sends webhooks for four types of events:
experience.createdโ
Triggered when new feedback is created via POST /v1/experiences.
Common use cases:
- ๐ข Send Slack notifications for low NPS scores
- ๐ Update real-time dashboards
- ๐ Start data processing pipelines
Note: For text responses, this event fires immediately when data is saved, before AI enrichment. Use experience.enriched to get the AI-enriched data.
experience.enrichedโ
Triggered when AI enrichment completes for text responses (sentiment, emotion, topics, embeddings).
Common use cases:
- ๐ค React to sentiment analysis results (e.g., alert on negative sentiment)
- ๐ท๏ธ Trigger workflows based on extracted topics
- ๐ Route feedback by emotion to appropriate teams
- ๐ Update semantic search indexes
Note: This event only fires if you've configured SERVICE_OPENAI_API_KEY and the response has field_type: "text". The payload includes the complete enriched data with sentiment, sentiment_score, emotion, and topics.
experience.updatedโ
Triggered when feedback is manually updated via PATCH /v1/experiences/{id}.
Common use cases:
- ๐ Audit trail logging
- ๐ Sync manual changes to external systems
- ๐ Update cached analytics
experience.deletedโ
Triggered when feedback is deleted via DELETE /v1/experiences/{id}.
Common use cases:
- ๐งน Maintain data consistency across systems
- ๐ Update aggregated metrics
- ๐ Compliance logging (GDPR deletion tracking)
Event Payloadโ
All webhooks follow a consistent format:
{
"event": "experience.created",
"timestamp": "2025-10-15T12:34:56Z",
"data": {
"id": "01932c8a-8b9e-7000-8000-000000000001",
"collected_at": "2025-10-15T12:34:56Z",
"created_at": "2025-10-15T12:34:56Z",
"updated_at": "2025-10-15T12:34:56Z",
"source_type": "survey",
"source_id": "survey-123",
"field_id": "q1",
"field_type": "rating",
"value_number": 9,
"metadata": {
"country": "US"
},
"language": "en",
"user_identifier": "user-123"
}
}
Fields:
event(string): Event type -experience.created,experience.enriched,experience.updated, orexperience.deletedtimestamp(ISO 8601): When the event occurreddata(object): Complete experience record. Forexperience.enriched, includessentiment,sentiment_score,emotion, andtopics
Webhook Deliveryโ
Request Formatโ
Hub makes an HTTP POST request to each configured webhook URL:
POST /your-endpoint HTTP/1.1
Host: api.example.com
Content-Type: application/json
User-Agent: Formbricks-Hub/1.0
{
"event": "experience.created",
"timestamp": "2025-10-15T12:34:56Z",
"data": { ... }
}
Retry Logic & Reliabilityโ
Hub uses a worker pool architecture to ensure reliable webhook delivery:
- Worker pool: 10 concurrent workers process webhooks in parallel
- Attempts: Up to 3 retries per webhook
- Timeout: 5 seconds per request
- Backoff: Exponential delays between retries (1s, 2s, 4s)
- Success: Any 2xx HTTP status code
- Queue: Buffered queue with backpressure handling
Webhook delivery is fully asynchronous and never blocks API responses. If your webhook is slow or fails, it won't impact the user experience. Failed webhooks are logged for debugging.
The worker pool ensures Hub can handle high-volume webhook traffic without memory leaks, even if your endpoints are slow or temporarily unavailable.
Expected Responseโ
Your webhook endpoint should respond with a 2xx status code:
HTTP/1.1 200 OK
Content-Type: application/json
{"received": true}
Your webhook must respond within 5 seconds. For heavy processing, return 200 immediately and process the event asynchronously.
Next Stepsโ
- AI Enrichment โ - Understand when AI enrichment webhooks fire
- Data Model โ - Complete experience data schema
- Authentication โ - Secure your webhooks
- API Reference โ - Explore all endpoints