Create an Ad

circle-info

This feature is currently in beta. Contact [email protected]envelope if you're interested in trying the beta.

Create an Ad

post

Creates an ad independently from the screenshot request workflow.

This endpoint is idempotent when using lookup_key:

  • If an ad with the specified lookup_key already exists in the campaign, returns the existing ad with 200 OK
  • New ads are created with 201 Created
Authorizations
AuthorizationstringRequired

API key necessary to authenticate API requests

Path parameters
organization_slugstringRequired

Organization slug

Example: abc-company
Header parameters
AuthorizationstringOptional

Authorization

Body
Responses
chevron-right
200

OK (existing ad returned)

application/json
post
/api/v1/orgs/{organization_slug}/ads

Overview

This endpoint allows you to create ads independently from the screenshot request workflow. This is useful when you want to:

  • Pre-create ads before requesting screenshots

  • Manage ad inventory separately from screenshot generation

  • Build integrations that separate ad upload from screenshot workflows

Idempotent Behavior

This endpoint is fully idempotent when using lookup_key:

  • If an ad with the specified lookup_key already exists in the campaign, we'll return the existing ad with a 200 OK status

  • The media in the request is ignored when returning an existing ad

  • New ads are created with a 201 Created status

This makes it safe to retry requests without risking duplicate ad creation.

Disabled organizations

When an organization is disabled (i.e. it does not have an active subscription), the API will return a 403 Forbidden response:

The Campaign object

The campaign object tells us where to store the ad. You must include either campaign.id or campaign.name in the request.

circle-info

Using campaign.name is the most common approach, as we will find or create a Campaign using this key.

campaign.id

The Ad Reform ID for an existing Campaign. Use this if you know the specific ID for the campaign you want to use.

campaign.name

The name you want to use for the Campaign. If a Campaign already exists with this name, we'll use that, otherwise we'll create a new one.

circle-info

Note: Campaign names cannot be longer than 250 characters. A campaign.name longer than 250 characters will be truncated automatically.

The Ad object

The ad object contains the ad creative data.

ad.lookup_key (optional)

A unique identifier for this ad. Use this to make requests idempotent - if an ad already exists with this lookup_key in the campaign, we'll return that ad instead of creating a new one.

ad.name (optional)

A human-readable name for the ad.

ad.media (required for new ads)

The ad creative content. Contains:

  • type: Either "url" or "html_tag"

  • content: The URL or HTML tag content

circle-exclamation

Media Types

URL (type: "url")

Use this for ad tag URLs that resolve to a creative. The URL will be fetched and rendered to capture the ad preview.

HTML Tag (type: "html_tag")

Use this for raw HTML ad tags (like script tags or iframe embeds).

Subscribers (optional)

You can optionally subscribe to notifications when the ad preview is captured by including a subscribers array.

Webhook Subscriber

Receive an ad.uploaded webhook event when the ad preview is ready:

circle-exclamation

S3 Subscriber

Push the ad preview image to your S3 bucket when ready:

circle-info

S3 subscriptions require an S3 connector to be configured for your organization.

Response

Success Response (201 Created)

For newly created ads:

Success Response (200 OK)

When an existing ad is returned via lookup_key, the response contains the ad's current state:

Status Values

Status
Description

pending

Ad created, preview capture in progress

uploaded

Preview capture completed successfully

not_found

Media URL could not be found

net_read_timeout

Network timeout during capture

generic_error

Other capture error

Error Response (422 Unprocessable Entity)

Example Requests

Create ad with URL media

Create ad with HTML tag and webhook subscriber

Idempotent request (returns existing ad)

Last updated