Using Webhooks with Livespace
Webhooks are HTTP notifications sent to your application in real time when specific events occur in the Livespace CRM. They use a push model to notify you of events, so you don't have to periodically request ("poll for") the latest changes.
Because they're lightweight, Webhooks are a good way to get notifications about changes. You can integrate them into your application easily, and they scale as you grow.
How it works
To receive Webhooks, you must first create a Subscription. A Subscription is a configuration where you define:
- The Endpoint URL that will receive the notifications.
- The specific Triggers you want to be notified about.
- A Secret used to verify the authenticity of the Webhooks you receive.
When an event you've subscribed to occurs, Livespace sends a Webhook (an HTTP POST request) to your Endpoint. This Webhook contains a payload with details about the event. Your application can then use this data to respond.
For example, when a new deal is created, Livespace can send a deal.created Webhook to your Endpoint. Your application can then parse the JSON payload and react accordingly.
Endpoint verification (Handshake)
The first time you activate a Subscription or reactivate an existing one, Livespace automatically verifies your Endpoint. It does this by sending a POST request with an empty body to your Endpoint URL. This process is known as a handshake.
Your Endpoint must respond with a 200 OK or 204 No Content status code within 3 seconds. This confirms that your URL is active and ready to receive Webhooks.
After your Endpoint is verified, Livespace activates the Subscription.
Responding to Webhooks
After you set up and verify a Subscription, Livespace starts sending Webhooks for your configured Triggers. Your Endpoint must respond to each Webhook with a 200 OK or 204 No Content to confirm successful delivery.
Every Webhook includes an X-Livespace-Signature header. We strongly recommend verifying this signature to ensure the request is genuine. See the Security guide for more details.
Delivery policy
Retry policy
If Livespace doesn't receive a successful response, it automatically attempts to redeliver the Webhook.
- Maximum attempts: 3 (Initial attempt + 2 retries)
- Strategy: Exponential backoff
- Intervals: 1 minute, then 5 minutes
Each delivery attempt is logged, and statistics are available in the Subscription details within the Livespace interface.
Timeout
Livespace waits a maximum of 3 seconds for a response from your Endpoint. If your server takes longer to respond, the delivery is considered a failure and will enter the retry queue.
Supported Triggers
For detailed information on the supported triggers and data sent with these Triggers, see the Schema Reference documentation.