- OAuth-sourced: Sapt derives the token from your connected Meta account. Nothing to paste.
- Pasted token: you generate a pixel-scoped CAPI token in Meta Events Manager and store it here. Use this when your pixel lives in a Business Manager that isn’t the one you connected, or when you want an explicit, scoped token.
Before you start
You need three things in place. The whole setup, end to end:- An API key. Create one in your Sapt dashboard under Account → API Keys (starts with
sapt_). See Authentication. - Meta connected to the project, with ads permissions. See Connecting integrations. This is what lets Sapt discover your pixels.
- A pixel connected for CAPI: steps 1 and 2 below.
1. Find your pixel
List the Meta pixels discoverable through your connected Meta account:2. Connect the pixel
Pin a pixel for CAPI. Either paste a pixel-scoped token, or setuseOauthToken: true to source it from your Meta connection.
GET /capi-pixel.
Generating a pixel-scoped token in Events Manager: open Events Manager, pick your pixel → Settings → Conversions API → Generate access token. That token is scoped to the one pixel. Paste it into
accessToken above.3. Send a conversion
Send a conversion server-side. Sapt hashes the customer data and delivers it to the ad platform the customer came from, found from their tracked visit (visitorId, or the email or phone the tracking script already tied to a visitor). A conversion with no known ad source is recorded in Sapt and sent nowhere.
kind: one ofLead,Purchase,CompleteRegistration,AddToCart,InitiateCheckout,PageView,ViewContent,Subscribe,Qualified,Schedule,Contact,Showed,NoShow,Disqualified.eventId: send the same id from your browser pixel (fbq) so Meta dedupes the browser and server events. If you omit it, Sapt mints one and returns it in the response.- Other optional fields:
value,currency,phone,visitorId,personId,sourceUrl.
202 means the conversion was accepted. A CAPI pixel must be connected first (step 2), and the API key needs the web_analytics:write permission.