Help center
Browse help topics

Partner API quick start

For platforms: create an account for each customer, mint a short-lived session on your server and mount the visibility card with one script tag.

For platformsUpdated Published by LegitGeo

How it fits together

The partner API works like Stripe Connect. You hold one secret key per mode: lgp_test_… and lgp_live_…. Your server creates an account for each customer, asks for a session when it renders the card, and your page mounts the card with a script tag. The key never reaches the browser. Keys are created in the partner console: see Create partner API keys and a webhook.

All requests are server to server (no CORS) with Authorization: Bearer lgp_…, against the LegitGeo API origin, for example https://api.legitgeo.com.

Step 1: create the account

POST /partner/v1/accounts with { externalId, business } creates the account and returns 201. It is idempotent on externalId: a repeat returns the same account with 200. business has name, city, region, phone, category, serviceArea, website and optional listing links.

To avoid paid work before your own record is saved, send "status": "staged". A staged account has no sessions, checks or billable activity. After your record is durably stored, PATCH it to active with an increasing revision. A stale revision returns 409. Only tell a customer it is on after a GET shows the status you expect.

Step 2: mint a session

POST /partner/v1/accounts/{id}/sessions returns { clientSecret, expiresAt }. The secret starts with lges_, works once and expires in 15 minutes. Call it from your own endpoint each time the page renders the card.

Step 3: mount the card

Add <script src="https://YOUR-LEGITGEO-API/embed/v1.js" data-partner="your-slug"> and call LegitGeo.mount(target, options) with a fetchClientSecret function that calls your endpoint. Options are in Embedded card reference.

Your page’s origin must be in your allowed origins, which LegitGeo staff or the console set, or the browser refuses to frame the card.

Frequently asked questions

Do test accounts show real data?

No. Test accounts are previews: with no answers yet they show sample visibility, flagged sample, and are not billed. Use live mode for ongoing measurement. See Partner API errors, limits and modes.

Was this helpful?