Zernio
APIFor you
Zernio
APIFor you
API Reference

Creatives

Creative libraryGETAd image libraryGETAd video libraryGETList TikTok ad identitiesGETList partnership ad contentGETList partnership permissionsGETCreate a standalone creativePOSTCreative detailsGETDirect video and image URLs for an adGETRender previews of an existing adGETGet ad video processing statusGETSet partnership permissionPOSTRename a creativePUTDelete a creativeDELETEDelete an ad videoDELETERender pre-create ad previewsPOSTUpload an ad image from base64POSTUpload an ad videoPOST
Dashboard
OverviewPlatformsAPI ReferenceResources
Creatives

Render pre-create ad previews

Shows how a Meta creative will look in each placement before you create the ad, as embeddable previews.

Renders how a creative would look per placement BEFORE any ad exists, via Meta's /generatepreviews. Provide exactly one creative source: existingCreativeId or creativeSpec. Each preview is an HTML <iframe> snippet embeddable directly. Unknown formats values return Meta's 400 verbatim.


PlatformsMeta
POST
/v1/ads/preview

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adcreatives.generateAdPreviews({  body: {    accountId: 'account_abc123',    adAccountId: 'adaccount_abc123',  },});console.log(data);
{  "previews": [    {      "format": "string",      "html": "string"    }  ]}
Was this page helpful?

Delete an ad video

Removes a video from a Meta ad account's video library. Meta's canonical `DELETE /{video_id}` fails with code 10 / subcode 1363055 for videos uploaded via `/act_X/advideos` even with `ads_management`; this endpoint uses the working account-scoped shape `DELETE /act_X/advideos?video_id=<id>` and returns Meta's `{success: true}` verbatim. Deleting a video that lives in a different ad account, or that Meta has already removed, returns Meta's error verbatim as a 4xx.

Upload an ad image from base64

Uploads an image file to a Meta ad account's library, for creatives that are not hosted at a public URL. Returns the image `hash` (Meta's identifier for the asset) and the Meta-hosted `url`, which can be used directly as `imageUrl` on the create endpoints. Max 30 MB decoded.

accountId*string

Zernio SocialAccount id used to resolve the Meta token.

adAccountId*string

Platform ad account id (Meta act_, Google customer id, LinkedIn account id, ...).

formats?array<string>

Meta ad_format values, one preview per format. Defaults to [DESKTOP_FEED_STANDARD].

Items1 <= items <= 10
existingCreativeId?string

Preview an existing ad-account creative by id. Mutually exclusive with creativeSpec.

creativeSpec?

Raw Meta creative spec forwarded verbatim to /generatepreviews. Mutually exclusive with existingCreativeId.