Every module for ₹9 per employee. Hosting and security included. No sales calls. Every module, ₹9 per employee Pricing →

Sign in Get started

Developers / Webhooks and events

Webhooks and events

ANOMA tells your systems the moment something happens: someone joins, time off is approved, a month is locked for payroll. Every delivery is signed, so you know it came from ANOMA.

How delivery works

Add an endpoint with POST /v1/webhooks: an https:// address and the events it wants, or ["*"] for all of them. ANOMA shows the endpoint’s signing secret once, in that response. Keep it on your server.

When something happens, ANOMA saves an event and sends it to every endpoint that wants it, as a POST with a JSON body. Answer with any 2xx status within 15 seconds. Do slow work after you answer.

The same events are kept for 30 days at GET /v1/events, so you can catch up after downtime.

The request

Webhook headers
HeaderWhat it holds
content-typeapplication/json
user-agentANOMA-Webhooks/1
x-anoma-eventThe event type, such as leave.approved
x-anoma-deliveryThis delivery’s id. A retry has the same event id in the body, so use the body’s id to ignore repeats.
x-anoma-signaturet=<unix seconds>,v1=<hex>: the HMAC-SHA256 of <t>.<raw body>, keyed with the endpoint’s secret
Body
{
  "id": "evt_2b7f0c41d9a3e8f1c6b0a2d4",
  "type": "leave.approved",
  "created_at": "2026-11-24T10:02:11.482Z",
  "workspace": "acme",
  "api_version": "2026-11-24",
  "data": {
    "id": 88,
    "employee_id": 12,
    "employee_name": "Sneha Iyer",
    "type": {
      "id": 1,
      "name": "Casual leave"
    },
    "start_date": "2026-12-08",
    "end_date": "2026-12-09",
    "days": 2,
    "half_day": false,
    "reason": "Family function",
    "status": "pending",
    "stage": "Waiting for their manager",
    "created_at": "2026-11-24T09:12:00Z"
  }
}

Check the signature

Work it out from the raw body exactly as it arrived, before you parse it. Compare in constant time, and refuse a timestamp more than five minutes old so a captured request cannot be replayed. Neither example needs a library.

import { createServer } from 'node:http';
import { createHmac, timingSafeEqual } from 'node:crypto';

const SECRET = process.env.ANOMA_WEBHOOK_SECRET; // whsec_…, shown once when you add the endpoint

// header looks like: t=1764000000,v1=5f2b…  (v1 = HMAC-SHA256 of "<t>.<raw body>", in hex)
function verify(rawBody, header, secret, toleranceSeconds = 300) {
  const parts = Object.fromEntries(header.split(',').map(p => [p.slice(0, p.indexOf('=')), p.slice(p.indexOf('=') + 1)]));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false; // too old: maybe replayed
  const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest();
  const given = Buffer.from(parts.v1 || '', 'hex');
  return given.length === expected.length && timingSafeEqual(given, expected);
}

createServer((req, res) => {
  let raw = '';
  req.setEncoding('utf8');
  req.on('data', chunk => (raw += chunk));
  req.on('end', () => {
    if (!verify(raw, req.headers['x-anoma-signature'] || '', SECRET)) return res.writeHead(400).end('Bad signature');
    const event = JSON.parse(raw); // parse only after checking the raw text
    console.log(req.headers['x-anoma-delivery'], event.type, event.data);
    res.writeHead(200).end('OK'); // answer 2xx within 15 seconds; do slow work afterwards
  });
}).listen(3000);

Try a signature

Paste what your server received. The check runs in your browser with WebCrypto, step by step; nothing is sent anywhere.

Retries and the inbox

If your server does not answer 2xx, ANOMA tries again with growing gaps (1, 2, 4, 8 minutes and so on), up to 8 times over about a day, then marks the delivery failed. GET /v1/webhooks/deliveries shows what your server answered, and redeliver sends one again.

An endpoint whose address is inbox keeps its deliveries inside ANOMA instead of sending them anywhere. Every sandbox has one subscribed to all events, which is what the live inspector shows.

Every event

