Skip to content
বাংলায় দেখুন
HalalAdz
  • Advertisers
  • Publishers
  • Halal policy
  • Learn
  • FAQ
বাংলা Sign in
Menu
  • Advertisers
  • Publishers
  • Halal policy
  • Learn
  • FAQ
  • Guides
  • How it works
  • Telegram channels
  • Contact
বাংলা Sign in Start advertising
  1. Home
  2. Developer API
  3. Webhooks

Developers

Webhooks

OpenAPI 3.1: api.halaladz.com/api/v1/openapi.json

  • Overview
  • Campaigns and creatives
  • Reports and earnings
  • Webhooks

Events

EventWhendata
campaign.approvedThe halal review approved a whole campaign (it can now run)campaignId, autoApproved?
campaign.rejectedThe halal review rejected a campaign (its budget goes back)campaignId, reason
campaign.pausedA campaign was paused — by you, by HalalAdz, or because money ran outcampaignId, previousStatus
campaign.budget_spentA campaign used its whole budgetcampaignId, billing
creative.approvedA HalalAdz reviewer approved a creativecreativeId, campaignId
creative.rejectedA creative was rejectedcreativeId, campaignId, reason
campaign.goal_reachedA goal campaign delivered everything it bought and endedcampaignId
wallet.low_balanceThe advertising balance is low, or a campaign paused for lack of moneycurrency, balanceMicros, pausedCampaignId?
payout.approvedPublishers: HalalAdz approved a withdrawalpayoutId, currency, amountMicros
payout.sentPublishers: the money was sentpayoutId, currency, amountMicros, reference
earnings.finalisedPublishers: a month's earnings are final (the monthly statement)statementId, month, currency, netMicros
property.approvedPublishers: a site, app or channel was approvedpropertyId
property.rejectedPublishers: a site, app or channel was rejectedpropertyId, reason
report.daily_readyAdvertisers and publishers: yesterday's numbers are final (once a day, 06:00 or later in your account's time zone)day, timezone, reports
test.pingYou pressed "Send a test message" in the dashboardmessage, endpointId

Set them up in Settings → Webhooks (advertiser and publisher accounts, each with its own events, up to 10 addresses). Choose the events per address and whether it gets real events or test events only (from test keys).

The message

A POST with Content-Type: application/json:

{
  "id": "evt_n918273",
  "type": "creative.approved",
  "created": "2026-11-26T08:15:02.000Z",
  "livemode": true,
  "accountId": 42,
  "data": { "creativeId": 5521, "campaignId": 123 }
}
HeaderValue
X-HalalAdz-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")>
X-HalalAdz-EventThe event type, e.g. creative.approved
X-HalalAdz-DeliveryThe event id (same as body.id)

livemode is false for sandbox events and test messages. The same event is never queued twice for one address, but a retry repeats it: use id to skip one you already handled.

Check the signature

Compute HMAC-SHA256 of <t>.<raw body> with your signing secret (whsec_…), compare it with v1 in constant time, and refuse a timestamp older than 5 minutes (replay protection). Always use the raw body bytes, not re-encoded JSON.

Node.js

import crypto from "node:crypto";
import express from "express";

const app = express();
const signingSecret = process.env.HALALADZ_WEBHOOK_SECRET; // whsec_…

// Verify the RAW body, before any JSON parsing.
app.post("/halaladz/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const header = req.get("X-HalalAdz-Signature") || "";
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=", 2)));
  const t = Number(parts.t);
  if (!t || !parts.v1 || Math.abs(Date.now() / 1000 - t) > 300) return res.sendStatus(400);
  const want = crypto.createHmac("sha256", signingSecret).update(`${t}.${req.body}`).digest();
  const got = Buffer.from(parts.v1, "hex");
  if (got.length !== want.length || !crypto.timingSafeEqual(got, want)) return res.sendStatus(400);

  const event = JSON.parse(req.body.toString("utf8"));
  // Use event.id to ignore a repeat you already handled.
  res.sendStatus(200); // answer fast; do slow work afterwards
});

PHP

