Create an Ad
Ad with matching lookup_key already exists. Returns existing ad without modification.
API key necessary to authenticate API requests
Organization slug
abc-companyBearer token for API authentication
OK - Existing ad returned
ade9b4c72e-7520-4e3f-a3e8-a092b927f0d4My Admy-internal-key-0001uploadedPossible values: displayMedia type: url or html_tag
url8304d4b0-90e0-4c58-ae3d-38807b23fd9c2023-02-14T09:18:48.318-05:00https://app.adreform.com/o/abc-company/campaigns/8304d4b0/ads/e9b4c72eCreated
Unauthorized
Forbidden
Unprocessable Entity
POST /api/v1/orgs/{organization_slug}/ads HTTP/1.1
Host: app.adreform.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 349
{
"campaign": {
"id": "8304d4b0-90e0-4c58-ae3d-38807b23fd9c",
"name": "New Campaign - Via API"
},
"ad": {
"name": "My Ad",
"lookup_key": "my-internal-key-0001",
"media": {
"type": "url",
"content": "https://placehold.co/300x250"
}
},
"subscribers": [
{
"webhook": {
"url": "https://webhook.site/callback"
},
"s3": {
"bucket": "my-bucket",
"region": "us-east-1",
"key_prefix": "ads/"
}
}
]
}{
"type": "ad",
"id": "e9b4c72e-7520-4e3f-a3e8-a092b927f0d4",
"name": "My Ad",
"lookup_key": "my-internal-key-0001",
"status": "uploaded",
"category": "display",
"kind": "url",
"campaign_id": "8304d4b0-90e0-4c58-ae3d-38807b23fd9c",
"created_at": "2023-02-14T09:18:48.318-05:00",
"html_url": "https://app.adreform.com/o/abc-company/campaigns/8304d4b0/ads/e9b4c72e"
}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_keyalready exists in the campaign, we'll return the existing ad with a200 OKstatusThe
mediain the request is ignored when returning an existing adNew ads are created with a
201 Createdstatus
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.
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.
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
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:
S3 Subscriber
Push the ad preview image to your S3 bucket when ready:
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
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
nothing_to_capture
The creative has no visual content, so there is nothing to screenshot
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