Skip to content

Make, Zapier and workspace webhooks

Call the AdMassy API from Make, Zapier or n8n and trigger scenarios from signed webhooks when launches and imports finish or automation rules fire.

Last updated

On this page

For Zapier and n8n there is an official app and a community node: see Zapier app and n8n node. For Make and any other tool, Connect › Make & Webhooks (/connect/make) gives you two building blocks that work with any HTTP module.

Call AdMassy from a scenario

  1. Create an API token under Connect › MCP & CLI (/connect/mcp) with only the scopes your scenario needs. The token is shown once.
  2. In Make, add an HTTP Make a request module (in Zapier: Webhooks by Zapier).
  3. Use the base URL https://<your AdMassy domain>/api/v1 and the header Authorization: Bearer <token>.
  4. Import the OpenAPI document (/api/v1/openapi.json, also linked as API Documentation) to see every endpoint.

See REST API keys, OpenAPI and rate limits for scopes, idempotency keys and rate limits.

Trigger scenarios from AdMassy

Only workspace owners and admins can change the webhook; others see the settings read-only. Each workspace has one webhook.

  1. In Make, add Webhooks › Custom webhook (in Zapier: Catch Hook) and copy its URL.
  2. Paste it into Webhook URL under Workspace webhook. It must be a public https:// address on the default port.
  3. Choose the Events:
EventSent when
launch.completedA launch job completed
launch.failedA launch job failed or partly failed
upload.completedAn upload or import job completed
upload.failedAn upload or import job failed or partly failed
rule.firedAn automation rule matched an ad, ad set or campaign (one event per matched object)

A job that paused because Meta's rate limit was reached, and resumes on its own, is not reported as failed. You get the event when it really ends.

  1. Leave Send events on and click Create webhook.
  2. Copy the Signing secret. It is shown only once.

Each POST carries a JSON body with event, workspaceId and occurredAt. Job events add the job (ID, type, status, ad account, error and item counts). rule.fired adds the rule (ID, revision, name, ad account, object ID and name, level, evaluation ID and the metrics the rule checked) and has job: null.

Verify the signature

Every request has these headers:

  • X-AdMassy-Event: the event name.
  • X-AdMassy-Delivery: a unique delivery ID. Use it to ignore repeats.
  • X-AdMassy-Signature: t=<unix seconds>,v1=<hex>, where v1 is HMAC-SHA256 of <t>.<raw body> using your signing secret.

Recompute v1 from the raw body and compare it with the header. Also reject timestamps more than a few minutes old. In Node.js (the page shows the same code under Verify in Node.js):

const { createHmac, timingSafeEqual } = require("node:crypto");

// rawBody: the request body exactly as received (string), header: X-AdMassy-Signature.
function verifyAdMassy(rawBody, header, secret, toleranceSeconds = 300) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.trim().split("=")));
  const t = Number(parts.t);
  if (!Number.isSafeInteger(t) || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
  const expected = createHmac("sha256", secret).update(t + "." + rawBody).digest("hex");
  const actual = String(parts.v1 || "");
  return actual.length === expected.length && timingSafeEqual(Buffer.from(actual), Buffer.from(expected));
}

Test, rotate and monitor

  • Send test event sends a signed delivery with the event test and no job right away and shows the result (delivered, will be retried, or failed with the HTTP status). It works even before delivery is switched on for the server, so you can check your endpoint first.
  • Rotate secret creates a new signing secret immediately. Update it in Make, because the old one stops matching.
  • Remove deletes the webhook.
  • Recent deliveries lists the last 20 deliveries with status, HTTP code and attempts. Your endpoint has 10 seconds to answer with a 2xx status. Timeouts, network errors, 5xx and 429 answers are retried with growing delays, up to 6 attempts in total. Redirects and other 4xx answers are not retried.
  • Switched off automatically: when 5 deliveries in a row fail for good (after their retries), AdMassy switches the webhook off and shows why. Fix your endpoint, click Send test event, then save with Send events on to switch it back on. Events from the time it was off are not sent afterwards. One successful delivery resets the count.

Note: Delivery must be switched on by whoever runs your AdMassy server. Until then the page shows "Webhook delivery is not switched on for this server yet". Your settings are saved and events start once it is enabled.

Was this article helpful?