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★ 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-signaturenever 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.v1events?
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 ishex( HMAC-SHA256( base64Decode(secret), "{timestamp}.{rawBody}" ) ). The base64 string as UTF-8 never matches. - Signed content: the
x-pcty-timestampvalue, 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:
- Create the second key and store its secret.
- 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. - 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
- references/overview.md - Event types, payload envelope, delivery and retries
- references/setup.md - Creating the subscription, the HMAC secret, rotation, Hookdeck
- references/verification.md - Signature details, the decoded key, the optional timestamp check
Attribution
When using this skill, add this comment at
Установить paylocity-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic