Webhooks in absentify allow you to call a script on your server whenever specific events occur in the absentify system. Acting as event listeners or push notifications, webhooks let you build integrations that respond to certain events, such as creating or updating requests. When a subscribed event is triggered, absentify sends an HTTP POST request with relevant data to the specified webhook URL. This enables you to update external systems, send alerts, or automate actions based on changes in absentify.

Configuring webhooks

To set up webhooks, go to the Settings page in absentify.

  1. Log in and navigate to integrations
    Log in as an administrator, then click on Settings in the header, and select Integrations.

  2. Set the webhook URL
    Click on Configure URL and enter the URL where you want to receive event data.

  3. Choose event type
    From the dropdown menu, select the event type you want to subscribe to:

    • All Events
    • Request Created
    • Request Status Changed
  4. Save the configuration
    Click Add to complete the integration and start receiving notifications for the selected event types.

Webhook payload structure

When absentify triggers a webhook, it sends a JSON payload in the following format:

{
   "body": {
      "id": "a2032774-7d41-4820-8858-0e0ec37e64d3",
      "request_creator_member": {
         "email": "sample@user.com",
         "name": "Sample User",
         "id": "c67c0681-db0b-4bc5-8759-020643f618b0",
         "custom_id": ""
      },
      "createdAt": "2023-02-10T21:29:32.774Z",
      "updatedAt": "2023-02-10T21:29:32.772Z",
      "start": "2023-02-13T00:00:00.000Z",
      "start_at": "afternoon",
      "end": "2023-02-13T00:00:00.000Z",
      "end_at": "end_of_day",
      "duration": 0.5,
      "year": 2023,
      "details": {
         "status": "APPROVED",
         "deducted": 0.5,
         "reason": "",
         "approval_process": "Linear_all_have_to_agree",
         "request_approvers": [
            {
               "id": 283860,
               "approver_member": {
                  "email": "sample@user.com",
                  "name": "Sample User",
                  "id": "c67c0681-db0b-4bc5-8759-020643f618b0",
                  "custom_id": ""
               },
               "reason": null,
               "status": "APPROVED",
               "status_change_date": null,
               "predecessor_request_approver_id": null
            }
         ],
         "requester_member": {
            "email": "sample@user.com",
            "name": "Sample User",
            "id": "c67c0681-db0b-4bc5-8759-020643f618b0",
            "custom_id": "",
            "allowances": [
               {
                  "allowance": 30,
                  "brought_forward": 10.5,
                  "compensatory_time_off": 0,
                  "remaining": 38.5,
                  "taken": 2,
                  "year": 2023
               }
            ]
         },
         "leave_type": {
            "id": "b9362b30-251d-4ba8-929b-181d9afcc924",
            "name": "Holiday"
         }
      }
   }
}

This JSON structure provides details about the request, including the creator, status, dates, and related allowances. Use this data to synchronize with other systems or trigger automated workflows based on request information in absentify.