Skip to main content

Overview

Webhooks let your server receive HTTP POST callbacks when events occur in SmartlyQ — like a job completing or a social post being published.

Setting up webhooks

  1. Go to the Developer Dashboard
  2. Navigate to the Webhooks tab
  3. Add an endpoint URL (must be HTTPS)
  4. Select the events you want to receive

Payload format

All webhook payloads are JSON:
{
  "event": "job.completed",
  "timestamp": "2026-03-02T14:30:00Z",
  "data": {
    "job_id": "job_abc123",
    "type": "article_generation",
    "status": "completed",
    "result": { ... }
  }
}

Verifying signatures

Every webhook includes an X-Signature header containing an HMAC-SHA256 signature. Verify it using your webhook secret (available in the dashboard):
const crypto = require("crypto");

function verifySignature(payload, signature, secret) {
  const expected = crypto
    .createHmac("sha256", secret)
    .update(payload)
    .digest("hex");
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}
Always verify the signature before processing a webhook. Unverified payloads may be spoofed.

Retry policy

If your endpoint returns a non-2xx status code, SmartlyQ retries delivery up to 5 times with exponential backoff (30s, 60s, 120s, 240s, 480s).

Available events

EventTrigger
job.completedAn async job finished successfully
job.failedAn async job failed
social.postedA social media post was published
social.failedA social media post failed to publish
chatbot.messageA chatbot received a visitor message
wallet.lowWallet balance dropped below threshold