spotdraft-webhooks
FreeRuns bundled scriptsNot checkedReceive and verify SpotDraft webhooks. Use when setting up a SpotDraft webhook endpoint (Settings > Developer settings > Webhooks), fetching the hmac_key from…
by hookdeck★ 104 GitHub starsAbout this skill
SpotDraft Webhooks
SpotDraft (contract lifecycle management) POSTs JSON to your endpoint when contract activities happen, such as CONTRACT_SENT_TO_COUNTERPARTY or CONTRACT_EXECUTED. Each request carries X-SD-WEBHOOK-CONTENT-HASH, a hex HMAC-SHA512 of the raw body keyed with the workspace's base64-decoded hmac_key. The key isn't shown in the app: you fetch it from the API.
When to Use This Skill
- How do I verify SpotDraft webhook signatures?
- Where do I get the SpotDraft webhook
hmac_key? - Why does my
X-SD-WEBHOOK-CONTENT-HASHnever match? (usually: the key wasn't base64-decoded, SHA-256 was used instead of SHA-512, or the body was re-serialised) - Which contract events does SpotDraft send?
Verification (core)
const crypto = require('crypto');
function verifySpotDraftWebhook(rawBody, contentHash, hmacKey) { // rawBody: exact bytes
const key = Buffer.from(hmacKey.trim(), 'base64'); // DECODE the hmac_key
if (!key.length || !/^[0-9a-fA-F]+$/.test(contentHash || '')) return false;
const expected = crypto.createHmac('sha512', key).update(rawBody).digest(); // SHA-512
const given = Buffer.from(contentHash, 'hex');
return given.length === expected.length && crypto.timingSafeEqual(given, expected);
}
- Key: the
hmac_keyfromGET /api/v2.1/public/webhooks/hmac_key/, base64-decoded. SpotDraft's sample:hmac.new(base64.b64decode(hmac_key), raw_body, digestmod=hashlib.sha512).hexdigest(). The key string as UTF-8 never matches. - Signed content: the raw request body only. No timestamp.
- Header:
X-SD-WEBHOOK-CONTENT-HASH, the bare hex digest (128 characters). - Bad or missing hash:
401. Key not configured or not valid base64:500.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
See references/verification.md for Python and debugging.
Hookdeck: the SpotDraft source type (SPOTDRAFT) verifies X-SD-WEBHOOK-CONTENT-HASH with the hmac_key, pasted exactly as the API returns it (base64; Hookdeck decodes it). Verification is optional on the source, and Hookdeck applies no timestamp window (SpotDraft signs none).
Events
SpotDraft's Webhooks page lists the only_for_activities values. The contract lifecycle ones:
| Activity | When it fires |
|---|---|
CONTRACT_CREATED |
A new contract is created |
CONTRACT_DATA_UPDATED |
Contract data changes |
CONTRACT_VERSION_UPLOADED |
A new contract version is uploaded |
CONTRACT_SENT_TO_COUNTERPARTY |
The contract is sent for counterparty review or redlining |
CONTRACT_REVIEW_REQUESTED / CONTRACT_REVIEW_COMPLETED |
Internal review is requested / completed |
CONTRACT_SIGNATURE_REQUESTED |
The contract is marked or sent for signature |
CONTRACT_SIGNATURE_DECLINED |
A signatory declines to sign |
CONTRACT_SIGNED |
A required signatory completes signing |
CONTRACT_EXECUTED |
All required signatures are complete |
CONTRACT_VOIDED / CONTRACT_DELETED |
The contract is voided / deleted |
CONTRACT_PROCESS_METRIC_UPDATED |
Workflow metrics change |
The page also lists CONTRACT_MARK_FOR_EXECUTION, CONTRACT_UNMARK_FOR_EXECUTION, CONTRACT_ENTITY_UPDATED and CONTRACT_ACTIVITY_LOG_COMMENT_CREATED; approvals and structured data (CONTRACT_APPROVAL_REQUESTED, CONTRACT_APPROVAL_COMPLETED, CONTRACT_EXTERNAL_METADATA_CREATED / _UPDATED, CONTRACT_KEY_POINTER_CREATION / _UPDATION); counterparties (COUNTER_PARTY_CREATED / _UPDATED, COUNTER_PARTY_CONTACT_CREATED / _UPDATED, COUNTER_PARTY_ADDRESS_CREATED / _UPDATED); and email events (POSTMARK_EMAIL_EVENT, SIGNING_EMAIL_DELIVERED / _OPENED / _NOT_DELIVERED / _LINK_CLICKED, the same four REDLINING_EMAIL_* values, and CONTRACT_SIGNATURE_REQUESTED_NOTIFICATION_SENT).
The guides don't publish the payload fields (they point to the API reference for version-specific fields), and SpotDraft calls a delivery "a change signal": fetch the contract from the API when you need the full record. The examples assume no field and fingerprint the raw body for deduplication; log the first real delivery and add dispatch on the activity field.
Environment Variables
SPOTDRAFT_HMAC_KEY=base64-hmac-key # GET /api/v2.1/public/webhooks/hmac_key/, exactly as returned
Local Development
# Express / Next.js (use 8000 for FastAPI). No install or account required.
npx hookdeck-cli listen 3000 spotdraft --path /webhooks/spotdraft
Register the printed HTTPS URL, then send a contract to a counterparty. See references/setup.md.
Reference Materials
- references/overview.md - Activities, what's documented, delivery
- references/setup.md - Registering the endpoint, fetching the hm
Install spotdraft-webhooks in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the spotdraft-webhooks skill do?
Receive and verify SpotDraft webhooks. Use when setting up a SpotDraft webhook endpoint (Settings > Developer settings > Webhooks), fetching the hmac_key from the API, verifying the X-SD-WEBHOOK-CONTENT-HASH header (HMAC-SHA512 with the base64-decoded key), handling contract activities such as CONTRACT_EXECUTED, or debugging why the SpotDraft hash never matches.
How do I install the spotdraft-webhooks skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the spotdraft-webhooks skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
by Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
by Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
by Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
by Anthropic