HalalAdzDevelopers বাংলা · EN Go to dashboard
Docs menu

API

API reference

This page is made from the API's own OpenAPI description, so it always matches the code.

ItemValue
Base URLhttps://api.halaladz.com/api/v1
KeyAuthorization: Bearer hz_live_… or hz_test_… — Keys and security
OpenAPI 3.1https://api.halaladz.com/api/v1/openapi.json (no key needed)
Version1.0.0

Account

GET /me

The key's account, mode and scopes

Responses: 200, 400, 401, 403, 429

Reports v1

Read-only reports (scope read). JSON or CSV, at most 92 days per request, paginated. At most 1000 requests per hour per key, plus the per-minute limit.

GET /reports/campaigns

Advertiser: each campaign's numbers per day

Advertiser keys, scope read (old keys: reports:read). One row per day and campaign with delivery. Days are the account's days (timezone: the account's time zone, Asia/Dhaka unless changed). views = verified views (viewable), results = the campaign goal's result (orders → conversions, messages / installs / members → clicks, else views). The same numbers as the dashboard Reports screen. A page holds every day of up to limit campaigns.

NameInTypeNotes
fromquerystring; dateFirst day (default: 6 days before to).
toquerystring; dateLast day (default: today in the report's time zone). At most 92 days from from to to: longer → 400 range_too_long.
limitqueryinteger; default 20; max 50How many campaigns per page.
cursorqueryintegernextCursor of the previous page (null = last page).
campaignIdqueryintegerOnly this campaign.
formatquerystring; one of: json, csv; default jsoncsv: the same rows as a CSV file (one header line).

Responses: 200, 400, 401, 403, 429

GET /reports/earnings

Publisher: earnings per day and ad place

Publisher keys, scope read (old keys: earnings:read). One row per business day (Asia/Dhaka, the day earnings are booked) and placement. Earnings per currency, never summed across currencies. status: pending (inside the hold days, still checked for invalid traffic) or available (released to your balance). A page holds every day of up to limit placements.

NameInTypeNotes
fromquerystring; dateFirst day (default: 6 days before to).
toquerystring; dateLast day (default: today in the report's time zone). At most 92 days from from to to: longer → 400 range_too_long.
limitqueryinteger; default 20; max 50How many placements per page.
cursorqueryintegernextCursor of the previous page (null = last page).
placementIdqueryinteger
propertyIdqueryinteger
formatquerystring; one of: json, csv; default jsoncsv: the same rows as a CSV file (one header line).

Responses: 200, 400, 401, 403, 429

GET /reports/placements

Publisher: your ad places (newest first)

Publisher keys, scope read.

NameInTypeNotes
limitqueryinteger; default 100; max 200How many placements per page.
cursorqueryintegernextCursor of the previous page (null = last page).
formatquerystring; one of: json, csv; default jsoncsv: the same rows as a CSV file (one header line).

Responses: 200, 400, 401, 403, 429

GET /reports/agency/clients

Advertiser agency: client accounts and their totals

Advertiser agency keys, scope read. Every client link (invited, active, declined, revoked), newest first; totals over the range only for active clients (null otherwise). A key made by an agency manager / viewer limited to some clients sees only those. Not an agency → 403 not_an_agency.

NameInTypeNotes
fromquerystring; dateFirst day (default: 6 days before to).
toquerystring; dateLast day (default: today in the report's time zone). At most 92 days from from to to: longer → 400 range_too_long.
limitqueryinteger; default 20; max 50How many clients per page.
cursorqueryintegernextCursor of the previous page (null = last page).
formatquerystring; one of: json, csv; default jsoncsv: the same rows as a CSV file (one header line).

Responses: 200, 400, 401, 403, 429

Campaigns

Advertiser keys.

GET /campaigns

List campaigns (newest first)

Scope read (or campaigns:write). A test key lists only its test campaigns; a live key only real ones.

NameInTypeNotes
statusquerystring; one of: draft, in_review, active, paused, exhausted, ended, rejected, suspended
limitqueryinteger; default 50; max 200
cursorqueryintegernextCursor of the previous page.

Responses: 200, 400, 401, 403, 429

POST /campaigns

Create a goal campaign (draft)

Scope campaigns:write. Same rules as the dashboard wizard: halal category (a blocked or not-allowed category → 422), platforms that fit the length, the rate card and the minimum budget (422 below_min_budget). The campaign is a draft: add creatives, then launch. A test key makes a test campaign (test money, own test places only).

NameInTypeNotes
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 201, 400, 401, 403, 404, 409, 422, 429

GET /campaigns/{id}

One campaign

NameInTypeNotes
id *pathinteger

Responses: 200, 400, 401, 403, 404, 429

PATCH /campaigns/{id}

Update budget and dates (and the name)

Scope campaigns:write. Send only what changes; the rest is kept. Budget and dates change only while the campaign is a draft (or rejected with its money returned) — exactly like the dashboard: after launch the budget is paid and locked (409 budget_locked). The price is quoted again (answer quote).

NameInTypeNotes
id *pathinteger
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 403, 404, 409, 422, 429

POST /quotes

Price a goal (saves nothing)

Scope campaigns:write.

NameInTypeNotes
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 403, 429

POST /campaigns/{id}/launch

Pay the budget and send to human halal review

Scope campaigns:write. One ledger transaction moves the whole budget into the campaign reserve (live key: from the wallet; test key: test money, never your wallet); status becomes in_review and a HalalAdz person reviews it — an API campaign never skips the review. 402 insufficient_funds, 409 price_changed (re-read the total), 422 no_creatives, 403 spend_limit_reached (live key: today's launches + this total over the key's daily spend limit; details = limitMicros, usedMicros, remainingMicros, totalMicros), 422 test_money_cap (test key: more than 1,000,000 BDT in open test campaigns).

NameInTypeNotes
id *pathinteger
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 402, 403, 404, 409, 422, 429

POST /campaigns/{id}/submit

Same as /launch (pay + send to review)

NameInTypeNotes
id *pathinteger
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 402, 403, 404, 409, 422, 429

POST /campaigns/{id}/pause

Pause an active campaign

Scope campaigns:write. active → paused (409 invalid_status otherwise). Fires campaign.paused.

NameInTypeNotes
id *pathinteger
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 403, 404, 409, 422, 429

POST /campaigns/{id}/resume

Resume a paused campaign

Scope campaigns:write. paused → active.

NameInTypeNotes
id *pathinteger
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 403, 404, 409, 422, 429

POST /campaigns/{id}/end

End a campaign for good (unspent budget goes back)

Scope campaigns:write. From any status but ended. The unspent budget goes back at once in one ledger transaction (live key: to the wallet; test key: to the test wallet). Cannot be undone.

NameInTypeNotes
id *pathinteger
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 403, 404, 409, 422, 429

Creatives

Advertiser keys. New ads always go to the halal review.

POST /uploads

Get an upload URL for a picture or video

Scope creatives:write. PUT the file to uploadUrl with exactly headers, then use assetUrl in a creative.

NameInTypeNotes
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 403, 404, 409, 413, 422, 429

GET /campaigns/{id}/creatives

The campaign's creatives

Scope read, campaigns:write or creatives:write.

NameInTypeNotes
id *pathinteger

Responses: 200, 400, 401, 403, 429

POST /campaigns/{id}/creatives

Add a creative (goes to halal review)

Scope creatives:write. reviewStatus starts as pending (or ai_passed only if an optional automatic pre-check ran; every ad is checked by a person) — never approved: only a HalalAdz person approves an ad, also for test keys. Webhook creative.approved / creative.rejected tells you the result.

NameInTypeNotes
id *pathinteger
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 201, 400, 401, 403, 404, 409, 422, 429

Reports

The same numbers as the dashboard's Analytics screen.

GET /reports

Results, views and spend by day, platform or country

Scope reports:read. The same numbers as the dashboard's Analytics screen. groupBy=country needs campaignId (goal campaigns).

NameInTypeNotes
fromquerystring; dateFirst day (default: 6 days before to).
toquerystring; dateLast day (default: today). At most 92 days per request.
groupByquerystring; one of: day, platform, country; default day
campaignIdqueryinteger
goalquerystring; one of: messages, orders, brand, videoWhich result to count (default: the account's main goal).

Responses: 200, 400, 401, 403, 429

Publisher

Publisher keys: earnings and payouts.

GET /earnings

Earnings by day or property

Scope earnings:read (publisher keys). The same numbers as the dashboard's earnings report. Money per currency, never summed across currencies.

NameInTypeNotes
fromquerystring; dateFirst day (default: 6 days before to).
toquerystring; dateLast day (default: today). At most 92 days per request.
groupByquerystring; one of: day, property; default day

Responses: 200, 400, 401, 403, 429

GET /payouts

Payout requests (newest first)

NameInTypeNotes
limitqueryinteger; max 200
cursorqueryinteger

Responses: 200, 400, 401, 403, 429

Sandbox

hz_test_ keys only: simulate webhook events (never a review decision).

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

Send a test campaign.goal_reached webhook for a test campaign (nothing changes)

NameInTypeNotes
id *pathinteger
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 403, 404, 429

POST /sandbox/low-balance

Send a test wallet.low_balance webhook

NameInTypeNotes
Idempotency-Key *headerstringREQUIRED on every POST / PATCH / DELETE (else 400 idempotency_key_required). Use a new random value (e.g. a UUID) per action. Kept 24 h per key: the same key with the same method, path and body replays the first answer (header Idempotent-Replayed: true); the same key with another request → 422 idempotency_key_reused; still running → 409 idempotency_in_progress. A 5xx answer is not kept, so retry with the same key.

Responses: 200, 400, 401, 403, 429

Webhooks

These events are POSTed to your server: 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, test.ping. Webhooks guide.

Coming soon

Coming soon The publisher agency partners report comes when publisher agencies open (agencies).

GET /reports/agency/partners Coming soon

Publisher agency: partner publishers and the agency share