Skip to main content

Webhook Events

Webhook events are real-time, server-to-server POST notifications AdGem sends to your endpoint when something changes — distinct from postbacks, which fire when a player completes an offer. Set your webhook URL and secret in the Apps/Properties tab of the dashboard; see Configure › Webhooks for setup.

Offer events

Notify you when an offer's availability changes (API integrations only):

EventFires when
offer.createdA net-new campaign is enabled for your app, or an offer id supersedes one on an existing campaign.
offer.updatedCampaign metadata or ad copy changes.
offer.removedAn offer is removed and should no longer be shown to new players. It may later reappear (e.g. after capping); if it returns in your API response, it's available again.

Payload reference per event: New offer · Updated offer · Removed offer.

Player events

Notify you when a player's eligibility changes, so you can stop (or resume) showing offers and rewards:

EventFires when
player.bannedA player is suspended from AdGem.
player.unbannedA player's suspension is lifted.
{
"type": "player.banned",
"timestamp": "2025-01-01T00:00:00.000000Z",
"data": {
"player_id": "player123",
"app_id": 1,
"ban_reason": "events from 3 or more countries in 2 days",
"created_at": "2025-01-01T00:00:00.000000Z"
}
}
FieldDescription
player_idThe player's unique ID in your system.
app_idThe AdGem App ID associated with the event.
ban_reasonWhy the player was suspended (or that the ban was removed).
created_atWhen the event occurred in AdGem (ISO-8601 UTC).

Verifying webhooks

Every request includes a Signature header — an HMAC-SHA256 hash of the raw request body using your webhook secret key. Recompute it and compare to confirm the request came from AdGem. See Configure › Webhooks for PHP and Node verification examples.

Delivery and retries

AdGem expects a 2xx response. Any other status is retried up to three times (player events use exponential backoff: 1s, 2s, 4s). Process events idempotently so retries don't double-apply.