Skip to content

Status and result of an ads connection session

GET /api/embed/ads-sessions/{sessionId}

Source of truth for the result: when status is completed, result carries the activated accounts ({ provider, ad_accounts: [{ ad_account_id, name, status }] }). Requires the marketing:read scope.

StatusDescriptionSchema
200—EmbedAdsSessionViewDto
Terminal window
curl -X GET https://api.neike.dev/api/embed/ads-sessions/{sessionId} \
-H "x-neike-api-key: whk_live_…"
FieldTypeDescription
session_idstringrequiredExample: "nkes_9fQ2aB…".
statuspending · opened · completed · revoked · expiredrequiredpending (nobody opened the iframe), opened, completed, revoked or expired (computed on read).
providermetarequired—
allowed_originsstring[]required—
external_refstringoptional—
resultobjectoptionalWith status: completed, { provider, ad_accounts: [{ ad_account_id, name, status }] }, the accounts the end user activated. While the session is in progress it carries the accounts that the Meta login discovered.
last_errorstringoptional—
expires_atstring (date-time)required—
opened_atstring (date-time)optional—
completed_atstring (date-time)optional—
created_atstring (date-time)required—