Layers

GET /v1/projects/:projectId/apple-ads-attribution

Apple Search Ads token-exchange records scoped to the project.

View as Markdown
GET/v1/projects/:projectId/apple-ads-attribution
Phase 1stable
Auth
Bearer
Scope
events:read

Returns Apple Search Ads (ASA) attribution records the Layers SDK captured on iOS installs. Each record carries the campaign and ad group the install attributed to, plus the install timestamp.

The Layers SDK collects the Apple attribution token at first launch. Layers exchanges that token with Apple and returns the retained campaign, ad group, country, and install timestamp fields through this endpoint. Apple-side fields that Layers does not retain are returned as zero or null placeholders.

Records appear only for users who installed via an ASA ad and whose device returned a valid token within the Apple-defined attribution window. Organic installs and users who opted out of tracking (att_status != authorized) do not appear here.

Path
  • projectId
    stringrequired
    Project ID.
Query
  • userId
    stringoptional
    Filter to a single `app_user_id`.
  • since
    string (ISO 8601, UTC Z)optional
    Inclusive lower bound on `installedAt`.
  • until
    string (ISO 8601, UTC Z)optional
    Exclusive upper bound on `installedAt`.
  • cursor
    stringoptional
    Opaque pagination token.
  • limit
    integeroptionaldefault: 50
    Page size, 1–200.

Example request

curl "https://api.layers.com/v1/projects/prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39/apple-ads-attribution?since=2026-04-11T00:00:00Z" \
  -H "Authorization: Bearer lp_..."
const { records, nextCursor } = await layers.appleAdsAttribution.list(
  "prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
  { since: "2026-04-11T00:00:00Z" }
);
result = layers.apple_ads_attribution.list(
    project_id="prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
    since="2026-04-11T00:00:00Z",
)

Response

200OK
{
  "records": [
    {
      "recordId": "01HXA7K8M2P4RSTUV56789AB",
      "appUserId": "user_a7f3c1d9",
      "appId": "01HXA1NPQR5TVWXYZABCDEFGH",
      "attribution": "true",
      "orgId": 0,
      "campaignId": 1440210011,
      "adGroupId": 1440210072,
      "keywordId": 0,
      "creativeSetId": 0,
      "countryOrRegion": "US",
      "conversionType": "Download",
      "clickDate": null,
      "installedAt": "2026-04-11T16:06:02Z",
      "reDownload": false,
      "exchangedAt": "2026-04-11T16:06:02Z"
    }
  ],
  "nextCursor": null
}

recordId and appId are returned as raw UUIDs without partner prefixes. orgId, keywordId, creativeSetId, and clickDate may be zero or null; treat the campaignId + adGroupId pair as the canonical attribution key. exchangedAt mirrors installedAt.

Errors

StatusCodeWhen
400VALIDATIONBad since/until or cursor.
401UNAUTHENTICATEDMissing or invalid key.
403FORBIDDEN_SCOPEKey lacks events:read.
404NOT_FOUNDProject does not exist.
429RATE_LIMITEDRead budget exhausted.

See also

On this page