GET /v1/projects/:projectId/ads/ad-accounts
List Meta, TikTok, and Apple ad accounts connected to a project, with credential health.
/v1/projects/{projectId}/ads/ad-accounts- Auth
- Bearer
- Scope
- ads:read
Returns every ad account connected to the project across Meta, TikTok, and Apple Search Ads. Each account carries the platform-native id and current credential health. Layers' ad platform integrations are bring-your-own: partners connect their own ad accounts via OAuth, and platform billing runs against the partner's own funding source.
projectIdstring (UUID)requiredProject to list within.
platformsstring[]optionalRestrict to one or more platforms.One of:meta_ads,tiktok_ads,apple_adshealthybooleanoptionalKeep only ad accounts with tokenStatus=valid.
Example request
curl "https://api.layers.com/v1/projects/prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39/ads/ad-accounts?healthy=true" \
-H "Authorization: Bearer lp_..."const res = await fetch(
`https://api.layers.com/v1/projects/${projectId}/ads/ad-accounts?healthy=true`,
{ headers: { Authorization: `Bearer ${apiKey}` } },
);
const { items } = await res.json();import httpx
r = httpx.get(
f"https://api.layers.com/v1/projects/{project_id}/ads/ad-accounts",
params={"healthy": True},
headers={"Authorization": f"Bearer {api_key}"},
)
items = r.json()["items"]Response
{
"items": [
{
"adAccountId": "01HXF1A2B3C4D5E6F7G8H9J0K1",
"platform": "meta_ads",
"externalId": "act_123456789012345",
"name": "Acme Coffee - US",
"currency": "USD",
"timezone": "UTC",
"tokenStatus": "valid",
"tokenLastValidatedAt": null,
"connectedAt": "2026-03-02T14:11:00Z"
},
{
"adAccountId": "01HXF2A2B3C4D5E6F7G8H9J0K1",
"platform": "tiktok_ads",
"externalId": "7389201...",
"name": "Acme Coffee TikTok",
"currency": "USD",
"timezone": "UTC",
"tokenStatus": "valid",
"tokenLastValidatedAt": null,
"connectedAt": "2026-03-18T09:42:00Z"
},
{
"adAccountId": "01HXF3A2B3C4D5E6F7G8H9J0K1",
"platform": "apple_ads",
"externalId": "org-9823412",
"name": "Acme Coffee iOS",
"currency": "USD",
"timezone": "UTC",
"tokenStatus": "expired",
"tokenLastValidatedAt": null,
"connectedAt": "2026-02-11T19:05:00Z"
}
]
}The response is unpaginated. Each project has at most one ad account connection per platform, so items returns the union directly with no nextCursor.
All ad accounts are bring-your-own: the end-customer connects their own ad account via OAuth, and platform billing runs against the customer's own funding source on the platform.
Token status
| Value | Meaning |
|---|---|
valid | Last validation call succeeded. Safe to use. |
expired | Refresh attempt failed. Reconnect via POST /v1/projects/:projectId/ads/ad-accounts/oauth-url. |
revoked | User revoked the grant on the platform. Reconnect required. |
pending | Connection just initiated; first validation has not landed. |
tokenLastValidatedAt may be null until the first validation timestamp is available.
Notes
- Query the platform's own API if you need the account's spend or wallet state — Layers does not surface it.
externalIdis the platform-native account id -act_...on Meta, a numeric string on TikTok,org-...on Apple. Use it when linking out to the platform's ad manager.timezonemay be"UTC"when the platform-native timezone is unavailable. If you need the local-clock timezone the ads are bidding against, query the platform's own API.- A
tokenStatusofexpiredorrevokeddoes not immediately pause running ads - the platform keeps those running from its side. New ad creation against that ad account will fail until reconnected. - Disconnected ad accounts are excluded from the response by default. There is no include-disconnected flag.
See also
POST /v1/projects/:projectId/ads/ad-accounts/oauth-url- connect or reconnectGET /v1/projects/:projectId/ads/campaigns- campaigns on these accountsGET /v1/projects/:projectId/ads/capi-status- CAPI relay health per platform
Ads
Read and write across Meta, TikTok, and Apple Search Ads — campaigns, ad sets, ads, creatives, budgets, optimizer triggers, pending queue, audit log, and metrics. BYO ad accounts; the customer's bucket-mode authority gate is the source of truth on every write.
POST /v1/projects/:projectId/ads/ad-accounts/oauth-url
Create a one-time OAuth URL for connecting a Meta, TikTok, or Apple ad account to a project.