Webhooks
AskAds sends a signed POST to your server when something happens: a draft is built, a person approves, an ad is paused, a sign-in expires.
Set one up
In the dashboard under Developers, then Webhooks, press New endpoint. Or with a key that has the webhooks scope:
curl -X POST https://askads.app/api/v1/webhook-endpoints \
-H "Authorization: Bearer $ASKADS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/hooks/askads", "events": ["approval.requested", "approval.approved", "item.paused"] }'
The answer has the endpoint and its signing secret (whsec_...). The secret is shown once. Keep it with your other secrets. Press Send test (or POST /webhook-endpoints/{id}/test) to get a ping event right away.
The address must be https:// and must reach the public internet. Addresses on private networks, localhost and the like are refused when you save them and checked again before every try.
Events
| Event | When it is sent |
|---|---|
ping | A test event, from the test button or send_test_event. |
draft.created | A paused draft campaign was built. |
approval.requested | Someone asked for a launch, a budget raise or a change to something live. A person must approve it. |
approval.approved | A person approved a request and it ran. |
approval.failed | An approved request did not go through. |
approval.cancelled | A request waiting for approval was cancelled. |
item.launched | A campaign, ad set or ad was switched on after a person approved it. |
item.paused | A campaign, ad set or ad was paused. |
item.edited | A campaign, ad set or ad was edited. |
ads.added | Paused ads were added to an ad set. |
budget.raised | A budget was raised after a person approved it. |
budget.lowered | A budget was lowered. |
keywords.changed | Keywords were added or removed. |
safety.check_needed | Something could not be confirmed paused or switched back off. Check the ads manager now. |
changes.stopped | "Stop all changes" was switched on. |
changes.resumed | "Stop all changes" was switched off. |
limits.changed | The spending limits of an ad account were changed. |
connection.expired | A platform sign-in expired and needs to be connected again. |
connection.disconnected | A platform sign-in was disconnected. |
competitor.new_ads | A look at a saved competitor found new ads. |
team.member_joined | Someone joined the team. |
team.member_removed | Someone was removed from the team or left it. |
team.role_changed | A team member's role changed. |
GET /event-types lists them too. New event types may be added at any time; ignore types you do not know.
Events come only from things that happen in AskAds. competitor.new_ads is sent when someone asks what is new from a saved competitor, not on a timer. There are no spend alerts and no "approval expired" event yet.
Who gets an event
An endpoint gets an event only if the person who made it could see that thing right now: their role, their business limits and the endpoint's own business limit all apply. An event about no ad account in particular (for example someone joining the team) only goes to endpoints of people without a business limit. If the person leaves the team, their endpoints are switched off.
The request
POST /hooks/askads HTTP/1.1
Content-Type: application/json
User-Agent: AskAds-Webhooks/1
AskAds-Event: approval.requested
AskAds-Event-Id: evt_...
AskAds-Delivery: dlv_...
AskAds-Signature: t=1763569800,v1=0a4df938a87f...
{
"id": "evt_...",
"type": "approval.requested",
"createdAt": "2026-11-20T09:30:00.000Z",
"teamId": "usr_...",
"actor": { "type": "api", "email": "[email protected]", "credentialName": "Reporting script" },
"data": {
"id": "chg_...",
"kind": "launch",
"status": "pending",
"summary": "Switch on campaign Spring launch",
"adAccountId": "acc_123",
"dailyAfter": { "amountMinor": 3000, "currency": "USD", "display": "$30.00" },
"approveUrl": "https://askads.app/app/approvals/chg_..."
}
}
actor.typeis who did it:ai,api,website,card,systemoremail-link.datais the same shape the API returns for that thing (an approval request is the same asGET /approval-requests/{id}). The example above is shortened.- A payload is at most 64 KB. It never holds a token, a secret or a platform login.
Check the signature
AskAds-Signature is t=<unix seconds>,v1=<hex>. v1 is the HMAC-SHA256 of "<t>.<raw body>", keyed with your endpoint's whole secret (including whsec_). Check it against the raw body exactly as it arrived, before any JSON parsing. Refuse a request whose t is more than 5 minutes away from your clock.
While you rotate a secret there are two v1 values (new first, then old) for 24 hours. Accept the request when any of them matches.
Node.js
import crypto from 'node:crypto';
export function verifyAskAdsSignature(rawBody, header, secret, nowSeconds = Math.floor(Date.now() / 1000)) {
if (!header) return false;
let t = null;
const signatures = [];
for (const part of header.split(',')) {
const [key, value] = part.trim().split('=', 2);
if (key === 't' && /^\d{1,12}$/.test(value ?? '')) t = Number(value);
if (key === 'v1' && /^[0-9a-f]{64}$/.test(value ?? '')) signatures.push(value);
}
if (t === null || signatures.length === 0) return false;
if (Math.abs(nowSeconds - t) > 300) return false;
const expected = crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest();
return signatures.some(sig => crypto.timingSafeEqual(Buffer.from(sig, 'hex'), expected));
}
With Express, take the body raw on this one route:
app.post('/hooks/askads', express.raw({ type: 'application/json' }), (req, res) => {
if (!verifyAskAdsSignature(req.body, req.get('AskAds-Signature'), process.env.ASKADS_WEBHOOK_SECRET)) {
return res.status(400).send('bad signature');
}
const event = JSON.parse(req.body.toString('utf8'));
res.sendStatus(200); // answer fast, then do the work
handle(event);
});
The SDK has the same check: verifyWebhook(rawBody, header, secret) from @askads/sdk. The CLI has askads webhooks verify.
Python
import hashlib
import hmac
import time
def verify_askads_signature(raw_body, header, secret, now=None, tolerance=300):
if not header:
return False
if isinstance(raw_body, str):
raw_body = raw_body.encode("utf-8")
t = None
signatures = []
for part in header.split(","):
key, _, value = part.strip().partition("=")
if key == "t" and value.isascii() and value.isdigit() and len(value) <= 12:
t = int(value)
elif key == "v1" and len(value) == 64 and value.isascii():
signatures.append(value)
if t is None or not signatures:
return False
now = int(time.time()) if now is None else now
if abs(now - t) > tolerance:
return False
expected = hmac.new(secret.encode("utf-8"), str(t).encode("ascii") + b"." + raw_body, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(expected, sig) for sig in signatures)
With Flask:
@app.post("/hooks/askads")
def askads_hook():
if not verify_askads_signature(request.get_data(), request.headers.get("AskAds-Signature"), os.environ["ASKADS_WEBHOOK_SECRET"]):
return "bad signature", 400
event = request.get_json()
return "", 200
Test your code
These must come out as shown. Use the t below as "now" when you check them.
| Secret | t | Raw body | v1 |
|---|---|---|---|
whsec_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef | 1763569800 | {"id":"evt_test","type":"ping"} | 0a4df938a87f9678615810f3e392a15e6dc74264addeeb85cada1dfc39d2b0d4 |
whsec_fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 | 1763569800 | {"id":"evt_test","type":"ping"} | 4bcafbf77a25000af3e9fcea9b28654febe402b6af17c49e7afd4aa64cacc0a7 |
Answer, retries and replay
- Answer with any 2xx within 10 seconds. Do the slow work after you answer. Redirects are not followed and count as a failure.
- AskAds keeps only your status code and how long you took, never the body you send back.
- A failed try is retried at once, then after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours, 24 hours (each plus or minus 10 percent). That is at most 8 tries, and never more than 48 hours after the event.
- Answer 410 to say "stop sending": the endpoint is switched off at once.
- An endpoint that failed every try for 48 hours is switched off, its waiting deliveries are cancelled, and the person who made it and the team owner get one email. Switch it back on in the dashboard, or with
PATCH /webhook-endpoints/{id}and"status": "enabled". - Deliveries to one endpoint go out in order. A delivery being retried holds back the ones behind it until it succeeds or gives up, so use
createdAtfor order andAskAds-Event-Idto drop a duplicate. - Send again: any finished delivery can be sent again from the dashboard or with
POST /webhook-deliveries/{id}/resend. It is the same event (sameAskAds-Event-Id) in a new delivery. - The delivery log keeps 30 days: status, tries, your status code, the time taken, and the payload.
Limits
- At most 50 endpoints per team (each Zap is one).
- At most 500 deliveries waiting per endpoint and 2,000 per team. Past that, a delivery is recorded as
droppedand not sent. A dead endpoint only costs one try per retry step, not one per event. - At most one delivery to an endpoint at a time, so your server is never flooded by AskAds.
rotate-secretmakes a new secret. Both are valid for 24 hours, then only the new one.
This page as Markdown, for AI agents: /developers/webhooks.md