The webhook integration sends data about phishing simulation events and training events to an endpoint that you select. The platform sends each event as it occurs. This article tells you how to set up and test the webhook, how events are delivered, and which events you can receive.
Table of contents:
- Webhook Overview
- Before you start
- Webhook Setup
- Test the webhook
- How events are delivered
- Webhook Triggers
- Change or deactivate the webhook
- Frequently asked questions
Webhook Overview
A webhook is an HTTP request that the platform sends to your system when an event occurs, for example when an employee clicks the link in a simulated phishing email or completes a training module. Each request contains the data of one event in JSON format. You can use this data in your own tools, for example in a reporting tool, a ticket system or a security monitoring system.
You can receive eight events: four for phishing simulations and four for training. See Webhook Triggers.
Before you start
- A paid subscription. On a free tenant, the Configure button is locked.
- The Platform Super Admin or Platform Admin role. Other roles do not see Integration Settings. If your platform is on a white-label domain that hides CanIPhish branded resources, only the Platform Super Admin sees Integration Settings.
-
An endpoint that:
- has a public HTTPS address,
- accepts HTTP POST requests with a JSON body,
- has no user name or password in its address.
The webhook is for one tenant, and a tenant has one webhook endpoint. If you manage more than one tenant, set up the webhook in each tenant.
Webhook Setup
- Sign in to the platform.
- Click Platform Settings in the sidebar, and then select Integration Settings. The CanIPhish Integrations window opens.
- In the Webhook row, select Configure:
- The Webhook Management window opens. In the Endpoint URL field, enter the HTTPS address of your endpoint.
- Optional: enter a name in Custom Header Name (Optional) and a value in Custom Header Value (Optional). The platform adds this header to each request. Use only letters, numbers and dashes. The name must have less than 30 characters, and the value must have less than 100 characters.
- Below Event Triggers, clear the checkbox of each event that you do not want to receive. All eight events are selected by default. Scroll the list to see all events.
- Select Activate Webhook:
The message The webhook has been activated! shows, and Webhook Status changes to Active. The platform now sends each selected event to your endpoint.
The Header Name and Header Value fields show a header that the platform adds to each request: the name is Tenant-ID, and the value is the ID of your tenant. You cannot change these fields. The image above shows a sample value; your window shows the ID of your own tenant.
If the message There was an error updating the webhook. shows, the platform did not accept the address. Make sure that the address is complete, starts with https://, and is an address that the public internet can connect to.
Test the webhook
You can send a sample of each event to your endpoint. The webhook must be active.
- In the Webhook Management window, select an event in the Preview Event list. The window shows a sample of the JSON payload of this event, and a description of each field.
- Select Send Test Event:
If your endpoint accepts the request, the message The test event was successfully delivered! shows. A test event contains sample data, not the data of your employees.
- Error - Connection Failure: your endpoint did not send a success response (HTTP status 2xx). Examine the logs of your endpoint.
- Error: the platform could not connect to your endpoint. Make sure that the address is correct and that your endpoint is available.
- Error - Invalid Endpoint URL: the address is not a valid address. Correct the Endpoint URL field, and select Update Configuration.
- Error - Too many tests have been conducted.: the number of test events for a tenant has a limit. Contact our support team.
How events are delivered
- Request. Each event is one HTTP POST request with a JSON body. The request has the Tenant-ID header and, if you set one, your custom header.
- Time. The platform sends most events some seconds after they occur. Two events are different: Phishing - Email Reported and Training - Assignment Overdue. See Webhook Triggers.
- Response. Your endpoint must send a success response (HTTP status 2xx) in less than 30 seconds. The platform does not follow redirects.
- No second attempt. The platform sends each event one time. If your endpoint is not available or does not accept the request, the platform does not send the event again.
- Many events at the same time. Many events can occur in a few seconds, for example when the training of many employees becomes overdue on the same day. Each event is a separate request. Make sure that your endpoint can receive many requests at the same time.
- Daily limit. The platform sends a maximum of 500 events to your endpoint each day. The day starts at 00:00 UTC. The platform does not send events above this limit, and it does not keep them for the next day. A request to which your endpoint does not send a success response is also included in the count. Test events are not included.
- Payload. The payload does not contain the name of the event. To see the fields of each event, use the Preview Event list in the Webhook Management window.
- Source. The requests do not come from fixed IP addresses. To make sure that a request is from the platform, set a custom header with a value that only you know, and examine this header in your endpoint.
The Last Push line in the Webhook row of the CanIPhish Integrations window shows the time since the last event was sent. The platform does not show a list of sent events.
Webhook Triggers
The webhook has eight event triggers.
Phishing events
- Phishing - Email Reported: an employee reports an email that is not a simulated phishing email from the platform. The payload contains data about the reported email, for example the sender, the subject and the reporter. When an employee reports a simulated phishing email, the platform does not send this event. If the automatic analysis of reported emails is on in your tenant, the platform sends the event after the analysis, and this can take some minutes.
- Phishing - Payload Clicked: an employee clicks the link in a simulated phishing email. The platform sends this event one time for each employee in each campaign, at the first click.
- Phishing - Employee Compromised: an employee does an action on the phishing website of a simulated phishing email, or opens the attachment of the email. The platform sends this event one time for each employee in each campaign.
-
Phishing - Delivery Failed: the platform cannot deliver a simulated phishing email to an employee. The DeliveryFailureReason field contains one of these values:
- Failure - Domain Not Verified
- Failure - Email Quota Exceeded
- Failure - Connection To SMTP Server Was Rejected
- Failure - Email Bounced
- Failure - Authentication To Microsoft Unsuccessful
- Failure - Employee Not Found In Microsoft 365
- Failure - Employee Not Found In Google Workspace
- Failure - Microsoft 365 Admin Consent Missing
- Failure - Mailbox Inactive Or Not In Exchange Online
- Failure - Microsoft 365 Delivery Error
Training events
- Training - Assignment Complete: an employee completes an attempt of a training module and passes. The Status field is "Complete". If an employee does a passed module again and passes again, the platform sends the event again.
- Training - Assignment Failed: an employee completes an attempt of a training module and does not pass. The Status field is "Failed". The platform sends this event for each failed attempt.
- Training - Assignment Overdue: an employee did not complete a training module before its due date. The Status field is "Overdue". The platform sends this event one time, during the daily training update on the day after the due date.
-
Training - Assignment Error: the platform cannot assign a training module to an employee, or an assignment waits. The Status field contains one of these values:
- Error - Maximum Quota Hit: your subscription has no more training licenses for this employee. This value can also arrive as "Error - Maximum quota hit", so compare it without a check of capital letters.
- Error - Domain Not Verified: the domain of the email address of the employee is not verified in your tenant.
- Error - Pending Assignment: the platform started to assign the module to a new employee of a training campaign. This is a waiting state, not a failure.
The training events contain the number of attempts, the best score, the passing score, the assigned date and the due date of the assignment.
Change or deactivate the webhook
- To change the endpoint, the custom header or the events: open the Webhook Management window, make the change, and select Update Configuration. The message The webhook has been updated! shows.
- To stop the webhook: open the Webhook Management window and select Deactivate Webhook. The message The webhook has been deactivated! shows, and Webhook Status changes to Inactive. The platform keeps your configuration, so you can select Activate Webhook again later.
Events that occur while the webhook is inactive are not sent later.
Frequently asked questions
- My endpoint was not available. Can the platform send the missed events again? No. The platform sends each event one time. To get the data that you missed, use the API: see API Documentation.
- Can I get the events of campaigns that were complete before I activated the webhook? No. The webhook sends only the events that occur while it is active. Use the API to get data of earlier campaigns.
- How do I know which event a request contains? The payload has no field with the name of the event. Use the fields of the payload, for example Status for training events and DeliveryFailureReason for a delivery failure. The Preview Event list shows the fields of each event.
-
Some events did not arrive in my system. Why? Make sure of these points:
- Webhook Status is Active, and the checkbox of the event is selected.
- Your endpoint can receive many requests at the same time, and sends a success response in less than 30 seconds.
- Your tenant did not reach the daily limit of 500 events.
Comments
0 comments
Please sign in to leave a comment.