Skip to content

Webhook Model

The webhook object represents a subscription to API events.

Object Structure

json
{
  "_id": "wh_65abc123def456",
  "owner": "user_123abc",
  "event": "contract.deployed",
  "url": "https://your-app.com/webhooks/heir",
  "status": "active",
  "failures": 0,
  "lastDeliveryAttempt": "2024-01-15T10:30:00.000Z",
  "lastDeliveryStatus": 200,
  "metadata": {},
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}

Properties

PropertyTypeDescription
_idstringUnique identifier
ownerstringUser ID who owns this webhook
eventstringEvent type subscribed to
urlstringHTTPS URL for delivery
secretstringSecret for signing (hashed, not returned)
statusstringactive, paused, or disabled
failuresnumberConsecutive delivery failures
lastDeliveryAttemptstringISO 8601 timestamp
lastDeliveryStatusnumberHTTP status of last attempt
metadataobjectCustom metadata
createdAtstringISO 8601 creation date
updatedAtstringISO 8601 last update

Status Values

StatusDescription
activeWebhook is receiving events
pausedTemporarily disabled (auto or manual)
disabledPermanently disabled

Automatic Pausing

Webhooks are automatically paused after 5 consecutive delivery failures. The failures counter resets to 0 on successful delivery.

Event Types

Contract Events

EventDescription
contract.generatedContract code generated
contract.deployedContract deployed to blockchain

Dead Man's Switch Events

EventDescription
deadman.warningCheck-in overdue, warning sent
deadman.triggeredSwitch activated

Verification Events

EventDescription
verification.completeIdentity verification finished

Payment Events

EventDescription
payment.completedPayment processed

User Events

EventDescription
user.createdNew user account created
user.updatedUser profile updated

API Key Events

EventDescription
api_key.createdNew API key created
api_key.revokedAPI key revoked

Webhook Secret

When creating a webhook, you can optionally provide a secret:

json
{
  "event": "contract.deployed",
  "url": "https://your-app.com/webhooks",
  "secret": "your_secret_here"
}

The secret is used to sign webhook payloads. The signature is included in the X-Webhook-Signature header for verification.

WARNING

The secret is only shown once when creating the webhook. Store it securely!

Retry Policy

AttemptDelay
1Immediate
21 second
35 seconds
410 seconds
530 seconds
660 seconds

Released under the MIT License.