Time off events

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

Working with Webhook events

Before you dive into the various event types, explore our guide Getting started with Webhooks.

Time off Events

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

To learn more about each event payload and special cases Time off events payload.

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:
    Call Get the details of an existing time off request to retrieve the complete request details, and use the employee id and the request id in the URL. Click the link to view the response payload details
    Alternatively, for most events (besides the update event), you can use the getAPI URL from the payload to perform the API call.
    To learn more, see Time off requests in Bob ↗.

Time off events payload samples

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 updated

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

📘

Notes:

In case of a date or time change, this is consideref a hard-update that triggers a new request to replace the existing one. In this case:

  1. The originalRequestId property contains the previous request ID, before the update.
  2. The getAPI URL will retrieve the details of the previous request ID.
  3. If you want to retrieve the current request details, use the timeoffRequestId property and send it as the query param when calling the API.

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 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.