
| Parameter | Description |
|---|---|
ad_group_idstring Required | Identify every ad group that you want to generate previews for. 100 maximum ad groups per request. |
curl --request POST \ --url https://api.pinterest.com/v5/ad_accounts/123456789012/campaign_ad_preview \ --header 'authorization: Bearer pina_ABCD1234...' \ --header 'content-type: application/json' \ --data '[ { "ad_group_id": "2680085790110" }, { "ad_group_id": "2680087870156" } ]'
| Field | Description |
|---|---|
dataobject | Container for each returned ad preview and associated metadata. |
data.uuidstring | Unique identifier for the preview within the object. |
data.urlstring | URL for the preview within the object. |
data.expires_atinteger | Unix time in milliseconds for when the preview expires, which is in 30 days. After the preview expires, you need to rerun the request to generate preview URLs again. |
data.ad_group_idstring | Identifier for the parent ad group for the ad or product group promotion in the object. |
data.pin_idstring | Identifier for the organic Pin, if the preview is for an ad. |
data.pin_promotion_idstring | Identifier for the promoted Pin, if the preview is for an ad. |
data.promoted_product_group_idstring | Identifier for the product group promotion, if the preview is for a product group promotion. |
data.is_activeboolean | Whether the preview is active and can be viewed ( true |
data.exceptionsobject | Container for errors that the endpoint reports with any ad groups in the request. A request can partially fail. For example, if a request includes two ad groups, the endpoint can return previews for one ad group and exceptions/errors for the other. Previews for each ad group are all generated in batch, so if there is an exception with any of ads within the ad group, no previews will be generated for that ad group. |
data.exceptions.codeinteger | Code for an error. |
data.exceptions.messagestring | Explanation of the error. |
0110[ { "data": { "uuid": "283d5bc1-c1db-4a84-9a28-73bbdc77f64b", "url": "https://ads.pinterest.com/web-ad-preview/283d5bc1-c1db-4a84-9a28-73bbdc77f64b/", "expires_at": 1776957856993, "advertiser_id": 549765694862, "user_id": 956944758230631867, "ad_group_id": "2680085790110", "is_active": true, "pin_id": 956944620824666359, "pin_promotion_id": 687283938179 } }, { "data": { "uuid": "7f2d9a3b-0a64-4f89-9c6a-1e6f6b7d9c21", "url": "https://ads.pinterest.com/web-ad-preview/7f2d9a3b-0a64-4f89-9c6a-1e6f6b7d9c21/", "expires_at": 1776957858200, "advertiser_id": 549765694862, "user_id": 956944758230631867, "ad_group_id": "2680085790110", "is_active": true, "pin_id": 956944620824666360, "pin_promotion_id": 687283938180 } }, { "data": { "uuid": "c1b5f2a6-3f7d-4a49-8b32-4c5a4d92d8ef", "url": "https://ads.pinterest.com/web-ad-preview/c1b5f2a6-3f7d-4a49-8b32-4c5a4d92d8ef/", "expires_at": 1776957859300, "advertiser_id": 549765694862, "user_id": 956944758230631867, "ad_group_id": "2680085790110", "is_active": true, "pin_id": 956944620824666361, "pin_promotion_id": 687283938181 } }, { "data": { "uuid": "10710eff-8638-4d11-8111-0d67669eb4b8", "url": "https://ads.pinterest.com/web-ad-preview/10710eff-8638-4d11-8111-0d67669eb4b8/", "expires_at": 1776957857911, "advertiser_id": 549765694862, "user_id": 956944758230631867, "ad_group_id": "2680087870156", "is_active": true, "pin_id": 956944620830868834, "pin_promotion_id": 687295612761 } } ]
[ { "data": { "uuid": "aa5d8586-9de9-441b-a544-6137c1b543bd", "url": "https://ads.pinterest.com/web-ad-preview/aa5d8586-9de9-441b-a544-6137c1b543bd/", "expires_at": 1777055255104, "advertiser_id": 549765694862, "user_id": 956944758230631867, "ad_group_id": "2680085790110", "is_active": true, "pin_id": 956944620824666359, "pin_promotion_id": 687283938179 } }, { "data": { "exceptions": { "code": 29, "message": "Ad group 1111111111111 is not owned by advertiser 549765694862" } } } ]
| Code | Message | Action |
|---|---|---|
400 | Invalid requestInvalid parameters. References the entire request. | Do the following and rerun the request for the ad group:
|
29 | Ad group <AD_GROUP_ID> is not owned by advertiser <ADVERTISER_ID>References a data | Rerun the request without the ad group. |
0 | Failed to create preview for ad group <AD_GROUP_ID>Unexpected failure. References a data | Try running the request again. If this error continues to occur, contact Support.\ |