Connection events

Subscribing to connection events using webhooks

Xkit can inform you when relevant events to connections for your application occur, such as when a connection is enabled, or disabled, or enters into an errored state.

Xkit's Connection Webhooks use the REST Hooks design pattern.

Webhooks are registered against specific event types, which are strings in the form of noun.verb.

When an event happens for which a webhook is registered, Xkit will make a POST request against the registered URL with a JSON body containing the event_type, and a payload.

Each event type has a specific payload it carries with it. These payloads by design carry only the minimum amount of data for you to identify the action that has taken place and query for additional data from the CRM API.

To subscribe to an event, navigate to the Connection Webhooks section on the settings page and click on Add Webhook.

Adding a Connection Webhook

Select the event you want to subscribe to, as well as which URL should be called when the event happens.

Your registered Webhook URL must respond to the Webhook with a 2XX response. If it fails for any reason, the Webhook will be retried with exponential backoff for an indeterminate number of total attempts.

Here's what a sample webhook request looks like:

POST /your/webhook/url HTTP/1.1
Accept: application/json
Host: your-domain.com
Content-Type: application/json

{
  "event_type": "connection.enabled",
  "payload": {
    "connector": {
      "slug": "salesforce-sales-cloud-crm"
    },
    "context": {
      "external_id": "jFGlE7LIClQ30kdcFXb5epTDetC2"
    },
    "connection": {
      "external_id": "79cfb3c3-777c-456b-af09-7aeb2b6178b2"
    }
  }
}

Ready to build your CRM app?

Integrate every CRM with one build, request access to get started.