Adlyfy
    • Introduction
    • Quick Start
    • Authorization
      • Overview
      • Create New External User Token
        POST
      • Refresh External User Token
        GET
    • Ads Platform Connection
      • Activate adAccount
        POST
      • Deactivate adAccount
        POST
      • Get all external-user connections
        GET
      • Generate OAuth authorization URL
        POST
      • Check connection status
        GET
      • Remove a connection by ads account ID
        DELETE
      • Revoke a connection by connection ID
        DELETE
      • Read Meta ad account insights through the connection surface
        GET
    • Meta
      • Meta - Ad Accounts & Business
        • Import Meta ad account data
        • List Meta pages for an ad account
        • List Meta ad accounts
        • Get Meta ad account details
        • List Meta businesses
        • Get Meta business details
        • List business-owned ad accounts
        • List business product catalogs
      • Meta - Campaigns
        • Create a lead campaign
        • Create an awareness campaign
        • Create a traffic campaign
        • Create an engagement campaign
        • Create a sales campaign
        • List Meta campaigns
        • Get Meta campaign details
        • List ads for a Meta campaign
        • Update Meta campaign status
      • Meta - Ad Sets
        • List Meta ad sets
        • Get Meta ad set details
        • List ads for a Meta ad set
        • Update Meta ad set status
      • Meta - Ads
        • List Meta ads
        • Get Meta ad details
        • Update Meta ad status
      • Meta - Ad Creatives
        • List Meta ad creatives
        • Preview a Meta ad creative
        • Get Meta ad creative details
      • Meta - Audiences & Targeting
        • List saved audiences
        • List custom audiences
        • Create a lookalike audience
        • Estimate audience size
        • Search Meta targeting options
      • Meta - Pixels & Conversions
        • Create a Meta pixel
        • List Meta pixels
        • Create a Meta custom conversion
        • List Meta custom conversions
        • Get Meta custom conversion details
        • Get Meta pixel details
        • Get Meta pixel stats
        • Get Meta dataset quality
      • Meta - Lead Forms
        • Create a Meta lead form
        • List Meta lead forms
      • Meta - Insights
        • Read Meta insights
    • TikTok
      • TikTok - Account & Import
        • Import a TikTok ad account
      • TikTok - Assets
        • Read TikTok assets
        • Update TikTok asset status
        • Create TikTok assets
      • TikTok - Insights
        • Read TikTok insights
      • TikTok - Pixels
        • Read TikTok pixels
        • Read TikTok pixel event statistics
      • TikTok - Smart+ Campaigns
        • Read TikTok Smart+ campaigns
        • Create a TikTok Smart+ campaign
        • Update a TikTok Smart+ campaign
        • Update TikTok Smart+ campaign status
      • TikTok - Smart+ Ad Groups
        • Read TikTok Smart+ ad groups
        • Create a TikTok Smart+ ad group
        • Update a TikTok Smart+ ad group
        • Update TikTok Smart+ ad group status
      • TikTok - Smart+ Ads
        • Read TikTok Smart+ ads
        • Create a TikTok Smart+ ad
        • Update a TikTok Smart+ ad
        • Update TikTok Smart+ ad status
        • Submit an appeal for a TikTok Smart+ ad
        • Read TikTok Smart+ ad review information
        • Update TikTok Smart+ ad material status
      • TikTok - Smart+ Materials
        • Read TikTok Smart+ material review information
    • Google
      • List accessible Google ad accounts
      • Import a Google ad account
      • Read Google insights
      • Read Google assets
      • Execute a Google GAQL query
    • Schemas
      • StandardSuccessEnvelopeDto
      • GenericObjectDto
      • AuthTokensDto
      • CreateUserDto
      • AuthTokenDto
      • MessageDto
      • ChangePasswordDto
      • ResetPasswordDto
      • ForgetPasswordDto
      • AcceptInvitationDto
      • UpdateTenantProfileDto
      • TenantApiKeyDto
      • UpdateTenantDto
      • MetaTenantAppCreateDto
      • GoogleTenantAppCreateDto
      • TiktokTenantAppCreateDto
      • LinkedinTenantAppCreateDto
      • MetaTenantAppUpdateDto
      • GoogleTenantAppUpdateDto
      • TiktokTenantAppUpdateDto
      • LinkedinTenantAppUpdateDto
      • PlatformFieldDto
      • PlatformMetadataDto
      • StandardErrorEnvelopeDto
      • AccessTokensDto
      • TokenDto
      • AccessTokenDto
      • AuthUrlDto
      • ConnectionStatusItemDto
      • ConnectionStatusDto
      • MetaAccessTokenDto
      • MetaTokenBrokerDto
      • CreateLookalikeAudienceDto
      • EstimateAudienceDto
      • CustomConversionRuleDto
      • CreateCustomConversionDto
      • TargetingSearchDto
      • PreviewAdcreativeDto
      • MetaStatusUpdateDto
      • FindOperationsDto
      • ExecuteOperationDto
      • CreateAdCloneDto
      • CreateMetaAds
      • CreateAssetsDto
      • CreateCampaignDto
      • CreateAdGroupDto
      • UtmParamDto
      • DisclaimerTextDto
      • DisclaimerClickableTextDto
      • CreateAdDto
      • Object
      • ReadTikTokPixelsDto
      • ReadTikTokPixelEventsDto
      • ReadTikTokSmartPlusCampaignsDto
      • ReadTikTokSmartPlusAdgroupsDto
      • ReadTikTokSmartPlusAdsDto
      • SmartPlusCampaignBody
      • CreateTikTokSmartPlusCampaignDto
      • UpdateTikTokSmartPlusCampaignDto
      • UpdateTikTokSmartPlusCampaignStatusDto
      • SmartPlusAdgroupBody
      • CreateTikTokSmartPlusAdgroupDto
      • UpdateTikTokSmartPlusAdgroupDto
      • UpdateTikTokSmartPlusAdgroupStatusDto
      • SmartPlusAdBody
      • CreateTikTokSmartPlusAdDto
      • UpdateTikTokSmartPlusAdDto
      • UpdateTikTokSmartPlusAdStatusDto
      • UpdateTikTokSmartPlusAdMaterialStatusDto
      • AppealTikTokSmartPlusAdDto
      • ReadTikTokSmartPlusAdReviewInfoDto
      • ReadTikTokSmartPlusMaterialReviewInfoDto
      • CreateTenantInvitationDto

    Quick Start

    Getting Started#

    This guide takes you from zero to your first successful Adlyfy API call.
    The journey has two parts:
    1.
    One-time setup in the Adlyfy portal — create an account, register your app, and get an API key.
    2.
    Make API calls — mint an access token, then call any platform endpoint.
    Base URL. All API requests go to the Adlyfy production API:
    https://<adlyfy-api-host>/api/v1
    Every endpoint path in this documentation is relative to this base URL.

    Part 1 — Set up in the Adlyfy portal#

    Step 1 — Create your Adlyfy account#

    Sign up for an account on the Adlyfy portal. This creates your tenant — the isolated workspace that owns all your apps, connections, and API keys.
    📹 Watch how: [PASTE SCRIBE LINK — "How to register an account on the Adlyfy portal"]

    Step 2 — Register your app#

    Register your platform app (Meta, Google Ads, or TikTok) in the portal. Adlyfy is bring-your-own-app: you provide your own platform developer-app credentials, and Adlyfy uses them to run OAuth on your behalf.
    📹 Watch how: [PASTE SCRIBE LINK — "How to register an app"]

    Step 3 — Get your API key#

    Generate an API key for your tenant. This key (x-api-key) authenticates your integration with Adlyfy. It is shown only once — store it securely.
    📹 Watch how: [PASTE SCRIBE LINK — "How to get an API key"]

    Part 2 — Make your first API call#

    Adlyfy uses a two-step authentication for integrators:
    1.
    You hold a long-lived API key (x-api-key) that identifies your tenant.
    2.
    You exchange it for a short-lived access token (a JWT) that identifies an external user within that tenant.
    3.
    Every platform call is sent with both the API key and the access token.
    The full reference is in Authentication — this page just gets you moving.

    Step 4 — Mint an access token#

    Exchange your API key for an access token. externalUserId is any stable identifier your integration uses for the end user (a plain string).
    Response:
    {
      "success": true,
      "data": {
        "accessToken": "eyJhbGciOi...",
        "refreshToken": "eyJhbGciOi..."
      }
    }
    Keep the accessToken for your API calls and the refreshToken to obtain a new access token when it expires (see Authentication).

    Step 5 — Make an authenticated call#

    Send both the API key and the access token. Here we list Meta campaigns for an ad account:
    Response:
    {
      "success": true,
      "data": {
        "data": [
          {
            "id": "120000000001",
            "name": "Lead Gen - March",
            "status": "ACTIVE",
            "objective": "OUTCOME_LEADS"
          }
        ],
        "paging": {
          "before": "QVFI...",
          "after": "QVFI..."
        }
      }
    }
    That's it — you've made an authenticated, platform-backed call through Adlyfy.

    Understanding the response envelope#

    Every Adlyfy response — success or error — uses a consistent envelope, so you can handle them uniformly.
    Success:
    {
      "success": true,
      "data": { }
    }
    Error:
    {
      "success": false,
      "error": {
        "code": "BAD_REQUEST",
        "message": "Validation failed",
        "details": ["adAccountId is required"]
      },
      "statusCode": 400,
      "path": "/api/v1/meta/campaigns",
      "timestamp": "2026-06-30T12:00:00.000Z"
    }
    Always check success first. On errors, error.code is stable for programmatic handling, while error.message / error.details are for humans. See Errors & Status Codes for the full list.

    Interactive API reference#

    Adlyfy serves live, interactive API docs generated from the gateway itself:
    Swagger UI: https://<adlyfy-api-host>/api
    OpenAPI JSON: https://<adlyfy-api-host>/api-json
    Note: the Swagger UI lives at /api (not /api/v1/api) — the docs are mounted outside the version prefix.

    Next steps#

    Authentication — token lifetimes, refreshing tokens, and the headers every call needs.
    Connections & OAuth — register a platform app and authorize an ad account so data endpoints work.
    Pagination — how to page through large result sets with cursors.
    Previous
    Introduction
    Next
    Overview
    Built with