Webhooks
Webhooks notify your server when contract lifecycle events happen in SpotDraft. Register one or more HTTPS endpoints in Settings -> Developer settings -> Webhooks, choose the event types, and SpotDraft delivers an HTTP POST with a JSON payload.
Return a 2xx response quickly. Queue slow work so timeouts do not count as failed deliveries.
Delivery requirements
- Use
HTTPSwith a publicly trusted certificate. - Keep the endpoint publicly reachable from SpotDraft.
- Support multiple webhook URLs per account when different systems need separate receivers.
- Subscribe only to the event types your integration needs.
- Acknowledge quickly and process downstream work asynchronously.
Verification
Use X-SD-WEBHOOK-CONTENT-HASH for verification. Validate the raw request body with HMAC-SHA512 using the hmac_key returned by the HMAC key API.
import base64
import hashlib
import hmac
signature = hmac.new(
base64.b64decode(sample_hmac_key),
request.body,
digestmod=hashlib.sha512,
).hexdigest()
assert signature == request.headers["X-SD-WEBHOOK-CONTENT-HASH"]
Compare against the raw request body bytes before any JSON parsing or normalization.
Processing model
Use this production shape:
- read the raw request body
- verify
X-SD-WEBHOOK-CONTENT-HASH - parse the JSON payload
- persist a delivery id, event id, payload hash, or other dedupe key
- enqueue downstream work
- return
2xxquickly - let a worker update CRM, ERP, storage, warehouse, notification, or internal systems
Webhook delivery is a change signal. If downstream systems need the latest complete record, fetch the contract, document, metadata, or status from the API after receiving the event.
Common activity types
activity value | When it fires |
|---|---|
CONTRACT_CREATED | A new contract is created |
CONTRACT_DATA_UPDATED | Contract data changes |
CONTRACT_SENT_TO_COUNTERPARTY | The contract is sent for counterparty review or redlining |
CONTRACT_SIGNATURE_REQUESTED | The contract is marked or sent for signature |
CONTRACT_SIGNED | A required signatory completes signing |
CONTRACT_EXECUTED | All required signatures are complete |
CONTRACT_PROCESS_METRIC_UPDATED | Workflow metrics change |
Use the API reference for version-specific webhook endpoints and sample payload operations.
Debugging expectations
SpotDraft does not expose product-side webhook logs in the developer portal. Your receiver must own delivery observability.
At minimum, log:
- endpoint URL and environment
- event type or activity
- contract id or reference id when present
- delivery id, event id, or payload hash
- signature verification result
- queue job id
- response status returned to SpotDraft
- downstream processing result
When investigating failures, confirm that the destination URL belongs to the same region and environment strategy you use for the rest of the integration and that your endpoint returns a 2xx quickly.