Time Off Webhook Events

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

Time off Request EventTypeDescription
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.
submittedtimeoff.request.requestedTriggered when submitting a time off request.
created from importtimeoff.request.importedTriggered when importing a time off request.

To learn more about how to set up Webhooks in Bob, see Getting started with Webhooks.

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 ready-to-use getAPI URL from the payload to perform the API call and retrieve the complete data relevant for this Time off request. See the get_timeoff-employees-id-requests-requestid endpoint for the response payload details.

To learn more, see Time off requests in Bob.

Time off events payload samples

Time off request approved

{
  "timeoffRequestId": 24587697,
  "employeeId": "3332883894235038486",
  "event": "timeoff.request.approved",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883894235038486/requests/24587697"
}

📘

Note

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


Time off request declined

{
  "timeoffRequestId": 24587584,
  "employeeId": "3332883914770350878",
  "event": "timeoff.request.declined",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883914770350878/requests/24587584"
}

📘

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

{
  "timeoffRequestId": 24587935,
  "employeeId": "3332883904477528858",
  "event": "timeoff.request.cancelled",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883904477528858/requests/24587935"
}

Time off request deleted

{
  "timeoffRequestId": 24560042,
  "employeeId": "3332883911884669725",
  "event": "timeoff.request.deleted",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883911884669725/requests/24560042"
}

Time off request updated

{
  "originalRequestId": 24588195,
  "timeoffRequestId": 24588323,
  "employeeId": "3332883916968166175",
  "event": "timeoff.request.updated",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883916968166175/requests/24588195"
}

Time off request submitted

{
  "timeoffRequestId": 24588163,
  "employeeId": "3332883916968166175",
  "event": "timeoff.request.requested",
  "getApi": "https://api.hibob.com/v1/timeoff/employees/3332883916968166175/requests/24588163"
}

📘

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 created from import

{
  "timeoffRequestId": 24640322,
  "employeeId": "3052501936990322832",
  "event": "timeoff.request.imported",
  "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.