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. Campaigns and creatives

Developers

Campaigns and creatives

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

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

The flow

  1. POST /quotes to see the price (optional; saves nothing).
  2. POST /campaigns makes a draft goal campaign.
  3. POST /uploads, PUT the file, then POST /campaigns/{id}/creatives. Each creative goes to the halal review (pending or ai_passed); only a HalalAdz reviewer approves it.
  4. POST /campaigns/{id}/launch pays the whole budget from your wallet into the campaign reserve in one ledger transaction; the campaign goes to in_review, then active.
  5. POST /campaigns/{id}/pause and /resume as you need; POST /campaigns/{id}/end ends it for good and returns the unspent budget at once.

Full guide with samples in curl, JavaScript, PHP and Python: developers.halaladz.com/campaigns. Every POST / PATCH needs an Idempotency-Key.

Live keys run the very same checks as the dashboard wizard; a request the dashboard would refuse is refused here with the same error code.

List and read campaigns

GET /campaigns

Scope reports:read or campaigns:write. Query: status (draft, in_review, active, paused, exhausted, ended, rejected, suspended), limit, cursor.

curl "https://api.halaladz.com/api/v1/campaigns?status=active&limit=20" \
  -H "Authorization: Bearer $HZ_KEY"

GET /campaigns/{id}

curl https://api.halaladz.com/api/v1/campaigns/123 -H "Authorization: Bearer $HZ_KEY"
{"id": 123, "name": "Eid dates offer", "status": "active", "goal": "orders", "pricing": "CPC", "platforms": ["website", "app", "telegram"], "totalBudgetMicros": "4500000000", "spentMicros": "1200000000", "startsAt": "2026-11-26T04:00:00.000Z", "endsAt": "2026-12-01T04:00:00.000Z", "createdAt": "2026-11-25T10:12:00.000Z"}

Price a goal

POST /quotes

Scope campaigns:write. Body: goal, platforms, targetUnits (exact count) or budgetMicros, optional declaredCategory / priceCategory. Answers totalMicros, unitPriceMicros, minBudgetMicros, quoteKey and the per-platform lines. Saves nothing.

curl -X POST https://api.halaladz.com/api/v1/quotes \
  -H "Authorization: Bearer $HZ_KEY" -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{"goal": "orders", "declaredCategory": "food", "platforms": ["website", "app"], "targetUnits": "500"}'

Create a campaign

POST /campaigns

Scope campaigns:write. The same body as the dashboard wizard's goal campaign. Send targetUnits (exactly that many clicks or views; the budget is units × one unit price) or budgetMicros.

FieldNotes
nameUp to 200 characters
goalbrand, orders, installs, video or members
declaredCategoryA content category code (e.g. food); priceCategory is optional
halalConfirmedMust be true: you confirm the product and the ad are halal
targetUnits / budgetMicrosDigits in a string
platformswebsite, app, telegram, whatsapp, youtube, facebook, instagram, tiktok; each once; each must fit the length
durationHours12, 24 or n × 24 (up to the admin maximum)
startModeafter_review, or date with startDate (YYYY-MM-DD) and startTime (HH:mm)
targeting, freqCapAs in the dashboard (countries, areas, content categories, devices …)
curl -X POST https://api.halaladz.com/api/v1/campaigns \
  -H "Authorization: Bearer $HZ_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: eid-campaign-1" \
  -d '{ "name": "Eid dates offer", "goal": "orders", "declaredCategory": "food", "halalConfirmed": true, "targeting": { "countries": ["BD"] }, "targetUnits": "500", "platforms": ["website", "app", "telegram"], "durationHours": 120, "startMode": "after_review" }'

Answers 201 with the budget view (id, campaignId, totalMicros, the lines) and quote. Typical refusals: 422 below_min_budget (with minBudgetMicros), 422 rate_unavailable, 422 duration_too_short, 422 start_in_past, 400 validation_error.

Add creatives

POST /uploads

Scope creatives:write. Body {"contentType": "image/png", "sizeBytes": 48211} (image/jpeg, png, webp, gif, video/mp4, webm). Answers uploadUrl, headers and assetUrl. PUT the file to uploadUrl with exactly those headers, then use assetUrl.

