Time off events

The following events can be used to create Time off request Webhooks.

Working with Webhook v2 events

Explore our guide Getting started with Bob webhooks.

Time off Events

Time off Request EventTypeDescription
requestedtimeoff.request.requestedTriggered when submitting a time off request.
approvedtimeoff.request.approvedTriggered when approving a time off request.
declinedtimeoff.request.declinedTriggered when declining a time off request.
cancelledtimeoff.request.cancelledTriggered when cancelling a time off request.
deletedtimeoff.request.deletedTriggered when deleting a time off request.
updatedtimeoff.request.updatedTriggered when updating a time off request.
created from importtimeoff.request.importedTriggered when importing a time off request.

How to handle Time off Events

  1. Receive the Event Notification:
    The Webhook sends a notification to your endpoint whenever a time off event is triggered. The payload includes the request id, employee id and a ready-to-use getAPI URL.
  2. Retrieve the Time off request data:
    Use the employee ID and request ID from the payload to perform the API call and retrieve the complete data relevant for this Time off request. To learn more, see API call for Time off events.

To learn more, see Time off requests in Bob.

Time off events payload samples

Time off request requested

{
 "companyId": 637323,
 "type": "timeoff.request.requested",
 "triggeredBy": "3419283646526259215",
 "triggeredAt": "2024-10-03T09:29:00.831502",
 "data": {
  "timeoffRequestId": 32832853,
  "employeeId": "3373576791477190995",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3373576791477190995/requests/32832853"
 }
}

📘

Note

When using the getApi URL to retrieve details of a time off request that has just been submitted, the status in the response will be either:

  • approved: if the request was approved automatically
  • pending: if the request is pending approval. Once it will be approved or declined, an additional event will be sent.

Time off request approved

{
 "companyId": 637323,
 "type": "timeoff.request.approved",
 "triggeredBy": "3419283646526259215",
 "triggeredAt": "2024-10-03T09:29:00.831502",
 "data": {
  "timeoffRequestId": 32832853,
  "employeeId": "3373576791477190995",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3373576791477190995/requests/32832853"
 }
}

📘

Note

For requests that are approved automatically, two events are sent one after the other: requested then approved.

Time off request declined

{
 "companyId": 637323,
 "type": "timeoff.request.declined",
 "triggeredBy": "3419283646526259215",
 "triggeredAt": "2024-10-03T09:29:00.831502",
 "data": {
  "timeoffRequestId": 32832969,
  "employeeId": "3332883884017713938",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883884017713938/requests/32832969"
 }
}

📘

Note

When using the getApi URL to retrieve details of a declined time off request, the status in the response will be disapproved (not declined).

Time off request cancelled

{
  "companyId": 636192,
  "type": "timeoff.request.cancelled",
  "triggeredBy": "3332883804594373380",
  "triggeredAt": "2025-01-02T11:08:26.022782",
  "version": "v2",
  "data": {
    "timeoffRequestId": 32809865,
    "employeeId": "3332883804594373380",
    "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883804594373380/requests/32809865",
    "originalRequestId": null
  }
}

Time off request deleted

{
  "companyId": 636192,
  "type": "timeoff.request.deleted",
  "triggeredBy": "3332883804594373380",
  "triggeredAt": "2025-01-02T11:08:26.022782",
  "version": "v2",
  "data": {
    "timeoffRequestId": 32809865,
    "employeeId": "3332883804594373380",
    "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883804594373380/requests/32809865",
    "originalRequestId": null
  }
}

Time off request updated

🚧

Update notification:

We are planning to enhance the payload for the timeoff.request.updated event payload in the February release. This update will introduce additional information to the payload, improving its usability and functionality. Please stay tuned for our official release communication, which will require adjustments to your code. We recommend keeping an eye on our release notes and announcements to stay informed.

{
 "companyId": 637323,
 "type": "timeoff.request.updated",
 "triggeredBy": "3419283646526259215",
 "triggeredAt": "2024-10-03T09:29:00.831502",
 "data": {
   "employeeId": "3419283646526259215",
   "originalRequestId": 1189,
   "timeoffRequestId": 1190,
   "getApi": "https://api.hibob.com/v1/timeoff/employees/3419283646526259215/requests/1189"
 }
}

📘

Notes:

  • In case of a date or time change to a request, this is consideref a hard-update that triggers a new request to replace the existing one, and the payload will include:
    • The originalRequestId property that contains the previous request ID, before the update.
    • The getAPI URL which will retrieve the details of the previous request ID.
    • To retrieve the current request details, use the timeoffRequestId property and send it as the query param when calling the API.

Time off request created from import

{
 "companyId": 637323,
 "type": "timeoff.request.imported",
 "triggeredBy": "3419283646526259215",
 "triggeredAt": "2024-10-03T09:29:00.831502",
 "data": {
  "timeoffRequestId": 24640322,
  "employeeId": "3052501936990322832",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3052501936990322832/requests/24640322"
 }
}

📘

Note

When using the getApi URL to retrieve details of a time off request that has just been created via import, the status in the response will be approved, because imported requests are always approved by default.