Skip to content

API and webhooks

On the Pro plan you can read and change your bookings from your own tools, and get a call on your server whenever someone books, cancels or reschedules.

API keys

What a key can do

Answers are JSON. An error is a problem (RFC 9457) with a stable code, such as booking.not_found. A key can’t reach settings or billing, or make other keys: that answers 403 auth.api_key_not_allowed.

GET /v1/me
Who the key is: the person and the account.
GET /v1/event-types
Your event types; GET /v1/event-types/{id} for one.
GET /v1/bookings?view=upcoming
Your bookings: upcoming, past or cancelled, in pages (cursor, limit up to 100).
GET /v1/bookings/{id}
One booking, with the invitee’s answers.
POST /v1/bookings/{id}/cancel
Cancels with {"reason": "…"}; the invitee is told.
POST /v1/bookings/{id}/accept
Accepts a request; /decline with {"note": "…"} declines it.
/v1/account/webhooks
Lists, creates, changes and removes webhooks (see below).

Webhooks

Check the signature

Each delivery has a GetMiAgenda-Signature header: t=<unix seconds>,v1=<signature>. The signature is the hex HMAC-SHA256 of "t.body" with the webhook’s secret (whsec_…). Compute it over the body exactly as received, compare in constant time, and refuse ones older than 5 minutes.

import crypto from 'node:crypto';

// header: the GetMiAgenda-Signature value; body: the raw request body
function verify(header, body, secret) {
  const { t, v1 } = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = crypto.createHmac('sha256', secret).update(`${t}.${body}`).digest('hex');
  return v1.length === expected.length && crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected));
}