Webhooks

Receive real-time notifications when events occur in your account. Available on Growth and Enterprise plans.

📥 Available Events

📏

measurement.completed

Sent when a measurement extraction completes successfully.

{
  "event": "measurement.completed",
  "request_id": "req_abc123",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "measurements": { "Chest": 102.5, "Waist": 82.0 },
    "accuracy": "±1-3cm"
  }
}
⚠️

measurement.failed

Sent when a measurement extraction fails.

{
  "event": "measurement.failed",
  "request_id": "req_abc123",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "error": "image_too_dark",
    "message": "Please retake photo in better lighting"
  }
}
💳

subscription.renewed

Sent when a subscription is renewed.

{
  "event": "subscription.renewed",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "plan": "Growth",
    "next_billing": "2024-02-15"
  }
}
🛑

quota.exceeded

Sent when monthly quota is exceeded.

{
  "event": "quota.exceeded",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "limit": 2500,
    "used": 2500,
    "reset_date": "2024-02-01"
  }
}

⚙️ Setup Instructions

  1. 1. Configure Webhook URL

    Go to Dashboard → Settings → Webhooks and add your endpoint URL.

  2. 2. Verify Secret

    Your webhook endpoint will receive a secret in the X-Webhook-Secret header to verify requests.

  3. 3. Handle Events

    Implement endpoint to handle POST requests with event payload.

  4. 4. Return 200

    Return HTTP 200 within 30 seconds to acknowledge receipt.

🔒 Security

🔑

Webhook Secrets

Each webhook has a unique secret. Verify the X-Webhook-Signature header using HMAC-SHA256.

# Verify webhook signature
import hmac
import hashlib

def verify_webhook(payload, signature, secret):
    expected = hmac.new(
        secret.encode(),
        payload.encode(),
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(signature, expected)

♻️ Retries

Failed webhook deliveries are retried up to 3 times with exponential backoff: