Webhooks

Webhooks can be configured by adding them to webhook clients. Webhooks can only be added to an already existing client.

Webhooks belonging to the selected client are listed on this page.

To add a new webhook simply click on the Add New Webhook button in the upper-right corner.

In the appearing modal you will be prompted to select an entity, a supported entity operation and an HTTP method, and to provide a path for the webhook.

Each time the configured operation is executed, an HTTP request will be made to the configured url eg. http://localhost:8080/events/1

The webhook's path can optionally contain variables that will be substituted with properties of the entity. Variables can be included in the path by adding the case sensitive variable name in curly brackets. Available variables depend on the webhook's entity and the operation.

The request's Authorization header will be set based on the webhook client's configuration.

The request's body is in JSON format, and depends on the webhook's entity and the operation.

Entity Types (currently supported):

Events

Operations:

  • Event created
    • this webhook is called for each event after it has been approved (or after it was requested, if no approval is required)
  • Event updated
    • this webhook is called after each time an approved event (or an event that doesn't need approval) has been updated, except if an event needs to be re-approved after an event type change, then instead of the event updated webhook:
      • first the event deleted webhook will be called (after the type change)
      • and then the event created webhook (after the re-approval)
      • if an event's type is changed while it is still pending approval, and the event doesn't need approval after the type change, then the event created webhook will be called.
  • Event deleted
    • this webhook is called for each event after it has been deleted (or after a type change in the above case).

Path variables:

  • eventId: the event's ID
  • typeId: the event's event type ID
  • typeKey: the event's event type key

Request body:

The request body contains a JSON object with all properties of the event.


  • Event Properties
Property nameTypeDescription
idnumberPrimary key of the event, used for referencing in update/delete operations
eventTypeEventTypeDetails of the event's type
startDateDateThe date the event starts
endDateDateThe date the event ends
commentstringOptional comment/description
eventStatusstringStatus of the event (one of "REQUESTED", "APPROVED", "REJECTED")
eventStatusByUserIdstringThe ID of the user who changed the status of the event last time
ownerIdstringThe ID of the owner of the event
halfDayLongbooleanIndicates if the event is half day long or not
allDayLongbooleanIndicates if the event is all day long or not
customDaysnumberThe number of the days consumed by this event
customDurationnumberThe length of the event
tenantIdstringThe ID of the tenant
ownerUserUserThe details of the event's owner user
actingUserUserThe details of the event's acting user (who changed the event last time)

  • EventType Properties
Property nameTypeDescription
idnumberPrimary key of the event type
namestringThe name of the event type
keystringThe key if the event type
colorstringThe configured color for the event type
approvalRequiredbooleanIndicates if the event type requires approval or not
syncToExternalCalendarbooleanIndicates if the event type is syncing to external calendar or not
activebooleanIndicates if the event type is active or not
eventTypeLimitnumberThe default limit for the event type
ranknumberThe rank of the event type

  • User Properties
Property nameTypeDescription
idstringThe identifier of the user
usernamestringThe name of the user
validbooleanIndicates if the user is valid or not

Example for request body:

{
    id: 1,
    eventType: {
        id: 1,
        name: 'Home Office',
        key: 'HO',
        color: '#ffb86e',
        approvalRequired: false,
        syncToExternalCalendar: false,
        active: true,
        eventTypeLimit: 0,
        rank: 0
    },
    startDate: '2023-07-14',
    endDate: '2023-07-14',
    comment: 'Description',
    eventStatus: 'APPROVED',
    eventStatusByUserId: 'fake-user-id',
    ownerId: 'fake-user-id',
    halfDayLong: false,
    allDayLong: true,
    customDays: 1,
    customDuration: 1,
    tenantId: 'fake-tenant',
    ownerUser: {
        id: 'fake-user-id',
        username: 'Fake User',
        valid: true
    },
    actingUser: {
        id: 'fake-user-id',
        username: 'Fake USer',
        valid: true
    }
}