Webhooks
Subscribe to events and receive real-time notifications when things happen in Fetchply.
What Are Webhooks?
Webhooks send HTTP POST requests to your server when events happen in Fetchply. Use them to build real-time integrations — update your CRM when a lead is captured, notify your team when feedback is received, or sync data with external systems.
Setting Up Webhooks
Create an Endpoint
Set up a URL on your server that can receive POST requests. The endpoint should:
- Accept
application/jsoncontent type - Return a
2xxstatus code to acknowledge receipt - Respond within 10 seconds
Subscribe to Events
Use the API to subscribe your endpoint to specific events:
curl -X POST https://fetchply.com/api/v1/hooks/subscribe \
-H "Authorization: Bearer fp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourserver.com/webhooks/fetchply",
"event": "new_lead"
}'Verify Signatures
Every webhook payload includes an HMAC-SHA256 signature for verification. Check the signature to ensure the request came from Fetchply.
Available Events
| Event | Description |
|---|---|
new_lead | A visitor submits their contact information |
new_message | A new message is sent in a conversation |
new_conversation | A new chat session starts |
feedback_received | A visitor rates a response |
training_completed | Agent training finishes |
agent_created | A new agent is created |
agent_deleted | An agent is deleted |
Webhook Payload
All payloads follow the same format:
{
"event": "new_lead",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"agentId": "agent_abc123",
"lead": {
"name": "Jane Doe",
"email": "jane@example.com"
}
}
}Retry Policy
If your endpoint fails to respond with a 2xx status:
- First retry — after 1 minute
- Second retry — after 5 minutes
- Third retry — after 30 minutes
After 3 failed attempts, the webhook is automatically deactivated. Resubscribe to restart delivery.
Make sure your endpoint responds quickly (within 10 seconds). Long-running processing should be done asynchronously after acknowledging the webhook.
Removing Webhooks
Unsubscribe from events when you no longer need them:
curl -X DELETE https://fetchply.com/api/v1/hooks/subscribe \
-H "Authorization: Bearer fp_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourserver.com/webhooks/fetchply",
"event": "new_lead"
}'