<?php
$secret = getenv('HALALADZ_WEBHOOK_SECRET'); // whsec_…
$body = file_get_contents('php://input');
$header = $_SERVER['HTTP_X_HALALADZ_SIGNATURE'] ?? '';
$parts = [];
foreach (explode(',', $header) as $p) { [$k, $v] = array_pad(explode('=', $p, 2), 2, ''); $parts[$k] = $v; }
$t = (int)($parts['t'] ?? 0);
if (!$t || abs(time() - $t) > 300) { http_response_code(400); exit; }
$want = hash_hmac('sha256', $t . '.' . $body, $secret);
if (!hash_equals($want, $parts['v1'] ?? '')) { http_response_code(400); exit; }
$event = json_decode($body, true);
http_response_code(200);

Answer and retries

  • Answer with any 2xx within 10 seconds. Do slow work after answering.
  • Anything else (also a timeout, a network error, or a redirect: redirects are never followed) is retried with backoff: 1 minute, 2, 4, 8 … at most 6 hours apart.
  • After 8 tries the message is not delivered (the dead-letter list). The sending log in Settings → Webhooks shows every try with its status; fix your server and press Send again.
  • A turned-off address keeps its queued messages until you turn it on again.

Security

  • Only https on the default port, with a public host name. IP addresses, localhost, internal names and hosts that resolve to private, loopback or link-local networks are refused when you save the address and again at every send (the connection is pinned to the checked address).
  • The signing secret is shown once, when you add the address. HalalAdz stores it encrypted. New secret makes a new one; the old one stops at once, so update your server right away.

Webhooks in the sandbox

Events of your test campaigns (approved, rejected, paused, budget spent, creative approved / rejected) go to your test-events addresses only, with livemode false. With a hz_test_ key these helpers send extra test events (a review decision is never simulated: a HalalAdz person reviews test ads too):

POST /sandbox/campaigns/{id}/goal-reached

curl -X POST https://api.halaladz.com/api/v1/sandbox/campaigns/9000/goal-reached -H "Authorization: Bearer $HZ_TEST_KEY" -H "Idempotency-Key: $(uuidgen)"

POST /sandbox/low-balance

curl -X POST https://api.halaladz.com/api/v1/sandbox/low-balance -H "Authorization: Bearer $HZ_TEST_KEY" -H "Idempotency-Key: $(uuidgen)"

Each answers webhooksQueued: how many messages went into the queue (they go out within a minute). Event names: campaign.approved, campaign.rejected, campaign.paused, campaign.budget_spent, creative.approved, creative.rejected, campaign.goal_reached, wallet.low_balance, payout.approved, payout.sent, earnings.finalised, property.approved, property.rejected, report.daily_ready.

HalalAdz

Halal, brand-safe ads for the whole world. You pay by your goal.

Product

  • Advertisers
  • Publishers
  • Telegram channels
  • Facebook and YouTube creators
  • WhatsApp
  • How it works
  • Halal policy
  • What we never show
  • How verification works

Learn and help

  • Learn
  • Guides
  • FAQ
  • About Axon Dynamics
  • Contact
  • Get the app
  • Sign in
  • Developers / API

Legal

  • Privacy Policy
  • Terms of Service
  • Advertiser Terms
  • Publisher & Creator Terms
  • Data deletion
  • Personalised ads

Contact

  • support@halaladz.com
  • privacy@halaladz.com
  • Telegram group (questions)
  • Telegram bot @HalalAdzBot
  • বাংলায় পড়ুন

© 2026 HalalAdz. HalalAdz is a product of Axon Dynamics.

Company: Axon Dynamics · Address: Cha-63/3, Uttar Badda, Badda, Dhaka 1212, Bangladesh · Phone: +8801865052200 · Email: support@halaladz.com

IP Geolocation by DB-IP · Place names: GeoNames (CC BY 4.0) · Upazila and thana names: OCHA / BBS (HDX) (CC BY-IGO) · Bangla upazila names: Bangladesh GeoCode (Nuhil Mehdy) (MIT) · Exchange rates: Rates By Exchange Rate API

All trademarks and logos belong to their owners; their use here does not mean partnership or endorsement.