zernio-sdk 0.0.549 → 0.0.551

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -74
  3. data/docs/AdAccountsApi.md +915 -0
  4. data/docs/AdCampaignsApi.md +615 -15
  5. data/docs/AdCreativesApi.md +815 -0
  6. data/docs/AdInsightsApi.md +415 -0
  7. data/docs/AdTargetingApi.md +371 -0
  8. data/docs/AnalyticsApi.md +7 -7
  9. data/docs/ConversionsApi.md +890 -0
  10. data/docs/LeadGenApi.md +527 -0
  11. data/docs/MessagingAdsApi.md +215 -0
  12. data/docs/ReachAndFrequencyApi.md +294 -0
  13. data/docs/TrackingTagsApi.md +141 -0
  14. data/docs/YouTubeDailyViewsResponse.md +2 -0
  15. data/docs/YouTubeDemographicsResponse.md +2 -0
  16. data/docs/YouTubeVideoRetentionResponse.md +2 -0
  17. data/lib/zernio-sdk/api/ad_accounts_api.rb +958 -0
  18. data/lib/zernio-sdk/api/ad_campaigns_api.rb +618 -12
  19. data/lib/zernio-sdk/api/ad_creatives_api.rb +826 -0
  20. data/lib/zernio-sdk/api/ad_insights_api.rb +446 -0
  21. data/lib/zernio-sdk/api/ad_targeting_api.rb +404 -0
  22. data/lib/zernio-sdk/api/analytics_api.rb +8 -8
  23. data/lib/zernio-sdk/api/conversions_api.rb +936 -0
  24. data/lib/zernio-sdk/api/lead_gen_api.rb +547 -0
  25. data/lib/zernio-sdk/api/messaging_ads_api.rb +226 -0
  26. data/lib/zernio-sdk/api/reach_and_frequency_api.rb +316 -0
  27. data/lib/zernio-sdk/api/tracking_tags_api.rb +137 -0
  28. data/lib/zernio-sdk/models/you_tube_daily_views_response.rb +11 -1
  29. data/lib/zernio-sdk/models/you_tube_demographics_response.rb +11 -1
  30. data/lib/zernio-sdk/models/you_tube_video_retention_response.rb +11 -1
  31. data/lib/zernio-sdk/version.rb +1 -1
  32. data/lib/zernio-sdk.rb +8 -1
  33. data/openapi.yaml +321 -162
  34. data/spec/api/ad_accounts_api_spec.rb +206 -0
  35. data/spec/api/ad_campaigns_api_spec.rb +119 -6
  36. data/spec/api/ad_creatives_api_spec.rb +182 -0
  37. data/spec/api/ad_insights_api_spec.rb +120 -0
  38. data/spec/api/ad_targeting_api_spec.rb +101 -0
  39. data/spec/api/analytics_api_spec.rb +4 -4
  40. data/spec/api/conversions_api_spec.rb +199 -0
  41. data/spec/api/lead_gen_api_spec.rb +131 -0
  42. data/spec/api/messaging_ads_api_spec.rb +71 -0
  43. data/spec/api/reach_and_frequency_api_spec.rb +87 -0
  44. data/spec/api/tracking_tags_api_spec.rb +25 -0
  45. data/spec/models/you_tube_daily_views_response_spec.rb +6 -0
  46. data/spec/models/you_tube_demographics_response_spec.rb +6 -0
  47. data/spec/models/you_tube_video_retention_response_spec.rb +6 -0
  48. metadata +34 -6
  49. data/docs/AdsApi.md +0 -5278
  50. data/lib/zernio-sdk/api/ads_api.rb +0 -5391
  51. data/spec/api/ads_api_spec.rb +0 -1015