Webhook events
EventWhenThe body’s data
employee.createdSomeone was addedA person
employee.updatedSomeone’s details changedA person
employee.exitedSomeone left the companyA person
leave.submittedTime off was requestedA time-off request
leave.approvedTime off was approvedA time-off request
leave.rejectedTime off was declinedA time-off request
leave.cancelledTime off was cancelledA time-off request
attendance.checked_inSomeone checked inA day’s attendance
attendance.checked_outSomeone checked outA day’s attendance
training.completedSomeone completed a coursetraining
correction.submittedAn attendance fix was asked forA request and where it stands
correction.approvedAn attendance fix was approvedA request and where it stands
correction.rejectedAn attendance fix was declinedA request and where it stands
expense.submittedAn expense claim was submittedA request and where it stands
expense.approvedAn expense claim was approvedA request and where it stands
expense.rejectedAn expense claim was declinedA request and where it stands
comp_off.submittedComp-off was claimedA request and where it stands
comp_off.approvedComp-off was approvedA request and where it stands
comp_off.rejectedComp-off was declinedA request and where it stands
profile.submittedSomeone asked to change their detailsA request and where it stands
profile.approvedA change to someone’s details was approvedA request and where it stands
profile.rejectedA change to someone’s details was declinedA request and where it stands
resignation.submittedSomeone resignedA request and where it stands
resignation.approvedA resignation was acceptedA request and where it stands
resignation.rejectedA resignation was not acceptedA request and where it stands
letter.submittedSomeone asked for a letterA request and where it stands
letter.approvedA letter was approvedA request and where it stands
letter.rejectedA letter was declinedA request and where it stands
loan.submittedSomeone asked for a loan or advanceA request and where it stands
loan.approvedA loan or advance was approvedA request and where it stands
loan.rejectedA loan or advance was declinedA request and where it stands
approval.requestedA request is waiting for someoneA request and where it stands
payroll.month.lockedHR locked a month for payrollA locked month
pingA test from the Developers screenA short message

What data holds

A person · employee.created employee.updated employee.exited

data
{
  "id": 12,
  "emp_code": "E0012",
  "first_name": "Sneha",
  "last_name": "Iyer",
  "name": "Sneha Iyer",
  "email": "sneha@acme.in",
  "phone": "+919876543210",
  "department": {
    "id": 3,
    "name": "Engineering"
  },
  "designation": "Backend engineer",
  "manager_id": 4,
  "employment_type": "full_time",
  "join_date": "2024-04-01",
  "status": "active",
  "exit_date": null
}

A time-off request · leave.submitted leave.approved leave.rejected leave.cancelled

data
{
  "id": 88,
  "employee_id": 12,
  "employee_name": "Sneha Iyer",
  "type": {
    "id": 1,
    "name": "Casual leave"
  },
  "start_date": "2026-12-08",
  "end_date": "2026-12-09",
  "days": 2,
  "half_day": false,
  "reason": "Family function",
  "status": "pending",
  "stage": "Waiting for their manager",
  "created_at": "2026-11-24T09:12:00Z"
}

A day’s attendance · attendance.checked_in attendance.checked_out

data
{
  "employee_id": 12,
  "date": "2026-11-24",
  "status": "present",
  "check_in": "09:12",
  "check_out": "18:40",
  "work_min": 568,
  "late_min": 0,
  "source": "device",
  "employee_name": "Sneha Iyer"
}

training · training.completed

data
{}

A request and where it stands · correction.submitted correction.approved correction.rejected expense.submitted expense.approved expense.rejected comp_off.submitted comp_off.approved comp_off.rejected profile.submitted profile.approved profile.rejected resignation.submitted resignation.approved resignation.rejected letter.submitted letter.approved letter.rejected loan.submitted loan.approved loan.rejected approval.requested

data
{
  "kind": "leave",
  "ref_id": 88,
  "kind_label": "Time off",
  "employee_id": 12,
  "employee_name": "Sneha Iyer",
  "summary": "2 days of casual leave, 8 Dec 2026 to 9 Dec 2026",
  "reason": "Family function",
  "stage": "Waiting for their manager",
  "status": "pending"
}

A locked month · payroll.month.locked

data
{
  "month": "2026-10",
  "status": "locked",
  "people": 48,
  "locked_at": "2026-11-02T10:00:00Z",
  "hash": "9c1e…"
}

A short message · ping

data
{
  "message": "Hello from ANOMA. If you can read this, your endpoint works."
}