Skip to content

Notifications to your server

Receive real-time HTTP POST notifications when events happen in your DraxonCloud account.

Webhooks let DraxonCloud send an HTTP POST notification to your server when something happens, such as a captcha being solved or an email arriving in one of your inboxes.

Adding a webhook

You can register up to 20 webhook endpoints per account. Configure endpoints in your dashboard under /dashboard/webhooks:

  1. Click New Webhook.
  2. Enter your server’s destination URL (e.g. https://api.example.com/webhooks/draxon).
  3. Select which events you want to receive.
  4. Save your endpoint and copy the signing secret (whsec_...). It is shown only once.

You can click the Send Test button in the dashboard at any time to verify that your endpoint receives events properly.

Event catalog

Event When it fires
captcha.task.completed Captcha solved successfully
captcha.task.failed Captcha could not be solved or expired
mail.message.received Inbound email arrived in one of your inboxes
webhook.test Sent when you click Send Test in the dashboard

Webhook request headers

Every outbound webhook POST request includes:

  • X-Draxon-Event: Event name (for example captcha.task.completed).
  • X-Draxon-Delivery: Unique delivery UUID.
  • X-Draxon-Timestamp: Unix epoch integer in seconds.
  • X-Draxon-Signature: Signature string formatted as t=<timestamp>,v1=<hex_signature>.

Verifying the signature

The signature is computed with HMAC-SHA256 across {timestamp}.{raw_body_bytes} using your endpoint’s signing secret (whsec_...).

Always respond quickly with a 2xx HTTP status code (such as 200 OK). Deliveries that fail or time out (10s limit) are retried with exponential backoff up to 8 times over 24 hours. If an endpoint fails 50 consecutive times, it is automatically paused until re-enabled in the dashboard.

Python verification

import hashlib
import hmac
import time

def verify_draxon_webhook(
    payload_bytes: bytes,
    signature_header: str,
    secret: str,
    tolerance_seconds: int = 300,
) -> bool:
    pairs = dict(item.split("=", 1) for item in signature_header.split(","))
    timestamp_str = pairs.get("t")
    expected_v1 = pairs.get("v1")

    if not timestamp_str or not expected_v1:
        return False

    try:
        ts = int(timestamp_str)
    except ValueError:
        return False

    if abs(time.time() - ts) > tolerance_seconds:
        return False

    signed_payload = f"{ts}.".encode("utf-8") + payload_bytes
    computed_v1 = hmac.new(
        secret.encode("utf-8"),
        signed_payload,
        hashlib.sha256,
    ).hexdigest()

    return hmac.compare_digest(computed_v1, expected_v1)

Node.js verification

import crypto from "crypto";

export function verifyDraxonWebhook(
  rawBodyBuffer,
  signatureHeader,
  secret,
  toleranceSeconds = 300
) {
  if (!signatureHeader || !secret) return false;

  const pairs = Object.fromEntries(
    signatureHeader.split(",").map((part) => part.split("="))
  );

  const timestampStr = pairs["t"];
  const expectedSig = pairs["v1"];

  if (!timestampStr || !expectedSig) return false;

  const timestamp = parseInt(timestampStr, 10);
  if (isNaN(timestamp)) return false;

  const now = Math.floor(Date.now() / 1000);
  if (Math.abs(now - timestamp) > toleranceSeconds) {
    return false;
  }

  const signedPayload = Buffer.concat([
    Buffer.from(`${timestamp}.`, "utf8"),
    rawBodyBuffer,
  ]);

  const computedSig = crypto
    .createHmac("sha256", secret)
    .update(signedPayload)
    .digest("hex");

  return crypto.timingSafeEqual(
    Buffer.from(computedSig, "utf8"),
    Buffer.from(expectedSig, "utf8")
  );
}

Payload examples

Every webhook payload delivers an envelope with id, type, created_at, and data:

captcha.task.completed

{
  "id": "evt_7f1c4e7223c74347",
  "type": "captcha.task.completed",
  "created_at": "2026-10-09T12:00:00Z",
  "data": {
    "task_id": "8f9a2b1c-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
    "type": "standard_hcaptcha",
    "status": "solved",
    "cost_micros": 4000,
    "solution": {
      "token": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
      "user_agent": "Mozilla/5.0..."
    }
  }
}

captcha.task.failed

{
  "id": "evt_8f1c4e7223c74348",
  "type": "captcha.task.failed",
  "created_at": "2026-10-09T12:00:00Z",
  "data": {
    "task_id": "8f9a2b1c-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
    "type": "standard_hcaptcha",
    "status": "failed",
    "cost_micros": 0,
    "error": {
      "code": "solve_failed",
      "message": "Challenge verification failed"
    }
  }
}

mail.message.received

{
  "id": "evt_9f1c4e7223c74349",
  "type": "mail.message.received",
  "created_at": "2026-10-09T12:00:00Z",
  "data": {
    "mailbox_id": "4a5b6c7d-8e9f-0a1b-2c3d-4e5f6a7b8c9d",
    "address": "[email protected]",
    "message_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
    "from": "Security Alert <[email protected]>",
    "from_address": "[email protected]",
    "subject": "Your Discord verification code",
    "codes": ["482913"],
    "links": ["https://click.discord.com/verify?token=abc"],
    "attachment_count": 0,
    "received_at": "2026-10-09T12:00:00Z"
  }
}

webhook.test

{
  "id": "evt_cf1c4e7223c7434c",
  "type": "webhook.test",
  "created_at": "2026-10-09T12:00:00Z",
  "data": {
    "endpoint_id": "e8df82e6-992a-41e9-a864-159495eb93ad",
    "message": "This is a test webhook event from DraxonCloud"
  }
}