Early access: Campaigns are in early access. Contact Oncade to request access to these features.
Integrate Campaigns
This guide explains how to create and manage Campaigns, authenticate using Campaign API Keys, and trigger lifecycle and payout events. It also covers how to test the flow end-to-end.
Prerequisites
- An Oncade developer account and access to your business.
- DevPortal → Campaigns to create/manage campaigns.
- A funded Campaign
All v1 requests must include the headers below. POST/PUT requests should also include an Idempotency-Key.
Authorization: Bearer <campaign_api_key>
X-Oncade-API-Version: v1
X-Campaign-Id: <campaignId>Create and configure a campaign
- Open Dashboard → Campaigns and click Create Campaign.
- Enter a name, pick an environment (
testorlive), and add at least one event withcode,name, andpayoutAmount. - After creation, fund the campaign with the payout token, then use Start when ready.
Core endpoints
Use these endpoints from your server or trusted backend. Examples use environment variables $CID and $CAMPAIGN_KEY.
Get details
curl -s \
-H "Authorization: Bearer $CAMPAIGN_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "X-Campaign-Id: $CID" \
https://<host>/api/v1/campaign/$CIDStart and Stop
curl -s -X PUT \
-H "Authorization: Bearer $CAMPAIGN_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "X-Campaign-Id: $CID" \
-H "Idempotency-Key: start-$(uuidgen)" \
https://<host>/api/v1/campaign/$CID/startWithdraw remaining funds
curl -s -X POST \
-H "Authorization: Bearer $CAMPAIGN_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "X-Campaign-Id: $CID" \
-H "Idempotency-Key: withdraw-$(uuidgen)" \
https://<host>/api/v1/campaign/$CID/withdrawRecord an event payout
curl -s -X POST \
-H "Authorization: Bearer $CAMPAIGN_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "X-Campaign-Id: $CID" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: event-$(uuidgen)" \
-d '{"eventCode":"EARN5","userRef":"usr_abc123"}' \
https://<host>/api/v1/campaign/$CID/eventsLifecycle controls
- Start and Stop return
202 Acceptedand enqueue background jobs. - Use
GET /api/v1/campaign/$CIDto verify status transitions before changing traffic. - Use Withdraw after a campaign is stopped to recover remaining funds.
Link users to your campaign
Campaigns pay out to users that have been linked/approved for the campaign. Poll the link session to retrieve theuserRef to use in event submissions.
curl -s 'https://<host>/api/v1/users/link/details?session=<sessionKey>'Test the flow end-to-end
- From Campaigns, create a test campaign in the test environment and fund it.
- Start the campaign, then call
GET /api/v1/campaign/$CIDto confirm status and balances. - Submit an event with a known
userRef. Unknown refs should return404. - Stop the campaign and then request a withdrawal. While Active, withdrawals should return
400.
Growth and acquisition with link invites
Use campaign link invites for acquisition channels where users self-serve account linking. Each invite can be labeled for attribution and controlled with usage caps, expiration windows, or pause/revoke states.
- Create invite links for specific channels (email, creators, communities).
- Set
maxUsesandexpiresAtfor controlled rollouts. - Pause or revoke invites when campaigns or channels change.
Rewards observability and operations
- Use campaign details to track status and available balances.
- List linked users to audit enrollment and linkage health.
- Inspect user event history for reconciliation and support workflows.
- List configured events to validate your reward catalog before launch.
Where to manage campaigns
- List:
/dashboard/campaigns - Create:
/dashboard/campaigns/new - Detail:
/dashboard/campaigns/[campaignId] - Webhook settings:
/dashboard/campaigns/[campaignId]/webhook