Webhooks
Page functionality described in detail
Overview
StackOne allows configuring to establish event communication between your application and StackOne servers. After creating a webhook, you can test them by specifying:
Webhook Listing
Navigate to the webhook section by going to https://app.stackone.com/webhooks. On that section you can:
-
view any configured webhook and clickthrough to update their configuration
-
copy the signing secret to use in your codebase accordingly
-
create a new webhook
Setting up a new webhook
-
After selecting a StackOne project, you will see the
Webhooks
section in the left-hand-side menu. -
Create and configure a new webhook by clicking the
Add Webhook
button -
Input in the
Webhook URL
field a valid URL that StackOne should send a request to whenever one of the previously selected event occurs. -
Select the events that your webhook should be triggered on (native or synthetic events)
-
Native events: are events generated by the underlying provider which are then associated with a StackOne unified event/resource, parsed and forwarded to the configured webhook URL. Subscribing to native event will, once the configuration saved, programmatically create an event subscription for each current and future linked account of the selected provider
-
Synthetic Events: StackOne periodically polls the underlying provider records every hour and comparing stored hashes. The poll time can be adapted based on your needs and no PII is stored as part of this process.
-
-
Finally, click on the
Save Webhook
button. You should now see your newly configured Webhook on thewebhooks
page. -
Take note of the webhook secret displayed in the webhook listing page as it will allow you to authenticate more securely webhooks coming from StackOne
- As a relatively less secure but simpler alternative, you can also authenticate events sent by StackOne by adding a custom query parameter to your webhook URL eg
?token=unique_secret_token
and verify this parameter’s presence when receiving the request.
- As a relatively less secure but simpler alternative, you can also authenticate events sent by StackOne by adding a custom query parameter to your webhook URL eg
Overview Tab
The overview tab shows you at a glance the number of events sent to the configured webhook URL within the timeframe selected on the right-hand side (whether these events were successfully sent or if the request to the configured webhook URL failed)
Events Tab
Account Events
Account Events are events originating from StackOne related to a linked account connection and not to any underlying resource (eg: employee or candidates). Account events can be useful for your application/server to be notified of any new Accounts being linked (account.created
event) or updated (account.updated
) allowing you to trigger relevant workflow on your end (eg. syncing data from the underlying tenant).
Unified Events
The Events tab of the webhook configuration allows you to view and update the unified events this webhook is subscribed to. Any “green” in the table indicates that the webhook is currently subscribed to native or synthetic event for one or more underlying provider. Anything in orange represent an event subscription that has been modified but not yet saved.
Health Tab
The health tab of the new webhook allows you to see at a glance the status of each underlying native webhook subscription for each linked account
event
list and associated record_type
Category | Resource | Events |
---|---|---|
Accounts | Accounts | account.created , account.updated , account.deleted |
HRIS | Employees | hris_employees.created , hris_employees.updated , hris_employees.deleted |
Employments | hris_employments.created , hris_employments.updated , hris_employments.deleted | |
ATS | Assessments | ats_assessments.created , ats_assessments.updated , ats_assessments.deleted |
Candidates | ats_candidates.created , ats_candidates.updated , ats_candidates.deleted | |
Applications | ats_applications.created , ats_applications.updated , ats_applications.deleted | |
Interviews | ats_interviews.created , ats_interviews.updated , ats_interviews.deleted | |
Jobs | ats_jobs.created , ats_jobs.updated , ats_jobs.deleted | |
Job Postings | ats_job_postings.created , ats_job_postings.updated , ats_job_postings.deleted | |
Lists | ats_lists.created , ats_lists.updated , ats_lists.deleted | |
Users | ats_users.created , ats_users.updated , ats_users.deleted | |
CRM | Accounts | crm_accounts.created , crm_accounts.updated , crm_accounts.deleted |
Contacts | crm_contacts.created , crm_contacts.updated , crm_contacts.deleted | |
LMS | Assignments | lms_assignments.created , lms_assignments.updated , lms_assignments.deleted |
Completions | lms_completions.created , lms_completions.updated , lms_completions.deleted | |
Content | lms_content.created , lms_content.updated , lms_content.deleted | |
Courses | lms_courses.created , lms_courses.updated , lms_courses.deleted | |
Users | lms_users.created , lms_users.updated , lms_users.deleted |
Note:
The webhook settings such as URL
and Events
can be updated at any point after creating the webhook by returning to the Webhooks page and clicking on the webhook you would like to update.
You can also delete the webhook if it’s no longer needed (irreversible action).
Testing Webhooks
Example Payload
Accounts-based webhooks will follow the following interface:
Account event (account.updated) example
Employee Synthetic Event (employee.updated) example
Job Postings Native Event (job_postings.updated) example
A x-stackone-signature
header will be added to all webhook requests, e.g.,'x-stackone-signature': 'jqzLV78Lkg5RhZgx6nRA1FLIYBkqoclBdRrNizjlZcU'
. This header will contain a hmac sha256
hash of the given payload using the Signature Secret
previously given as a secret key during hashing.
3rd party Webhook generators:
You can easily test the account-based webhooks by using a third-party webhook creation tool such as https://webhook.site or https://typedwebhook.tools/ or by setting-up a proxy to your localhost via ngrok.
StackOne is not affiliated with these websites.
Sample Webhook consumer code
Signing Secret Rotation
You can rotate the webhook signing secret by following this process
-
Create a new signing secret by clicking on the existing secret to view and click with the
Add Signing Secret
buttonThe new signing secret will be flagged as inactive and requests sent to your webhook URL will only be signed with the active signing secret
-
In StackOne: Copy this new (currently inactive) signing secret value
-
In your own codebase:update the verification logic to verify the request with both the current secret and the new one copied in the previous step.
-
In StackOne: Activate the new webhook signing secret by clicking on it and confirming the activation. Once activated all requests sent to your webhook URL by StackOne will be signed using this new secret.
-
In StackOne: Once you’ve verified that new requests are being verified as expected, you may delete the old secret. You will not be able to retrieve it or activate it again once deleted.
-
In your own codebase: remove the logic responsible for verifying the request with the now inactive / deleted signing secret
Was this page helpful?