Skip to content
Docs menu

Webhooks

Events, as they happen. Signed.

Events

Add endpoints in Settings > Developers > Webhooks (on Pro and above). Coboost POSTs a JSON event to each subscribed endpoint and expects a 2xx within 10 seconds. Failed deliveries are retried with exponential backoff (30s, 2m, 8m, 32m) for up to 5 attempts; an endpoint that fails 20 times in a row is disabled and admins are notified. An endpoint gets at most 2 deliveries at a time: while it's answering those, its next events wait a few seconds, so answer quickly and do slow work after you've responded.

Event payload
{
  "id": "evt_6u2Jx1bQ0nF4kT9a",
  "type": "placement.approved",
  "created": "2026-10-28T11:00:00.000Z",
  "workspace_id": "cmf0ws0001",
  "data": {
    "placement_id": "cmf0plc001",
    "account": "maya.creates",
    "scheduled_at": "2026-11-02T15:00:00.000Z",
    "auto": false
  }
}
campaign.createdcampaign.updatedcampaign.launchedcampaign.pausedcampaign.resumedcampaign.canceledcampaign.completedplacement.requestedplacement.approvedplacement.rejectedplacement.changes_requestedplacement.publishedplacement.failedplacement.completedplacement.canceledplacement.expiredplacement.removed_earlyplacement.messageplacement.counteredplacement.counter_acceptedplacement.offer_revisedplacement.appliedplacement.withdrawnplacement.rescheduledaccount.analyzedaccount.connectedaccount.disconnectedaccount.policy_updatedcreative.createdcreative.variant_readycreative.variant_renderedcreative.variant_failedpersona.createdpayout.requestedpayout.paidpayout.failedpayout.canceleddispute.openeddispute.resolvedsubscription.updatedmember.joinedwallet.depositeddesign.createddesign.exportedbrand_kit.createdbrand_kit.updated
placement.requestedSent to the creator

A new ad request for one of your accounts, or a post sent back to you for approval. pending_status is awaiting_funds when your approval rules already accepted it and it's scheduled once the advertiser adds funds (placement.approved follows then); otherwise it's null and the request waits for your answer.

{"placement_id":"cmf0plc001","campaign":"Autumn glow launch","account":"maya.creates","price_cents":45000,"origin":"matched","collab":false,"pending_status":null}
placement.approvedSent to the advertiser and creator

A post was booked and scheduled. The advertiser hears when the creator approves it, or when the creator's approval rules do (auto: true). The creator hears when the advertiser approves their application, and when their own approval rules book a request (auto: true, with review_ends_at: until then the creator can still veto it).

{"placement_id":"cmf0plc001","account":"maya.creates","scheduled_at":"2026-11-02T15:00:00.000Z","auto":true,"review_ends_at":"2026-11-02T13:00:00.000Z"}
placement.canceledSent to the advertiser and creator

