Webhooks allow your application to be told when changes are made within a Deputy install automatically. After a webhook is setup, Deputy will send a POST request to your application with information about whatever has changed.
For example, if you setup a Webhook related to adding timesheets, every time a user adds a timesheet, you're application will be informed. This is especially useful for those who may want to offer as close to possible real time integrations with the Deputy system.
Almost every part of Deputy is available for a Webhook integration. Anything which is available as a Resource can have a Webhook applied to it.
For example you can have Webhooks related to timesheets being updated, employees being created, or sales being added just to name a few. Each type of action requires an individual Webhook to be setup. For example for your application to be informed when a timesheet is added or a timesheet is updated, that would be two Webhooks.
There is no limit to how many Webhooks you can setup per Deputy install.
Payload of webhook
Deputy will post the webhook to your server in a JSON format. The JSON will be an object which has a topic and data property: [topic => topic_name, data=> OBJECT or [OBJECT]]
Deputy will also add the following three headers:
- X-Deputy-Secret: Checksum of the data payload which is a sha256 hmac of the body, salted with a secret key. This is for Enterprise based installs. To get the private key from an enterprise install go to Enterprise -> Security Settings -> Private Key for API Signining in Deputy
- X-Deputy-Webhook-Callback: The resource URL of the webhook that generated this hook call
- X-Deputy-Generation-Time: Unix timestamp of when the webhook was sent.
Updated 19 days ago