Skip to main content

Webhook Setup

Webhooks allow you to receive real-time HTTP POST notifications when integration events occur in your workspace. Instead of polling the API, webhooks push data to your server as events happen.

Prerequisites

Before you begin, ensure you have:

Step 1: Navigate to the Webhooks Section

Log in to the Kryptos Developer Portal and open your workspace. Scroll down to the Webhooks section.

Webhook Section

Click + Add Webhook to create a new webhook.

Step 2: Configure Your Webhook

Fill in the webhook configuration form:

Add Webhook

FieldDescription
Endpoint URLThe HTTPS URL where webhook events will be sent
Description (optional)A brief description to help identify this webhook
EventsSelect at least one event type to subscribe to

Available Events

Integration Events

EventDescription
integration.createdA user connected a new wallet or exchange
integration.updatedAn existing integration's settings were updated
integration.deletedA user removed a wallet or exchange connection
integration.failedAn integration sync encountered an error
More Events Coming Soon

Additional event categories will be added in the future. See the Webhook Events page for the latest list.

Select the events you want to receive and click Add Webhook.

Step 3: Save Your Signing Secret

After creating the webhook, a signing secret is displayed. This secret is used to verify that incoming webhook payloads are genuinely from Kryptos.

Webhook Secret

Important

Save your signing secret securely — it will only be shown once! If you lose it, you can rotate the secret from the webhook settings.

Verifying Webhook Signatures

Every webhook delivery includes an HMAC-SHA256 signature in the X-Webhook-Signature header. Use your signing secret to verify the payload authenticity.

Delivery Headers

Each webhook request includes the following headers:

HeaderDescription
X-Webhook-SignatureHMAC-SHA256 hex digest of the request body
X-Webhook-EventEvent type (e.g., integration.created)
X-Webhook-IdUnique delivery ID
X-Webhook-TimestampISO 8601 timestamp of the delivery
Content-Typeapplication/json

Signature Verification Examples

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');

return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expectedSignature)
);
}

// Express.js example
app.post('/webhooks/kryptos', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-webhook-signature'];
const event = req.headers['x-webhook-event'];

if (!verifyWebhookSignature(req.body, signature, process.env.WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature');
}

const payload = JSON.parse(req.body);

switch (event) {
case 'integration.created':
console.log('New integration:', payload.data);
break;
case 'integration.updated':
console.log('Integration updated:', payload.data);
break;
case 'integration.deleted':
console.log('Integration removed:', payload.data);
break;
case 'integration.failed':
console.log('Integration failed:', payload.data);
break;
}

res.status(200).send('OK');
});

Retry Behavior

Kryptos will retry failed webhook deliveries with exponential backoff:

  • Maximum retries: 2 (3 total attempts)
  • Timeout: 10 seconds per delivery
  • Retryable status codes: 429, 500, 502, 503, 504

Your endpoint should return a 2xx status code within 10 seconds to acknowledge receipt. Any other response (or a timeout) triggers a retry.

Managing Webhooks

From the Developer Portal, you can:

  • Edit a webhook's URL, description, or subscribed events
  • Rotate the secret if your signing secret is compromised
  • Disable a webhook temporarily without deleting it
  • Delete a webhook when it is no longer needed

Best Practices

  1. Always verify signatures — Check the X-Webhook-Signature header on every request to ensure payloads are from Kryptos.
  2. Respond quickly — Return a 200 response immediately and process the event asynchronously. Long-running handlers risk timeouts and unnecessary retries.
  3. Handle duplicates — Use the X-Webhook-Id header to deduplicate events in case of retries.
  4. Use HTTPS — Your endpoint must use HTTPS to protect webhook data in transit.
  5. Monitor failures — Track failed deliveries and investigate persistent errors.

Next Steps