Getting Started With Webhooks
This guide will help you get started with receiving webhooks from the Keka platform.
Webhooks are a way of receiving information from Keka by getting it "pushed" to you, as opposed to continually making requests ("polling") to the Keka API for updates. For example, one way to use webhooks would be to receive a notification every time an expense is created or approved.
Requirements
To get started with Webhooks, You will need the following
- A public-facing endpoint (URL) for us to POST webhooks to.
Set up is webhook endpointTo access event triggers in Keka, follow these steps:
- Log in to Keka as a privileged user with the manage event triggers permission.
- Navigate to "Settings > communications > Event Triggers."
Adding a Webhook Action to an Event Trigger
- To configure a webhook for an event trigger, follow these steps:
- Access the desired event trigger from the event triggers page.
- Click on "+Add Action."
- Select "Webhook" from the drop-down menu.
- Provide a name for the webhook action.
- Specify the URL to which the webhook will post the JSON object representation of the event.
- Optionally, add additional headers and header values for the webhook request.
- Click "Add" to create the webhook action.
The POST will include following form-encoded parameters:
Parameter | Description |
---|---|
employeeIndentifier | Unique identifier of the employee |
eventType | Type of the triggered event (Leave requested, expense approved, employee added, employee exit approved, etc) |
subDomain | Name of the organisation as per URL |
Webhook Formats
EmployeeSalaryUpdated - Occurs when salary is updated to an employee.
{
"employeeName": "Ross Geller",
"employeeNumber": "1234567890098765432",
"previousSalaryAmount": 777777777777,
"updatedSalaryAmount": 45321234,
"previousBonusAmount": 0,
"updatedBonusAmount": 1234567,
"previousEffectiveDate": "Mar 01, 2023",
"updatedEffectiveDate": "Oct 21, 2024",
"note": "SDS",
"updatedBy": "Lekshmi Dev M",
"updatedOn": "Oct 24, 2024",
"currencyCode": "INR",
"subDomain": "salesdemo.keka.com",
"eventType": "EmployeeSalaryUpdated"
}
leaverequestcreated - Occurs when an employee requests for leave.
{
"employeeIdentifier": "f4665612-0efc-4f7e-8d88-8c4d3b328f13",
"displayName": "Ross Geller",
"jobTitle": "Senior Quality Engineer",
"reportsTo": {
"id": "d6baa8f5-3078-4165-b431-bcd1d9e5df1c",
"displayName": "Lekshmi Dev M"
},
"l2Manager": {
"id": "487275b8-1655-43b1-918f-93724a9e2ab8",
"displayName": "Anshul Jain"
},
"department": "Hyderabad",
"location": "New Delhi",
"fromDate": "24 Oct, 2024",
"toDate": "27 Oct, 2024",
"fromDateDay": "Thursday",
"toDateDay": "Sunday",
"duration": "2 days",
"leaveNote": "Happy Birthday Leave",
"leaveReason": null,
"leaveType": "Birthday Leave",
"requestedOn": "24 Oct, 2024",
"leaveDates": "Thursday, 24 October 2024(Second half) - Sunday, 27 October 2024(First half)",
"showHourlyDetails": false,
"hourlyDetails": [],
"leavePeriod": "Oct 24, 2024 (Second half) to Oct 27, 2024 (First half)- 2 day",
"subDomain": "salesdemo.keka.com",
"eventType": "leaverequestcreated"
}
exitCancelled - Occurs when employee exit has been cancelled post exit approval and during the exit process.
{
"displayName": "Ross Geller",
"employeeNumber": "1234567890",
"employeeIdentifier": "45845eab-5hdfru33c-5jvvce422143-yr34567",
"workEmail": "[[email protected]](mailto:[email protected])",
"personalEmail": "[[email protected]](mailto:[email protected])",
"mobilePhone": "9399473721",
"workPhone": "1234567890",
"residencePhone": "null",
"requestedOn": "24 Oct, 2024",
"exitReason": "Terminated",
"cancelledBy": "Lekshi Dev",
"cancelledOn": "24 Oct, 2024",
"departmentName": "Sales",
"locationName": "Bengaluru",
"reportsTo": "Sahith",
"l2Manager": "Vijay Y",
"jobTitle": "Senior Product Architect",
"subDomain": "salesdemo.keka.com",
"eventType": "exitCancelled"
}
Updated 3 months ago