@@ -4,19 +4,96 @@ All URIs are relative to *https://zernio.com/api*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
+ | [**boost_post**](AdCampaignsApi.md#boost_post) | **POST** /v1/ads/boost | Boost post as ad |
7
8
  | [**bulk_update_ad_campaign_status**](AdCampaignsApi.md#bulk_update_ad_campaign_status) | **POST** /v1/ads/campaigns/bulk-status | Pause or resume many campaigns |
8
- | [**create_ad_campaign**](AdCampaignsApi.md#create_ad_campaign) | **POST** /v1/ads/campaigns | Create a standalone campaign (Meta) |
9
+ | [**create_ad_campaign**](AdCampaignsApi.md#create_ad_campaign) | **POST** /v1/ads/campaigns | Create a standalone campaign |
10
+ | [**create_standalone_ad**](AdCampaignsApi.md#create_standalone_ad) | **POST** /v1/ads/create | Create standalone ad |
11
+ | [**delete_ad**](AdCampaignsApi.md#delete_ad) | **DELETE** /v1/ads/{adId} | Cancel an ad |
9
12
  | [**delete_ad_campaign**](AdCampaignsApi.md#delete_ad_campaign) | **DELETE** /v1/ads/campaigns/{campaignId} | Delete a campaign |
13
+ | [**duplicate_ad**](AdCampaignsApi.md#duplicate_ad) | **POST** /v1/ads/{adId}/duplicate | Duplicate an ad |
10
14
  | [**duplicate_ad_campaign**](AdCampaignsApi.md#duplicate_ad_campaign) | **POST** /v1/ads/campaigns/{campaignId}/duplicate | Duplicate a campaign |
11
- | [**duplicate_ad_set**](AdCampaignsApi.md#duplicate_ad_set) | **POST** /v1/ads/ad-sets/{adSetId}/duplicate | Duplicate an ad set (Meta) |
12
- | [**get_ad_set_details**](AdCampaignsApi.md#get_ad_set_details) | **GET** /v1/ads/ad-sets/{adSetId} | Live ad-set details incl. learning phase (Meta) |
15
+ | [**duplicate_ad_set**](AdCampaignsApi.md#duplicate_ad_set) | **POST** /v1/ads/ad-sets/{adSetId}/duplicate | Duplicate an ad set |
16
+ | [**get_ad**](AdCampaignsApi.md#get_ad) | **GET** /v1/ads/{adId} | Get ad details |
17
+ | [**get_ad_set_details**](AdCampaignsApi.md#get_ad_set_details) | **GET** /v1/ads/ad-sets/{adSetId} | Live ad-set details incl. learning phase |
13
18
  | [**get_ad_tree**](AdCampaignsApi.md#get_ad_tree) | **GET** /v1/ads/tree | Get campaign tree |
14
19
  | [**get_ads_timeline**](AdCampaignsApi.md#get_ads_timeline) | **GET** /v1/ads/timeline | Get daily account metrics |
15
20
  | [**list_ad_campaigns**](AdCampaignsApi.md#list_ad_campaigns) | **GET** /v1/ads/campaigns | List campaigns |
21
+ | [**list_ads**](AdCampaignsApi.md#list_ads) | **GET** /v1/ads | List ads |
22
+ | [**update_ad**](AdCampaignsApi.md#update_ad) | **PUT** /v1/ads/{adId} | Update ad |
16
23
  | [**update_ad_campaign**](AdCampaignsApi.md#update_ad_campaign) | **PUT** /v1/ads/campaigns/{campaignId} | Update a campaign |
17
24
  | [**update_ad_campaign_status**](AdCampaignsApi.md#update_ad_campaign_status) | **PUT** /v1/ads/campaigns/{campaignId}/status | Pause or resume a campaign |
18
25
  | [**update_ad_set**](AdCampaignsApi.md#update_ad_set) | **PUT** /v1/ads/ad-sets/{adSetId} | Update an ad set |
19
26
  | [**update_ad_set_status**](AdCampaignsApi.md#update_ad_set_status) | **PUT** /v1/ads/ad-sets/{adSetId}/status | Pause or resume a single ad set |
27
+ | [**update_ad_status**](AdCampaignsApi.md#update_ad_status) | **PUT** /v1/ads/{adId}/status | Pause or resume a single ad |
28
+
29
+
30
+ ## boost_post
31
+
32
+ > <UpdateAd200Response> boost_post(boost_post_request)
33
+
34
+ Boost post as ad
35
+
36
+ Creates a paid ad campaign from an existing published post. Creates the full platform campaign hierarchy (campaign, ad set, ad).
37
+
38
+ ### Examples
39
+
40
+ ```ruby
41
+ require 'time'
42
+ require 'zernio-sdk'
43
+ # setup authorization
44
+ Zernio.configure do |config|
45
+ # Configure Bearer authorization (JWT): bearerAuth
46
+ config.access_token = 'YOUR_BEARER_TOKEN'
47
+ end
48
+
49
+ api_instance = Zernio::AdCampaignsApi.new
50
+ boost_post_request = Zernio::BoostPostRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example', name: 'name_example', goal: 'engagement', budget: Zernio::BoostPostRequestBudget.new({amount: 3.56, type: 'daily'})}) # BoostPostRequest |
51
+
52
+ begin
53
+ # Boost post as ad
54
+ result = api_instance.boost_post(boost_post_request)
55
+ p result
56
+ rescue Zernio::ApiError => e
57
+ puts "Error when calling AdCampaignsApi->boost_post: #{e}"
58
+ end
59
+ ```
60
+
61
+ #### Using the boost_post_with_http_info variant
62
+
63
+ This returns an Array which contains the response data, status code and headers.
64
+
65
+ > <Array(<UpdateAd200Response>, Integer, Hash)> boost_post_with_http_info(boost_post_request)
66
+
67
+ ```ruby
68
+ begin
69
+ # Boost post as ad
70
+ data, status_code, headers = api_instance.boost_post_with_http_info(boost_post_request)
71
+ p status_code # => 2xx
72
+ p headers # => { ... }
73
+ p data # => <UpdateAd200Response>
74
+ rescue Zernio::ApiError => e
75
+ puts "Error when calling AdCampaignsApi->boost_post_with_http_info: #{e}"
76
+ end
77
+ ```
78
+
79
+ ### Parameters
80
+
81
+ | Name | Type | Description | Notes |
82
+ | ---- | ---- | ----------- | ----- |
83
+ | **boost_post_request** | [**BoostPostRequest**](BoostPostRequest.md) | | |
84
+
85
+ ### Return type
86
+
87
+ [**UpdateAd200Response**](UpdateAd200Response.md)
88
+
89
+ ### Authorization
90
+
91
+ [bearerAuth](../README.md#bearerAuth)
92
+
93
+ ### HTTP request headers
94
+
95
+ - **Content-Type**: application/json
96
+ - **Accept**: application/json
20
97
 
21
98
 
22
99
  ## bulk_update_ad_campaign_status
@@ -92,9 +169,9 @@ end
92
169
 
93
170
  > <CreateAdCampaign201Response> create_ad_campaign(create_ad_campaign_request)
94
171
 
95
- Create a standalone campaign (Meta)
172
+ Create a standalone campaign
96
173
 
97
- Creates a campaign WITHOUT its first ad set / ad (the ODAX shell only). Ad sets join it later via `existingCampaignId` on the create endpoints. A budget here is campaign-level (CBO) by definition; omit it for ABO (each ad set carries its own budget). Created `PAUSED` unless `status: ACTIVE`. The campaign materializes in `/v1/ads/tree` via the next sync discovery pass. Meta only.
174
+ Creates a campaign WITHOUT its first ad set / ad (the ODAX shell only). Ad sets join it later via `existingCampaignId` on the create endpoints. A budget here is campaign-level (CBO) by definition; omit it for ABO (each ad set carries its own budget). Created `PAUSED` unless `status: ACTIVE`. The campaign materializes in `/v1/ads/tree` via the next sync discovery pass.
98
175
 
99
176
  ### Examples
100
177
 
@@ -111,7 +188,7 @@ api_instance = Zernio::AdCampaignsApi.new
111
188
  create_ad_campaign_request = Zernio::CreateAdCampaignRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example', name: 'name_example', goal: 'engagement'}) # CreateAdCampaignRequest |
112
189
 
113
190
  begin
114
- # Create a standalone campaign (Meta)
191
+ # Create a standalone campaign
115
192
  result = api_instance.create_ad_campaign(create_ad_campaign_request)
116
193
  p result
117
194
  rescue Zernio::ApiError => e
@@ -127,7 +204,7 @@ This returns an Array which contains the response data, status code and headers.
127
204
 
128
205
  ```ruby
129
206
  begin
130
- # Create a standalone campaign (Meta)
207
+ # Create a standalone campaign
131
208
  data, status_code, headers = api_instance.create_ad_campaign_with_http_info(create_ad_campaign_request)
132
209
  p status_code # => 2xx
133
210
  p headers # => { ... }
@@ -157,6 +234,148 @@ end
157
234
  - **Accept**: application/json
158
235
 
159
236
 
237
+ ## create_standalone_ad
238
+
239
+ > <CreateStandaloneAd200Response> create_standalone_ad(create_standalone_ad_request, opts)
240
+
241
+ Create standalone ad
242
+
243
+ Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn. Supports three mutually-exclusive request shapes selected by the body, a legacy single-creative shape (all platforms, default), a Meta-only multi-creative shape via the creatives array (one ad set with N ads sharing budget and targeting), and a Meta-only attach shape via adSetId (adds one new ad to an existing ad set). Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content \"dark post\" authored by a Company Page (see `organizationId`); supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. **Idempotency:** this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
244
+
245
+ ### Examples
246
+
247
+ ```ruby
248
+ require 'time'
249
+ require 'zernio-sdk'
250
+ # setup authorization
251
+ Zernio.configure do |config|
252
+ # Configure Bearer authorization (JWT): bearerAuth
253
+ config.access_token = 'YOUR_BEARER_TOKEN'
254
+ end
255
+
256
+ api_instance = Zernio::AdCampaignsApi.new
257
+ create_standalone_ad_request = Zernio::CreateStandaloneAdRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example', name: 'name_example'}) # CreateStandaloneAdRequest |
258
+ opts = {
259
+ idempotency_key: 'idempotency_key_example' # String | Optional client-generated unique key (e.g. a UUID) that makes create retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
260
+ }
261
+
262
+ begin
263
+ # Create standalone ad
264
+ result = api_instance.create_standalone_ad(create_standalone_ad_request, opts)
265
+ p result
266
+ rescue Zernio::ApiError => e
267
+ puts "Error when calling AdCampaignsApi->create_standalone_ad: #{e}"
268
+ end
269
+ ```
270
+
271
+ #### Using the create_standalone_ad_with_http_info variant
272
+
273
+ This returns an Array which contains the response data, status code and headers.
274
+
275
+ > <Array(<CreateStandaloneAd200Response>, Integer, Hash)> create_standalone_ad_with_http_info(create_standalone_ad_request, opts)
276
+
277
+ ```ruby
278
+ begin
279
+ # Create standalone ad
280
+ data, status_code, headers = api_instance.create_standalone_ad_with_http_info(create_standalone_ad_request, opts)
281
+ p status_code # => 2xx
282
+ p headers # => { ... }
283
+ p data # => <CreateStandaloneAd200Response>
284
+ rescue Zernio::ApiError => e
285
+ puts "Error when calling AdCampaignsApi->create_standalone_ad_with_http_info: #{e}"
286
+ end
287
+ ```
288
+
289
+ ### Parameters
290
+
291
+ | Name | Type | Description | Notes |
292
+ | ---- | ---- | ----------- | ----- |
293
+ | **create_standalone_ad_request** | [**CreateStandaloneAdRequest**](CreateStandaloneAdRequest.md) | | |
294
+ | **idempotency_key** | **String** | Optional client-generated unique key (e.g. a UUID) that makes create retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409. | [optional] |
295
+
296
+ ### Return type
297
+
298
+ [**CreateStandaloneAd200Response**](CreateStandaloneAd200Response.md)
299
+
300
+ ### Authorization
301
+
302
+ [bearerAuth](../README.md#bearerAuth)
303
+
304
+ ### HTTP request headers
305
+
306
+ - **Content-Type**: application/json
307
+ - **Accept**: application/json
308
+
309
+
310
+ ## delete_ad
311
+
312
+ > <DeleteAccountGroup200Response> delete_ad(ad_id)
313
+
314
+ Cancel an ad
315
+
316
+ Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history.
317
+
318
+ ### Examples
319
+
320
+ ```ruby
321
+ require 'time'
322
+ require 'zernio-sdk'
323
+ # setup authorization
324
+ Zernio.configure do |config|
325
+ # Configure Bearer authorization (JWT): bearerAuth
326
+ config.access_token = 'YOUR_BEARER_TOKEN'
327
+ end
328
+
329
+ api_instance = Zernio::AdCampaignsApi.new
330
+ ad_id = 'ad_id_example' # String |
331
+
332
+ begin
333
+ # Cancel an ad
334
+ result = api_instance.delete_ad(ad_id)
335
+ p result
336
+ rescue Zernio::ApiError => e
337
+ puts "Error when calling AdCampaignsApi->delete_ad: #{e}"
338
+ end
339
+ ```
340
+
341
+ #### Using the delete_ad_with_http_info variant
342
+
343
+ This returns an Array which contains the response data, status code and headers.
344
+
345
+ > <Array(<DeleteAccountGroup200Response>, Integer, Hash)> delete_ad_with_http_info(ad_id)
346
+
347
+ ```ruby
348
+ begin
349
+ # Cancel an ad
350
+ data, status_code, headers = api_instance.delete_ad_with_http_info(ad_id)
351
+ p status_code # => 2xx
352
+ p headers # => { ... }
353
+ p data # => <DeleteAccountGroup200Response>
354
+ rescue Zernio::ApiError => e
355
+ puts "Error when calling AdCampaignsApi->delete_ad_with_http_info: #{e}"
356
+ end
357
+ ```
358
+
359
+ ### Parameters
360
+
361
+ | Name | Type | Description | Notes |
362
+ | ---- | ---- | ----------- | ----- |
363
+ | **ad_id** | **String** | | |
364
+
365
+ ### Return type
366
+
367
+ [**DeleteAccountGroup200Response**](DeleteAccountGroup200Response.md)
368
+
369
+ ### Authorization
370
+
371
+ [bearerAuth](../README.md#bearerAuth)
372
+
373
+ ### HTTP request headers
374
+
375
+ - **Content-Type**: Not defined
376
+ - **Accept**: application/json
377
+
378
+
160
379
  ## delete_ad_campaign
161
380
 
162
381
  > <DeleteAdCampaign200Response> delete_ad_campaign(campaign_id, delete_ad_campaign_request)
@@ -228,6 +447,79 @@ end
228
447
  - **Accept**: application/json
229
448
 
230
449
 
450
+ ## duplicate_ad
451
+
452
+ > <DuplicateAd200Response> duplicate_ad(ad_id, opts)
453
+
454
+ Duplicate an ad
455
+
456
+ Duplicates a single ad via Meta's native `POST /{ad-id}/copies`. The copy is created paused. `adSetId` retargets the copy into another ad set; omitted = the source's own ad set. Accepts the Zernio ad id or the platform ad id. Sync discovery is triggered automatically (`syncAfter: false` to skip).
457
+
458
+ ### Examples
459
+
460
+ ```ruby
461
+ require 'time'
462
+ require 'zernio-sdk'
463
+ # setup authorization
464
+ Zernio.configure do |config|
465
+ # Configure Bearer authorization (JWT): bearerAuth
466
+ config.access_token = 'YOUR_BEARER_TOKEN'
467
+ end
468
+
469
+ api_instance = Zernio::AdCampaignsApi.new
470
+ ad_id = 'ad_id_example' # String | Zernio ad ID or platform ad ID
471
+ opts = {
472
+ duplicate_ad_request: Zernio::DuplicateAdRequest.new # DuplicateAdRequest |
473
+ }
474
+
475
+ begin
476
+ # Duplicate an ad
477
+ result = api_instance.duplicate_ad(ad_id, opts)
478
+ p result
479
+ rescue Zernio::ApiError => e
480
+ puts "Error when calling AdCampaignsApi->duplicate_ad: #{e}"
481
+ end
482
+ ```
483
+
484
+ #### Using the duplicate_ad_with_http_info variant
485
+
486
+ This returns an Array which contains the response data, status code and headers.
487
+
488
+ > <Array(<DuplicateAd200Response>, Integer, Hash)> duplicate_ad_with_http_info(ad_id, opts)
489
+
490
+ ```ruby
491
+ begin
492
+ # Duplicate an ad
493
+ data, status_code, headers = api_instance.duplicate_ad_with_http_info(ad_id, opts)
494
+ p status_code # => 2xx
495
+ p headers # => { ... }
496
+ p data # => <DuplicateAd200Response>
497
+ rescue Zernio::ApiError => e
498
+ puts "Error when calling AdCampaignsApi->duplicate_ad_with_http_info: #{e}"
499
+ end
500
+ ```
501
+
502
+ ### Parameters
503
+
504
+ | Name | Type | Description | Notes |
505
+ | ---- | ---- | ----------- | ----- |
506
+ | **ad_id** | **String** | Zernio ad ID or platform ad ID | |
507
+ | **duplicate_ad_request** | [**DuplicateAdRequest**](DuplicateAdRequest.md) | | [optional] |
508
+
509
+ ### Return type
510
+
511
+ [**DuplicateAd200Response**](DuplicateAd200Response.md)
512
+
513
+ ### Authorization
514
+
515
+ [bearerAuth](../README.md#bearerAuth)
516
+
517
+ ### HTTP request headers
518
+
519
+ - **Content-Type**: application/json
520
+ - **Accept**: application/json
521
+
522
+
231
523
  ## duplicate_ad_campaign
232
524
 
233
525
  > <DuplicateAdCampaign200Response> duplicate_ad_campaign(campaign_id, duplicate_ad_campaign_request)
@@ -303,9 +595,9 @@ end
303
595
 
304
596
  > <DuplicateAdSet200Response> duplicate_ad_set(ad_set_id, duplicate_ad_set_request)
305
597
 
306
- Duplicate an ad set (Meta)
598
+ Duplicate an ad set
307
599
 
308
- Duplicates an ad set, including its ads and creatives by default (`deepCopy: true`), via Meta's native `POST /{adset-id}/copies`. The copy is created paused so callers can review before launching. `campaignId` retargets the copy into another campaign; omitted = the source's own campaign. The new hierarchy materializes asynchronously — sync discovery is triggered automatically (`syncAfter: false` to skip). Meta only.
600
+ Duplicates an ad set, including its ads and creatives by default (`deepCopy: true`), via Meta's native `POST /{adset-id}/copies`. The copy is created paused so callers can review before launching. `campaignId` retargets the copy into another campaign; omitted = the source's own campaign. The new hierarchy materializes asynchronously — sync discovery is triggered automatically (`syncAfter: false` to skip).
309
601
 
310
602
  ### Examples
311
603
 
@@ -323,7 +615,7 @@ ad_set_id = 'ad_set_id_example' # String | Source platform ad set ID
323
615
  duplicate_ad_set_request = Zernio::DuplicateAdSetRequest.new({platform: 'facebook'}) # DuplicateAdSetRequest |
324
616
 
325
617
  begin
326
- # Duplicate an ad set (Meta)
618
+ # Duplicate an ad set
327
619
  result = api_instance.duplicate_ad_set(ad_set_id, duplicate_ad_set_request)
328
620
  p result
329
621
  rescue Zernio::ApiError => e
@@ -339,7 +631,7 @@ This returns an Array which contains the response data, status code and headers.
339
631
 
340
632
  ```ruby
341
633
  begin
342
- # Duplicate an ad set (Meta)
634
+ # Duplicate an ad set
343
635
  data, status_code, headers = api_instance.duplicate_ad_set_with_http_info(ad_set_id, duplicate_ad_set_request)
344
636
  p status_code # => 2xx
345
637
  p headers # => { ... }
@@ -370,13 +662,82 @@ end
370
662
  - **Accept**: application/json
371
663
 
372
664
 
665
+ ## get_ad
666
+
667
+ > <GetAd200Response> get_ad(ad_id)
668
+
669
+ Get ad details
670
+
671
+ Returns an ad with its creative, targeting, status, and performance metrics. The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal `_id` (24-char hex) - Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`) - the creative's `effective_object_story_id` (`{pageId}_{postId}` shape, Facebook side) - the creative's `effective_instagram_media_id` (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step.
672
+
673
+ ### Examples
674
+
675
+ ```ruby
676
+ require 'time'
677
+ require 'zernio-sdk'
678
+ # setup authorization
679
+ Zernio.configure do |config|
680
+ # Configure Bearer authorization (JWT): bearerAuth
681
+ config.access_token = 'YOUR_BEARER_TOKEN'
682
+ end
683
+
684
+ api_instance = Zernio::AdCampaignsApi.new
685
+ ad_id = 'ad_id_example' # String | Zernio `_id` (hex), Meta `platformAdId` (numeric), or one of the creative's effective story/media IDs. See description for details.
686
+
687
+ begin
688
+ # Get ad details
689
+ result = api_instance.get_ad(ad_id)
690
+ p result
691
+ rescue Zernio::ApiError => e
692
+ puts "Error when calling AdCampaignsApi->get_ad: #{e}"
693
+ end
694
+ ```
695
+
696
+ #### Using the get_ad_with_http_info variant
697
+
698
+ This returns an Array which contains the response data, status code and headers.
699
+
700
+ > <Array(<GetAd200Response>, Integer, Hash)> get_ad_with_http_info(ad_id)
701
+
702
+ ```ruby
703
+ begin
704
+ # Get ad details
705
+ data, status_code, headers = api_instance.get_ad_with_http_info(ad_id)
706
+ p status_code # => 2xx
707
+ p headers # => { ... }
708
+ p data # => <GetAd200Response>
709
+ rescue Zernio::ApiError => e
710
+ puts "Error when calling AdCampaignsApi->get_ad_with_http_info: #{e}"
711
+ end
712
+ ```
713
+
714
+ ### Parameters
715
+
716
+ | Name | Type | Description | Notes |
717
+ | ---- | ---- | ----------- | ----- |
718
+ | **ad_id** | **String** | Zernio &#x60;_id&#x60; (hex), Meta &#x60;platformAdId&#x60; (numeric), or one of the creative&#39;s effective story/media IDs. See description for details. | |
719
+
720
+ ### Return type
721
+
722
+ [**GetAd200Response**](GetAd200Response.md)
723
+
724
+ ### Authorization
725
+
726
+ [bearerAuth](../README.md#bearerAuth)
727
+
728
+ ### HTTP request headers
729
+
730
+ - **Content-Type**: Not defined
731
+ - **Accept**: application/json
732
+
733
+
373
734
  ## get_ad_set_details
374
735
 
375
736
  > <GetAdSetDetails200Response> get_ad_set_details(ad_set_id, account_id, opts)
376
737
 
377
- Live ad-set details incl. learning phase (Meta)
738
+ Live ad-set details incl. learning phase
378
739
 
379
- Reads the ad set live from Meta, returned verbatim. The default projection includes `learning_stage_info` (learning-phase status: LEARNING / SUCCESS / FAIL / WAIVING — Meta omits its `status` key on paused ad sets), delivery settings, budgets, schedule and targeting. `fields` is a raw-passthrough override; unknown fields return Meta's 400 verbatim. Meta only.
740
+ Reads the ad set live from Meta, returned verbatim. The default projection includes `learning_stage_info` (learning-phase status: LEARNING / SUCCESS / FAIL / WAIVING — Meta omits its `status` key on paused ad sets), delivery settings, budgets, schedule and targeting. `fields` is a raw-passthrough override; unknown fields return Meta's 400 verbatim.
380
741
 
381
742
  ### Examples
382
743
 
@@ -397,7 +758,7 @@ opts = {
397
758
  }
398
759
 
399
760
  begin
400
- # Live ad-set details incl. learning phase (Meta)
761
+ # Live ad-set details incl. learning phase
401
762
  result = api_instance.get_ad_set_details(ad_set_id, account_id, opts)
402
763
  p result
403
764
  rescue Zernio::ApiError => e
@@ -413,7 +774,7 @@ This returns an Array which contains the response data, status code and headers.
413
774
 
414
775
  ```ruby
415
776
  begin
416
- # Live ad-set details incl. learning phase (Meta)
777
+ # Live ad-set details incl. learning phase
417
778
  data, status_code, headers = api_instance.get_ad_set_details_with_http_info(ad_set_id, account_id, opts)
418
779
  p status_code # => 2xx
419
780
  p headers # => { ... }
@@ -710,6 +1071,174 @@ end
710
1071
  - **Accept**: application/json
711
1072
 
712
1073
 
1074
+ ## list_ads
1075
+
1076
+ > <ListAds200Response> list_ads(opts)
1077
+
1078
+ List ads
1079
+
1080
+ Returns a paginated list of ads with metrics computed over an optional date range. Use source=all to include externally-synced ads from platform ad managers. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. To find the Zernio ad behind a comment you see in Meta Business Manager, filter by platformAdId (the Meta ad ID), effectiveObjectStoryId (Facebook), or effectiveInstagramMediaId (Instagram) — those are the post/media the ad's engagement lives on, and are also returned on each ad's `creative` object. Then call GET /v1/ads/{adId}/comments with the returned ad id.
1081
+
1082
+ ### Examples
1083
+
1084
+ ```ruby
1085
+ require 'time'
1086
+ require 'zernio-sdk'
1087
+ # setup authorization
1088
+ Zernio.configure do |config|
1089
+ # Configure Bearer authorization (JWT): bearerAuth
1090
+ config.access_token = 'YOUR_BEARER_TOKEN'
1091
+ end
1092
+
1093
+ api_instance = Zernio::AdCampaignsApi.new
1094
+ opts = {
1095
+ page: 56, # Integer | Page number (1-based)
1096
+ limit: 56, # Integer |
1097
+ source: 'zernio', # String | all (default) = Zernio-created + platform-discovered ads. zernio = restrict to Zernio-created only.
1098
+ status: Zernio::AdStatus::ACTIVE, # AdStatus |
1099
+ platform: 'facebook', # String |
1100
+ account_id: 'account_id_example', # String | Social account ID
1101
+ ad_account_id: 'ad_account_id_example', # String | Platform ad account ID (e.g. act_123 for Meta). Mirrors the same filter on /v1/ads/campaigns and /v1/ads/tree.
1102
+ profile_id: 'profile_id_example', # String | Profile ID
1103
+ campaign_id: 'campaign_id_example', # String | Platform campaign ID (filter ads within a campaign)
1104
+ platform_ad_id: 'platform_ad_id_example', # String | Meta ad ID. Returns the ad with this platform-side ad ID.
1105
+ effective_object_story_id: 'effective_object_story_id_example', # String | Facebook `{pageId}_{postId}` of the post the ad's engagement lives on (Meta `effective_object_story_id`). Use to map a Business-Manager-visible post back to the Zernio ad.
1106
+ effective_instagram_media_id: 'effective_instagram_media_id_example', # String | Instagram media ID of the boosted post (Meta `effective_instagram_media_id`). Use to map a Business-Manager-visible IG post back to the Zernio ad.
1107
+ from_date: Date.parse('2013-10-20'), # Date | Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago.
1108
+ to_date: Date.parse('2013-10-20') # Date | End of metrics date range (YYYY-MM-DD). Defaults to today. Max 730-day range.
1109
+ }
1110
+
1111
+ begin
1112
+ # List ads
1113
+ result = api_instance.list_ads(opts)
1114
+ p result
1115
+ rescue Zernio::ApiError => e
1116
+ puts "Error when calling AdCampaignsApi->list_ads: #{e}"
1117
+ end
1118
+ ```
1119
+
1120
+ #### Using the list_ads_with_http_info variant
1121
+
1122
+ This returns an Array which contains the response data, status code and headers.
1123
+
1124
+ > <Array(<ListAds200Response>, Integer, Hash)> list_ads_with_http_info(opts)
1125
+
1126
+ ```ruby
1127
+ begin
1128
+ # List ads
1129
+ data, status_code, headers = api_instance.list_ads_with_http_info(opts)
1130
+ p status_code # => 2xx
1131
+ p headers # => { ... }
1132
+ p data # => <ListAds200Response>
1133
+ rescue Zernio::ApiError => e
1134
+ puts "Error when calling AdCampaignsApi->list_ads_with_http_info: #{e}"
1135
+ end
1136
+ ```
1137
+
1138
+ ### Parameters
1139
+
1140
+ | Name | Type | Description | Notes |
1141
+ | ---- | ---- | ----------- | ----- |
1142
+ | **page** | **Integer** | Page number (1-based) | [optional][default to 1] |
1143
+ | **limit** | **Integer** | | [optional][default to 50] |
1144
+ | **source** | **String** | all (default) &#x3D; Zernio-created + platform-discovered ads. zernio &#x3D; restrict to Zernio-created only. | [optional][default to &#39;all&#39;] |
1145
+ | **status** | [**AdStatus**](.md) | | [optional] |
1146
+ | **platform** | **String** | | [optional] |
1147
+ | **account_id** | **String** | Social account ID | [optional] |
1148
+ | **ad_account_id** | **String** | Platform ad account ID (e.g. act_123 for Meta). Mirrors the same filter on /v1/ads/campaigns and /v1/ads/tree. | [optional] |
1149
+ | **profile_id** | **String** | Profile ID | [optional] |
1150
+ | **campaign_id** | **String** | Platform campaign ID (filter ads within a campaign) | [optional] |
1151
+ | **platform_ad_id** | **String** | Meta ad ID. Returns the ad with this platform-side ad ID. | [optional] |
1152
+ | **effective_object_story_id** | **String** | Facebook &#x60;{pageId}_{postId}&#x60; of the post the ad&#39;s engagement lives on (Meta &#x60;effective_object_story_id&#x60;). Use to map a Business-Manager-visible post back to the Zernio ad. | [optional] |
1153
+ | **effective_instagram_media_id** | **String** | Instagram media ID of the boosted post (Meta &#x60;effective_instagram_media_id&#x60;). Use to map a Business-Manager-visible IG post back to the Zernio ad. | [optional] |
1154
+ | **from_date** | **Date** | Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago. | [optional] |
1155
+ | **to_date** | **Date** | End of metrics date range (YYYY-MM-DD). Defaults to today. Max 730-day range. | [optional] |
1156
+
1157
+ ### Return type
1158
+
1159
+ [**ListAds200Response**](ListAds200Response.md)
1160
+
1161
+ ### Authorization
1162
+
1163
+ [bearerAuth](../README.md#bearerAuth)
1164
+
1165
+ ### HTTP request headers
1166
+
1167
+ - **Content-Type**: Not defined
1168
+ - **Accept**: application/json
1169
+
1170
+
1171
+ ## update_ad
1172
+
1173
+ > <UpdateAd200Response> update_ad(ad_id, update_ad_request)
1174
+
1175
+ Update ad
1176
+
1177
+ Patch one or more fields on an ad. Status, budget, targeting, and creative changes are propagated to the platform. Per-platform support: - **Meta** (Facebook + Instagram): all fields supported. - **TikTok**: status, budget, targeting (via `/v2/adgroup/update/`), and creative (via `/v2/ad/update/` patch-style — `headline` is ignored, `body` becomes `ad_text`). - **Pinterest / X / LinkedIn / Google**: status + budget only. Sending `targeting` or `creative` returns 501 with code `unsupported_platform_operation`.
1178
+
1179
+ ### Examples
1180
+
1181
+ ```ruby
1182
+ require 'time'
1183
+ require 'zernio-sdk'
1184
+ # setup authorization
1185
+ Zernio.configure do |config|
1186
+ # Configure Bearer authorization (JWT): bearerAuth
1187
+ config.access_token = 'YOUR_BEARER_TOKEN'
1188
+ end
1189
+
1190
+ api_instance = Zernio::AdCampaignsApi.new
1191
+ ad_id = 'ad_id_example' # String |
1192
+ update_ad_request = Zernio::UpdateAdRequest.new # UpdateAdRequest |
1193
+
1194
+ begin
1195
+ # Update ad
1196
+ result = api_instance.update_ad(ad_id, update_ad_request)
1197
+ p result
1198
+ rescue Zernio::ApiError => e
1199
+ puts "Error when calling AdCampaignsApi->update_ad: #{e}"
1200
+ end
1201
+ ```
1202
+
1203
+ #### Using the update_ad_with_http_info variant
1204
+
1205
+ This returns an Array which contains the response data, status code and headers.
1206
+
1207
+ > <Array(<UpdateAd200Response>, Integer, Hash)> update_ad_with_http_info(ad_id, update_ad_request)
1208
+
1209
+ ```ruby
1210
+ begin
1211
+ # Update ad
1212
+ data, status_code, headers = api_instance.update_ad_with_http_info(ad_id, update_ad_request)
1213
+ p status_code # => 2xx
1214
+ p headers # => { ... }
1215
+ p data # => <UpdateAd200Response>
1216
+ rescue Zernio::ApiError => e
1217
+ puts "Error when calling AdCampaignsApi->update_ad_with_http_info: #{e}"
1218
+ end
1219
+ ```
1220
+
1221
+ ### Parameters
1222
+
1223
+ | Name | Type | Description | Notes |
1224
+ | ---- | ---- | ----------- | ----- |
1225
+ | **ad_id** | **String** | | |
1226
+ | **update_ad_request** | [**UpdateAdRequest**](UpdateAdRequest.md) | | |
1227
+
1228
+ ### Return type
1229
+
1230
+ [**UpdateAd200Response**](UpdateAd200Response.md)
1231
+
1232
+ ### Authorization
1233
+
1234
+ [bearerAuth](../README.md#bearerAuth)
1235
+
1236
+ ### HTTP request headers
1237
+
1238
+ - **Content-Type**: application/json
1239
+ - **Accept**: application/json
1240
+
1241
+
713
1242
  ## update_ad_campaign
714
1243
 
715
1244
  > <UpdateAdCampaign200Response> update_ad_campaign(campaign_id, update_ad_campaign_request)
@@ -993,3 +1522,74 @@ end
993
1522
  - **Content-Type**: application/json
994
1523
  - **Accept**: application/json
995
1524
 
1525
+
1526
+ ## update_ad_status
1527
+
1528
+ > <UpdateAdStatus200Response> update_ad_status(ad_id, update_ad_status_request)
1529
+
1530
+ Pause or resume a single ad
1531
+
1532
+ Ad-scoped pause/resume — touches ONLY this ad, never its parent ad set or campaign (so sibling ads keep running). Thin wrapper over the `status` field of PUT /v1/ads/{adId}, for callers that want a URL symmetric to /v1/ads/campaigns/{campaignId}/status and /v1/ads/ad-sets/{adSetId}/status. `{adId}` accepts the same identifier dialects as GET/PUT /v1/ads/{adId} (Zernio hex `_id`, Meta numeric `platformAdId`, or the creative's effective story/media IDs). `platform` is inferred from the ad, so it's not required in the body. Ads in terminal statuses (rejected, completed, cancelled) and no-op flips (already in the target state) are skipped.
1533
+
1534
+ ### Examples
1535
+
1536
+ ```ruby
1537
+ require 'time'
1538
+ require 'zernio-sdk'
1539
+ # setup authorization
1540
+ Zernio.configure do |config|
1541
+ # Configure Bearer authorization (JWT): bearerAuth
1542
+ config.access_token = 'YOUR_BEARER_TOKEN'
1543
+ end
1544
+
1545
+ api_instance = Zernio::AdCampaignsApi.new
1546
+ ad_id = 'ad_id_example' # String | Zernio `_id` (hex), Meta `platformAdId` (numeric), or one of the creative's effective story/media IDs.
1547
+ update_ad_status_request = Zernio::UpdateAdStatusRequest.new({status: 'active'}) # UpdateAdStatusRequest |
1548
+
1549
+ begin
1550
+ # Pause or resume a single ad
1551
+ result = api_instance.update_ad_status(ad_id, update_ad_status_request)
1552
+ p result
1553
+ rescue Zernio::ApiError => e
1554
+ puts "Error when calling AdCampaignsApi->update_ad_status: #{e}"
1555
+ end
1556
+ ```
1557
+
1558
+ #### Using the update_ad_status_with_http_info variant
1559
+
1560
+ This returns an Array which contains the response data, status code and headers.
1561
+
1562
+ > <Array(<UpdateAdStatus200Response>, Integer, Hash)> update_ad_status_with_http_info(ad_id, update_ad_status_request)
1563
+
1564
+ ```ruby
1565
+ begin
1566
+ # Pause or resume a single ad
1567
+ data, status_code, headers = api_instance.update_ad_status_with_http_info(ad_id, update_ad_status_request)
1568
+ p status_code # => 2xx
1569
+ p headers # => { ... }
1570
+ p data # => <UpdateAdStatus200Response>
1571
+ rescue Zernio::ApiError => e
1572
+ puts "Error when calling AdCampaignsApi->update_ad_status_with_http_info: #{e}"
1573
+ end
1574
+ ```
1575
+
1576
+ ### Parameters
1577
+
1578
+ | Name | Type | Description | Notes |
1579
+ | ---- | ---- | ----------- | ----- |
1580
+ | **ad_id** | **String** | Zernio &#x60;_id&#x60; (hex), Meta &#x60;platformAdId&#x60; (numeric), or one of the creative&#39;s effective story/media IDs. | |
1581
+ | **update_ad_status_request** | [**UpdateAdStatusRequest**](UpdateAdStatusRequest.md) | | |
1582
+
1583
+ ### Return type
1584
+
1585
+ [**UpdateAdStatus200Response**](UpdateAdStatus200Response.md)
1586
+
1587
+ ### Authorization
1588
+
1589
+ [bearerAuth](../README.md#bearerAuth)
1590
+
1591
+ ### HTTP request headers
1592
+
1593
+ - **Content-Type**: application/json
1594
+ - **Accept**: application/json
1595
+