HTTP endpoint on your system to let you know about the event.
You can find the full list of webhook events in this Webhooks reference.
Argyle webhooks are delivered from four static IP addresses:
34.27.251.22634.122.50.25335.188.163.11535.226.53.251
Subscribing to webhooks
Using the API
The webhook events you subscribe to are delivered for all accounts. Each time a new account is connected or an existing one is updated, a corresponding webhook will notify your system.- You can subscribe to webhooks by sending a POST request to Argyle’s webhooks endpoint with the event name you want to subscribe to. This Webhooks reference contains the list of examples for all webhook subscription calls.
- To subscribe to all webhooks, use an asterisk for events:
"events": "*".
Subscribing to the activities.fully_synced webhook:
secret parameter when subscribing to webhooks. You will use this value during signature validation to determine the authenticity of the webhook.
- For example, if you subscribe to the
activities.fully_syncedwebhook, every time all activities have finished syncing during the initial scan, the specified url will be invoked with the JSON payload specific to that event.
Example payload for activities.fully_synced:
Using Console
Visit the Webhooks tab in the Developers section of Console to view and manage your existing webhook subscriptions as well as create new ones.Signature validation
When you subscribe to a webhook, you may choose to include asecret to ensure the authenticity of the webhooks you receive. If you do, each webhook you receive will include a signature in the header that you can use to verify that the webhook is genuine.
To verify the authenticity of a webhook, directly encode the received payload body without any added adjustments by using HMAC-SHA512 with the secret that you provided when subscribing to the webhook as the secret key. If the encoded payload matches the signature in the header, you can be confident that the webhook and its payload are genuine.
Signature example
For example, if yoursecret was my little secret, you would expect the following signature:
Verification example in Node
Verifying webhook authenticity via IP address is not recommended and should only be used as a fallback method, given the addresses may change in the future.
Account connection status
If an account becomes disconnected, some events will not trigger their associated webhook until the account connection is re-established.- Check the account object’s
connection.statusattribute to see if an account is connected. - You can also subscribe to the
accounts.updatedwebhook to be notified when an account becomes disconnected, as the account object’sconnection.statuschanging fromconnectedtoerrortriggers theaccounts.updatedwebhook.
When subscribing to the
accounts.updated webhook, setting include_resource to true allows you to view the account object directly in the webhook payload.Example: Keeping activities synced between your server and Argyle’s API
Webhooks can help you to keep all activity data downloaded on your servers and synced with the Argyle API:-
Subscribe to
activities.fully_syncedto get notified when the initial account sync of all historical data is finished. Whenever the webhook is invoked, query the activities from the API with the following query:/activities?from_start_date=available_from&account=account_id&to_start_date=available_towhereaccountis the account ID, andavailable_fromandavailable_toare timestamps from the webhook payload. -
Subscribe to
activities.addedto get notified when new activities are added after the initial sync. Argyle scans all accounts periodically for new activities and other changes in data. Use the same API call, but withadded_fromandadded_totimestamps from the webhook payload. -
Subscribe to
activities.updatedto get notified when existing activities change. An example of this would be when additional information about a completed activity is passed along at a later time (e.g. tips for a completed delivery or ride). The webhook payload provides the date range that was updated (updated_fromandupdated_to) along with an array of activity IDs that were updated (updated_activities) to make syncing of the data more convenient. -
Subscribe to
activities.removedto get notified when activities are removed by a payroll provider. This webhook is an indication to make sure that the activities are removed from your database to avoid duplicate data for a specific account. The webhook payload provides the date range when activities were removed (removed_fromandremoved_to), the number of activities that were removed (removed_count), along with an array of activity IDs that were removed (removed_activities).