VoidhashDocs
DevelopersHelp centerGuidesAPI reference
Dashboard
Essentials
API overview
Authentication
Event capture
Push device API
Webhooks
Webhook delivery
Webhook events
Projects & keys
Projects
API keys
Audit log
Customers & access
Persons
Products
Perks
Sandbox
Paywalls
Paywalls
Paywall locations
Components
Component registry
Assets
Experiments & flags
Experiments
Feature flags
Analytics & events
Analytics
Analytics alerts
Events
Ingest policy
VoidQL
Tracking domains
Ads
Ads
Ad accounts
Meta measurement
Payments & stores
Payment providers
Payment provider products
Purchase history imports
Payment sources
Webhooks & notifications
Webhooks
Push notifications
Push configurations
Automations
Organization & team
Organizations
Members
Invitations
Billing
Your account
Profile
Session
Notices
Connected apps
Terms of Service
Developer tools
Schema
SDK
List campaigns
Retrieve a campaign
List ad groups
Retrieve an ad group
List ads
Retrieve an ad
Preview a creative
Retrieve ads settings
Update ads settings
Report ad performance
Report creatives
Report ad cohorts
Report ad changes

Preview a creative

Shows one image of a synced creative, by the platform's id, as a model can look at it: an image, a video's poster frame, or the platform's small thumbnail when nothing larger was synced, upright, at most 1568 pixels on its longest side, as base64 JPEG.

media picks which of its images and videos, from 0. It is fetched from the platform's CDN at the link the last sync stored. Needs project:ads:read.

Guide: Ads reports

GET
/api/v1/projects/{projectId}/ads/creatives/{creativeId}/preview

Authorization

AuthorizationBearer <token>

A project secret key: vh_sk_... for production, vh_sk_test_... for test. Keep it on your servers.

In: header

Path parameters

projectId*string

The project's id, proj_.... A secret key works only in the project it belongs to.

creativeId*string

The platform's id of the creative.

Query parameters

media?integer

Which of the creative's images and videos, counted from 0 in the order the creatives report lists its media. Defaults to 0.

Range0 <= value

Examples

curl -X GET "https://api.voidhash.com/api/v1/projects/proj_tz4a98xxat96iws9zmbrgj3a/ads/creatives/120210000000000004/preview?media=0" \  -H "Authorization: Bearer vh_sk_..."
{  "media": 0,  "mediaCount": 1,  "source": "video_frame",  "image": {    "contentType": "image/jpeg",    "imageBase64": "/9j/4AAQSkZJRgABAQAAAQABAAD...",    "width": 1080,    "height": 1350,    "sourceWidth": 1080,    "sourceHeight": 1350  }}

{  "error": {    "type": "invalid_request",    "code": "media_out_of_range",    "message": "This creative has 3 images and videos, counted from 0.",    "param": "media"  }}

{  "error": {    "type": "unauthenticated",    "code": "invalid_api_key",    "message": "This secret key is not valid."  }}
{  "error": {    "type": "permission_denied",    "code": "permission_denied",    "message": "Insufficient permissions."  }}

{  "error": {    "type": "not_found",    "code": "creative_not_found",    "message": "This project has no synced creative 120210000000000004.",    "param": "creativeId"  }}

{  "error": {    "type": "internal",    "code": "internal_error",    "message": "Something went wrong on our side. Try again, and contact support with the Request-Id header if it keeps failing."  }}

{  "error": {    "type": "unavailable",    "code": "creative_image_expired",    "message": "The ad platform no longer serves this image at the link Voidhash synced on 2026-10-28T09:14:02.000Z. Its links expire, and each full sync of the ad account stores fresh ones."  }}

Response body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Errors

StatustypecodeWhen
400invalid_requestmedia_out_of_range—
400invalid_requestimage_unreadable—
400invalid_requestimage_too_largeFor an image over 30 MB.
404not_foundcreative_not_found—
404not_foundcreative_image_not_foundWhen no link to the image was synced or it is hosted outside the platform.
503unavailablecreative_image_expiredWhen the platform no longer serves the link, which a later sync renews.
503unavailablecreative_image_unavailable—

It can also fail with the errors every operation shares, such as unauthenticated; see Errors.

More in Ads

  • List campaigns GET
  • Retrieve a campaign GET
  • List ad groups GET
  • Retrieve an ad group GET
  • List ads GET
  • Retrieve an ad GET
  • Retrieve ads settings GET
  • Update ads settings PATCH
  • Report ad performance POST
  • Report creatives POST
  • Report ad cohorts POST
  • Report ad changes POST

Something wrong or missing on this page? Tell us by email or on Discord.

PreviousRetrieve an adNextRetrieve ads settings

On this page

AuthorizationPath parametersQuery parametersExamplesResponse bodyErrorsMore in Ads