Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

paylocity-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify Paylocity webhooks. Use when setting up a Paylocity Webhooks API subscription endpoint, verifying the x-pcty-signature keyId/signature…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

Paylocity Webhooks

Paylocity's Webhooks API (Early Access) POSTs CloudEvents-style JSON to a subscription's URL when employee data changes. Each delivery carries x-pcty-timestamp and x-pcty-signature: keyId=<uuid>:signature=<hex>, an HMAC-SHA256 keyed with the subscription's base64-decoded secret. While two keys are active, the header carries one pair per key.

When to Use This Skill

  • How do I verify Paylocity webhook signatures?
  • Why does my x-pcty-signature never match? (usually: the secret wasn't base64-decoded, or the body was re-serialised)
  • How do I rotate Paylocity webhook keys without dropping deliveries?
  • How do I handle Paylocity employee.assignment.v1 events?

Verification (core)

const crypto = require('crypto');

function verifyPaylocityWebhook(rawBody, signatureHeader, timestamp, secret) {   // rawBody: exact bytes
  const key = Buffer.from(secret.trim(), 'base64');                              // DECODE the secret
  if (!key.length || !signatureHeader || !timestamp) return false;
  const expected = crypto.createHmac('sha256', key)
    .update(`${timestamp}.`).update(rawBody).digest();                           // "<ts>.<body>"
  return signatureHeader.split(',').some((pair) => {                             // one pair per active key
    const m = /^\s*keyId=[^:]+:signature=([0-9a-fA-F]+)\s*$/.exec(pair);
    const given = m ? Buffer.from(m[1], 'hex') : Buffer.alloc(0);
    return given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
}
  • Key: "The base64-encoded HMAC secret", returned once when the key is created (auth.hmac.key1.secret). Paylocity's formula is hex( HMAC-SHA256( base64Decode(secret), "{timestamp}.{rawBody}" ) ). The base64 string as UTF-8 never matches.
  • Signed content: the x-pcty-timestamp value, a ., then the raw body "exactly as received".
  • Header: x-pcty-signature: keyId={uuid}:signature={hex}, lowercase hex. During rotation: keyId=A:signature=...,keyId=B:signature=.... Accept the delivery if any pair matches.
  • Timestamp: Unix seconds. Paylocity says to "Reject the request if the timestamp is more than 5 minutes (300 seconds) from your current time". The examples make this optional (PAYLOCITY_TIMESTAMP_TOLERANCE_SECONDS=300); it's off by default.
  • Bad or missing signature: 401. Secret not configured or not valid base64: 500.

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

Python: hmac.new(base64.b64decode(secret), ts.encode() + b"." + raw_body, hashlib.sha256).hexdigest(), compared with hmac.compare_digest against each signature= value. See references/verification.md.

Hookdeck: the Paylocity source type (PAYLOCITY) verifies x-pcty-signature with the HMAC secret, pasted exactly as returned (base64; Hookdeck decodes it). It tries every signature= pair, so a source holding either rotation secret keeps verifying. Verification is optional on the source, and Hookdeck applies no timestamp window.

Key Rotation

A subscription can have two keys. While both are active "each delivery is signed with both keys", so:

  1. Create the second key and store its secret.
  2. Switch PAYLOCITY_HMAC_SECRET (and the Hookdeck source) to the new secret. Deliveries keep verifying because they still carry a pair for the new key.
  3. Let the old key expire. If both keys expire, Paylocity stops delivering to the subscription.

Payload

CloudEvents-style. This example is illustrative; see Paylocity's Webhook Event Types page for each type's data:

{
  "id": "5b0e6a52-2f1d-4c8e-9a3b-7d4f1e2c6a90",
  "type": "employee.assignment.v1",
  "time": "2026-11-18T10:15:00Z",
  "data": { "companyId": "C1234", "assignmentId": "E5678" }
}

Delivery is at least once and ordering is best-effort: dedupe on id, and use time or re-fetch when order matters.

Environment Variables

PAYLOCITY_HMAC_SECRET=base64-secret                 # auth.hmac.key1.secret, exactly as returned
PAYLOCITY_TIMESTAMP_TOLERANCE_SECONDS=              # optional; Paylocity recommends 300

Local Development

# Express / Next.js (use 8000 for FastAPI). No install or account required.
npx hookdeck-cli listen 3000 paylocity --path /webhooks/paylocity

Use the printed HTTPS URL as the subscription's url, then change an employee in the sandbox company. See references/setup.md.

Reference Materials

Attribution

When using this skill, add this comment at

Полный SKILL.md на GitHub

Установить paylocity-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/paylocity/route.tsexamples/nextjs/lib/verify-paylocity.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл paylocity-webhooks?

Receive and verify Paylocity webhooks. Use when setting up a Paylocity Webhooks API subscription endpoint, verifying the x-pcty-signature keyId/signature header with the base64-decoded HMAC secret and x-pcty-timestamp, handling key rotation (two signature pairs), handling employee events such as employee.assignment.v1, or debugging signature mismatches.

Как установить скилл paylocity-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл paylocity-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить paylocity-webhooks с