The placement ended before publishing: canceled by the advertiser, withdrawn by the creator, closed automatically (the campaign ended, the advertiser's own pause held the post past its time for longer than the platform's paused post wait, a workspace was deleted, the post couldn't be scheduled), or canceled by the platform team (moderation, or a dispute resolved with a refund). canceled_by is advertiser, creator, system (closed automatically) or admin (the platform team); reason says why. Any reserved funds are back in the advertiser's wallet, except late_cancel_fee_cents: what the advertiser paid the creator for canceling late, inside the creator's cutoff before publishing or after its own pause or later start date held the post past its time (0 when none was due).

{"placement_id":"cmf0plc003","campaign_id":"cmf0cmp001","account":"maya.creates","canceled_by":"advertiser","reason":"Canceled by the advertiser","late_cancel_fee_cents":0}
placement.expiredSent to the advertiser and creator

A request, counter-offer or application wasn't answered in time. waiting_on says who didn't act: creator, advertiser, or advertiser_funds for an approval the wallet never covered.

{"placement_id":"cmf0plc004","campaign_id":"cmf0cmp001","account":"techbyleo","previous_status":"pending_approval","waiting_on":"creator"}
placement.removed_earlySent to the advertiser and creator

The post was deleted before its agreed live period ended. The creator keeps the share shown and the rest is refunded to the advertiser. Either side can still open a dispute.

{"placement_id":"cmf0plc005","campaign_id":"cmf0cmp001","account":"maya.creates","removed_at":"2026-11-03T09:00:00.000Z","hours_live":30.5,"min_duration_hours":72,"creator_keeps_cents":7625,"advertiser_refund_cents":12280}
placement.messageSent to the advertiser and creator

A message was posted in the placement's thread. from is the side that wrote it: advertiser, creator, or system for a note the platform team posted on a dispute, which goes to both sides. Files aren't part of the event; attachment_count says how many came with it, and a message with files can have an empty body. Read them from GET /v1/placements/{id}/messages, where each file has a short-lived download link.

{"placement_id":"cmf0plc001","message_id":"cmf0msg001","from":"creator","body":"Can we move this to Thursday?","attachment_count":0,"created_at":"2026-11-02T14:10:00.000Z"}
campaign.canceledSent to the advertiser

The campaign was canceled, by the advertiser or by the platform team (canceled_by is advertiser or admin). Its requests and booked posts that hadn't published are canceled too (placement.canceled), and open-campaign escrow is released. late_cancel_fees_cents totals the late cancellation fees its posts paid.

{"campaign_id":"cmf0cmp001","name":"Autumn serum launch","canceled_by":"advertiser","reason":"Canceled by the advertiser","late_cancel_fees_cents":0}
campaign.resumedSent to the advertiser

A paused campaign is running again. campaign.launched is sent too, as before.

{"campaign_id":"cmf0cmp001","type":"targeted","status":"active","placements_requested":3}
wallet.depositedSent to the advertiser

A top-up reached the wallet. Sent once for each top-up, when the money is credited. amount_cents is what was added to the balance.

{"transaction_id":"cmf0txn001","amount_cents":50000,"currency":"USD","description":"Wallet top-up (card)"}

Deliveries can arrive more than once and out of order. Deduplicate on Coboost-Delivery or the event id, and fetch the latest state from the API when ordering matters. Payloads for the offer and analysis events are listed in Open campaigns & direct requests, design and brand kit events in Design studio, and variant events in Unique posts. Manage endpoints over the API with the Webhooks endpoints.

Endpoints registered with a test mode key only receive events from the sandbox, and those events carry livemode: false. Live events never go to them.

Verifying signatures

Each request carries Coboost-Event, Coboost-Delivery and Coboost-Signature: t=<unix>,v1=<hex>. Compute HMAC-SHA256 over t + "." + rawBody with the endpoint's signing secret, compare it in constant time with each v1 in the header, accept the request when any of them matches, and reject timestamps older than five minutes. The header can carry more than one v1: one per signing secret, as described under rotation below.

Node.js · Express
import crypto from "node:crypto";
import express from "express";

const app = express();
const SECRET = process.env.COBOOST_WEBHOOK_SECRET; // whsec_…
const TOLERANCE_SECONDS = 300;

// Coboost-Signature: t=<unix>,v1=<hex>, with one v1 per signing secret. For a while after
// a rotation there are two (the old secret's, then the new one's): accept any that matches.
function verify(header, rawBody, secret) {
  const parts = header.split(",").map((p) => p.split("="));
  const t = parts.find(([key]) => key === "t")?.[1];
  if (!(Math.abs(Date.now() / 1000 - Number(t)) < TOLERANCE_SECONDS)) return false; // a missing t fails too
  const expected = Buffer.from(crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"));
  return parts.some(([key, value]) => {
    if (key !== "v1" || !value) return false;
    const received = Buffer.from(value); // compare bytes: a non-ASCII character is longer in bytes than in characters
    return received.length === expected.length && crypto.timingSafeEqual(received, expected);
  });
}

// Use the raw body: re-serialized JSON won't match the signature.
app.post("/webhooks/coboost", express.raw({ type: "application/json" }), (req, res) => {
  if (!verify(req.get("Coboost-Signature") ?? "", req.body, SECRET)) return res.status(400).send("Invalid signature");

  const event = JSON.parse(req.body.toString("utf8"));
  // Deduplicate on req.get("Coboost-Delivery") / event.id, then handle event.type
  console.log(event.type, event.data);
  res.sendStatus(200);
});

app.listen(3000);

Rotating the signing secret

Rotate an endpoint's secret on its page in the app, with POST /v1/webhooks/{id}/rotate-secret, or with the rotate_webhook_secret MCP tool. The API and MCP responses carry the new secret once; in the app you can also reveal it again on the endpoint's page. The old secret keeps signing deliveries beside it for 24 hours: until then Coboost-Signature carries two v1 values, the old secret's first and the new one's last, so an endpoint that accepts any matching v1, as the code above does, keeps accepting events whichever secret it checks while you switch it over. The response's previous_secret_expires_at says when the old secret stops, and the endpoint's page shows it too.

Check your verification code before you rotate. Code that reads a single v1 rejects deliveries for part of the grace period, whichever one it reads. If it keeps the last, as our earlier sample code did, it sees only the new secret's signature and rejects every delivery from the moment you rotate until you switch it to the new secret. If it takes the first, it sees only the old secret's: it keeps working until you switch it, then rejects every delivery until the old secret stops. Make it accept any matching v1, as the code above does, before you rotate.

If a secret leaked, rotate with expire_previous: true (in the app, tick Stop the current secret now): the old secret stops at once and deliveries carry only the new signature. Rotating again before a grace period ends also stops the older secret at once, and starts a new grace period for the secret you're replacing.