Skip to main content

Summary

Use Chift’s webhooks to build custom applications that react to specific events from the platform and the unified APIs.

How can you manage your webhooks?

  • Manage webhooks through the UI in your account settings
  • Manage webhooks through the API

Technical specifications

When a specific event occurs, Chift sends a POST HTTP request to the webhook’s URL. The request contains a JSON payload with at least these mandatory attributes:
  • accountid: guid of your Chift’s account
  • event: name of the event
  • consumerid: guid of the consumer on which the event occurred
  • created: timestamp (in sec) of the webhook event
The header also contains the following encrypted Chift Signature:
  • X-Chift-Signature: encrypted signature of your body payload

List of events

Chift can emit the following events, grouped by domain. For the connection events, also see the Connection lifecycle section to understand when each one is sent.
Every webhook body includes accountid,event,consumerid,created, as described in Technical specifications. The payloads below show only the event-specific fields added in addition of those.
When a new consumer connection is created. You receive this event only when the connection is created successfully.

Additional fields on top of the common payload for this event:
  • connectionid: guid of the connection on which the event occurred
  • status: active/inactive
When a consumer connection is updated.
  • connectionid: guid of the connection on which the event occurred
  • status: active/inactive
When a consumer connection is deleted.
  • connectionid: guid of the connection on which the event occurred
  • status: active/inactive
When a local agent is correctly set up.
  • connectionid: guid of the connection on which the event occurred
When a local agent has not sent a ping in the last 15 minutes.
  • connectionid: guid of the connection on which the event occurred

X-Chift-Signature

Use the X-Chift-Signature attribute to verify that incoming calls on your webhook endpoint come from Chift. Chift generates the X-Chift-Signature from the signing secret that you can optionally add when you create or update a webhook. It uses the HMAC authentication method, which relies on two keys: the signing secret that only you know, and the request body. Most programming languages support HMAC hashes. For example, in Node.js:
For example, in Python:
By computing the hash on your endpoint, you can compare it with the X-Chift-Signature header attribute to confirm that the request originated from Chift.