curl -X POST https://api.halaladz.com/api/v1/uploads \
  -H "Authorization: Bearer $HZ_KEY" -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{"contentType": "image/png", "sizeBytes": 48211}'

# then upload the file to the uploadUrl you got, with the headers you got
curl -X PUT "<uploadUrl>" -H "Content-Type: image/png" --data-binary @banner.png

POST /campaigns/{id}/creatives

Body: format (banner_300x250, banner_320x50, native, interstitial, video_muted, telegram_post …), landingUrl (https; blocked domains are refused with 422 domain_blocked), assetUrl for display and video formats, optional title, body, cta, hasPeople. Answers 201 with reviewStatus pending or ai_passed — never approved: only a HalalAdz person approves an ad, also for test keys. The webhook creative.approved / creative.rejected tells you the result.

curl -X POST https://api.halaladz.com/api/v1/campaigns/123/creatives \
  -H "Authorization: Bearer $HZ_KEY" -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{"format": "banner_300x250", "assetUrl": "<assetUrl>", "title": "Fresh dates", "landingUrl": "https://shop.example.com/dates"}'

GET /campaigns/{id}/creatives

curl https://api.halaladz.com/api/v1/campaigns/123/creatives -H "Authorization: Bearer $HZ_KEY"

Launch

POST /campaigns/{id}/launch

Body {"expectedTotalMicros": "<the total you saw>", "quoteKey"?: "..."}. Re-prices at today's rates and moves the whole total from the wallet into the campaign reserve in one ledger transaction; status in_review. Same as POST /campaigns/{id}/submit.

AnswerMeaning
200Paid and sent to review
402 insufficient_fundsdetails: totalMicros, balanceMicros, missingMicros. Add money in the dashboard wallet
409 price_changeddetails.totalMicros is the new total: check it and launch again with it
422 no_creativesAdd at least one ad first
403 spend_limit_reachedLive key: today's launches + this total go over the key's daily spend limit (set by HalalAdz; 0 = none yet)
422 test_money_capTest key: more than one million BDT of test money in open test campaigns
409 invalid_status, 409 already_paidOnly a draft (or rejected) campaign can be launched
curl -X POST https://api.halaladz.com/api/v1/campaigns/123/launch \
  -H "Authorization: Bearer $HZ_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: launch-123" \
  -d '{"expectedTotalMicros": "4500000000"}'

Change budget and dates

PATCH /campaigns/{id}

Send only what changes: targetUnits or budgetMicros, platforms, startMode, startAt, durationHours, name. The price is quoted again. Only before launch (draft, or rejected with its money returned) — after launch the budget is paid and locked (409 budget_locked), as in the dashboard.

curl -X PATCH https://api.halaladz.com/api/v1/campaigns/123 \
  -H "Authorization: Bearer $HZ_KEY" -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{"targetUnits": "300", "durationHours": 240}'

Pause, resume and end

POST /campaigns/{id}/pause

POST /campaigns/{id}/resume

POST /campaigns/{id}/end

Only an active campaign can be paused and only a paused one resumed; otherwise 409 invalid_status. end is for good: the unspent budget goes back at once.

curl -X POST https://api.halaladz.com/api/v1/campaigns/123/pause -H "Authorization: Bearer $HZ_KEY" -H "Idempotency-Key: $(uuidgen)"
curl -X POST https://api.halaladz.com/api/v1/campaigns/123/resume -H "Authorization: Bearer $HZ_KEY" -H "Idempotency-Key: $(uuidgen)"
curl -X POST https://api.halaladz.com/api/v1/campaigns/123/end -H "Authorization: Bearer $HZ_KEY" -H "Idempotency-Key: $(uuidgen)"

With a test key

With a hz_test_ key the same calls make a test campaign: the same checks and the same human halal review (a review decision cannot be simulated — POST /sandbox/creatives/{id}/review answers 410 review_by_halaladz). Its budget is test money, never your wallet; it shows only on your own places with Test ads on, never to real publishers; ending it returns the test money to the test wallet. See webhooks in the sandbox.

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.