Search…
⌃K
Links

Webhooks

Tonic allows you to set up webhooks to fire HTTP POST requests when a data generation job completes successfully, fails, or is canceled.
The webhooks feature is only available for licenses at the Professional tier or above.
Webhooks enable Tonic to integrate more seamlessly into your workflow. These requests can pass information about the data generation run and trigger actions in other systems. For example, you can post a Slack notification.
Webhooks are only supported for data generation jobs. You cannot trigger a webhook after a sensitivity scan.
Child workspaces never inherit the webhooks configuration from their parent workspace. Child workspaces always have their own webhooks.
You manage webhooks from the Post-Job Actions view. To display the Post-Job Actions view, in the Tonic navigation pane, click Post-Job Actions.
Post-Job Actions page with webhooks

Creating a webook

To create a webhook, in the Webhooks panel, click Create Webhook.
Create Webhook option
On the webhook configuration dialog, you can set up, preview, and test the webhook.
To save the webhook, click Save. The webhook is added to the Webhooks list.

Configuring a webhook

Configuring the webhook settings and headers

On the Settings & Headers tab, you set the name, URL, triggering events, and custom headers for the webhook.
Settings & Headers tab of the webhook configuration dialog
  1. 1.
    In the WebHook Name field, provide a name for the webhook.
  2. 2.
    In the Webhook URL field, provide the URL to send the webhook request to.
  3. 3.
    Under Trigger Events, select the data generation job events that trigger the webhook. By default, the webhook is triggered when a job succeeds, a job fails, or a job is canceled. To not trigger a webhook in response to an event, uncheck the event checkbook. For example, to not trigger the webhook when a job is canceled, uncheck the Job Cancelled checkbox.
  4. 4.
    To configure custom headers for the webhook request:
    1. 1.
      To add a header row, click Add Header.
    2. 2.
      In the Header Name field for each header, provide the header name.
    3. 3.
      In the Header Value field for each header, provide the header value.
    4. 4.
      To remove a header row, click its delete icon.

Customizing the webhook request body

From the Message Body tab, you can customize the body of the request. The message body is sent as a JSON payload that consists of a set of keys and values.
Message Body tab of the webhook configuration dialog
By default, the message body contains the following keys and values. The values are variables that are replaced by the actual values for the triggering event. You can also use the variables in the values of other keys.
  • jobId - The identifier of the data generation job. To include the job ID in other key values, use the {jobId} variable.
  • jobStatus - The status of the data generation job. To include the job status in other key values, use the {jobStatus} variable.
  • workspaceId - The identifier of the workspace. To include the workspace ID in other key values, use the {workspaceId} variable.
  • workspaceName - The name of the workspace. To include the workspace name in other key values, use the {workspaceName} variable.
To add a key and value:
  1. 1.
    Click Add Property.
  2. 2.
    In the Property Name field, provide the key name.
  3. 3.
    In the Property Value field, provide the value. You can include the variables in the value. For example, the following value includes the job identifier, workspace identifier, and job status: Data generation job {jobId} for workspace {workspaceId} completed with a status of {jobStatus).
To remove a key, click its delete icon.

Previewing the request JSON

The Preview tab contains a preview of the JSON body of the request. In the preview, the variables are replaced by sample values.
Preview tab of the webhook configuration dialog
To copy the JSON to the clipboard, click Copy to clipboard. You can then, for example, use the copied JSON to test the webhook request in another tool such as Postman.

Testing the webhook

From the webhook configuration dialog, you can send a test request. The test request includes the configured headers and message body. The message body uses sample values for the variables.
To send a test request, click Test Webhook.

Editing a webhook

To edit a webhook:
  1. 1.
    In the Webhooks list, click the edit icon for the webhook.
  2. 2.
    On the webhook configuration dialog, update the webhook configuration.
  3. 3.
    Click Save.

Deleting a webhook

To delete a webhook:
  1. 1.
    In the Webhooks list, click the delete icon for the webhook.
  2. 2.
    On the confirmation dialog, click Delete.

Enabling and disabling webhooks

You use the toggle at the left of each webhook to determine whether the webhook is enabled.
When the toggle is in the on position, the webhook is enabled. It is triggered by the selected generation job statuses.
When the toggle is in the off position, the webhook is not enabled, and is not triggered by the selected generation job statuses.