Command Palette

Search for a command to run...

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

gusto-webhooks

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

Receive and verify Gusto Embedded Payroll webhooks. Use when creating a webhook subscription in the Gusto Developer Portal or with POST…

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

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

Gusto Webhooks

Gusto Embedded Payroll sends a POST with a JSON event to your subscription URL when something changes for a connected company: a payroll is paid, an employee is onboarded or terminated, a company is provisioned. Many Gusto API calls are asynchronous (for example submitting a payroll), and webhooks tell you when they finish. You manage subscriptions in the Developer Portal (Webhook subscriptions tab) or with the API.

When to Use This Skill

  • How do I receive Gusto webhooks?
  • What is the Gusto verification_token and what do I do with it?
  • How do I verify the X-Gusto-Signature header?
  • Why is my Gusto webhook subscription stuck in pending?
  • How do I handle payroll.paid or employee.terminated?

The Verification Token Handshake

  1. Create a subscription. It starts in pending.
  2. Gusto POSTs a verification_token to your URL.
  3. Call PUT /v1/webhook_subscriptions/{webhook_subscription_uuid}/verify with that token. Events start flowing.
  4. Keep the token: it's the HMAC key for every event's signature.

You can't verify the token request, because you don't have the token yet. The examples acknowledge a body that has verification_token and no event_type with 200, without a signature check, and do nothing else with it. While GUSTO_VERIFICATION_TOKEN is unset they print the token so you can call PUT .../verify. GET /v1/webhook_subscriptions/{uuid}/verification_token asks Gusto to send it again.

Verification (core)

X-Gusto-Signature is the HMAC-SHA256 of the raw body, keyed with the subscription's verification_token, as a bare hex digest.

const crypto = require('crypto');

function verifyGustoSignature(rawBody, signature, token) {   // rawBody: exact bytes
  const value = String(signature || '').trim();
  if (!token || !/^[0-9a-fA-F]{64}$/.test(value)) return false;
  const expected = crypto.createHmac('sha256', token).update(rawBody).digest();
  return crypto.timingSafeEqual(Buffer.from(value, 'hex'), expected);
}
  • Encoding. Gusto's current guide says only "HMAC of the event payload using the verification_token… SHA256". Gusto's own developer doc (gusto.github.io) says "a hex digest" and its Rails sample uses OpenSSL::HMAC.hexdigest(..., request.raw_post), so hex over the raw body with no sha256= prefix. If live events don't match, log one header: 64 hex characters means hex.
  • Gusto calls verification optional but "highly recommended".
  • Bad or missing signature: 401. Token not set (for events): 500.

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

Python uses hmac.new(token.encode(), raw_body, hashlib.sha256), bytes.fromhex and hmac.compare_digest. See references/verification.md.

Hookdeck: the Gusto source type (GUSTO) verifies X-Gusto-Signature (hex) with the verification_token. The token request reaches Hookdeck first: copy the token from that request in Hookdeck, call PUT .../verify, then paste the token as the source's secret. Turn verification on only after that, or the token request may be rejected. Verification is optional on the source, and Hookdeck applies no timestamp window.

Payload

{
  "uuid": "f7397a24-57ad-4fae-b011-d258e8232900",
  "event_type": "company.provisioned",
  "resource_type": "Company",
  "resource_uuid": "5df911a0-e8e9-412d-8aaf-a46ad193dd96",
  "entity_type": "Company",
  "entity_uuid": "5df911a0-e8e9-412d-8aaf-a46ad193dd96",
  "timestamp": 1671058841
}

resource_type is always Company. entity_type is the resource that changed. Fetch it from the API for details. One API call can produce several events.

Event Types

event_type is <entity>.<action>. Subscriptions are by entity type (full list):

Subscription type Actions
Company provisioned, deprovisioned, partner_authorized, migrated, updated, onboarded, approved, needs_approval, suspended, unsuspended, payroll_transfer_completed, …
Payroll created, updated, deleted, calculated, submitted, processed, paid, reversed, partially_reversed, cancelled, processing_failed
Employee created, updated, onboarded, terminated, termination_effective, rehired, deleted, …
Contractor created, updated, onboarded, deactivated, reactivated, deleted, …
ContractorPayment, ContractorPaymentGroup created, cancelled
BankAccount, CompanyBenefit, EmployeeBenefit, EmployeeJobCompensation, HomeAddress, WorkAddress, ExternalPayroll, TimeOffRequest created, updated, deleted
Document, Form
Полный SKILL.md на GitHub

Установить gusto-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/gusto/route.tsexamples/nextjs/lib/verify-gusto.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

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

Receive and verify Gusto Embedded Payroll webhooks. Use when creating a webhook subscription in the Gusto Developer Portal or with POST /v1/webhook_subscriptions, handling the verification_token request and PUT .../verify step, verifying the X-Gusto-Signature header (hex HMAC-SHA256 of the raw body keyed with the verification_token), debugging signature mismatches, or handling events like payroll.paid, payroll.processed, employee.created, employee.terminated and company.provisioned.

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

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

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

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

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

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