Developers

Webhooks

HTTPS posts when issues move. Signed with whsec_… — Alien-native events.

Events

typeWhen
Issue.createNew card
Issue.updateStatus / title / close comment
Issue.commentStandalone comment
Issue.testSample from webhook_test
json
{
  "type": "Issue.update",
  "key": "CC-12",
  "status": "done",
  "at": 1730000000000
}

Register

  1. Desk → Workflow → Webhooks → paste an https URL → Add.
  2. Save the whsec_… secret (shown once).
  3. Hit Test. Check webhook_logs if delivery fails.

Header x-alien-pm-signature: t=<ms>,v1=<hex HMAC-SHA256 of "<t>.<body>">. Register via webhook_save (person OK).

bash
curl -sS -X POST 'https://pm-api.cloudcrew.si/actions/webhook_save' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://hooks.example.com/pm"}'

Verify (Node)

typescript
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyPmSignature(rawBody: string, header: string, secret: string) {
  // header: t=<ms>,v1=<hex>
  const parts = Object.fromEntries(header.split(",").map((p) => p.trim().split("=")));
  const t = parts.t;
  const v1 = parts.v1;
  if (!t || !v1) return false;
  const expect = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  try {
    return timingSafeEqual(Buffer.from(expect), Buffer.from(v1));
  } catch {
    return false;
  }
}