taboola-backstage-sdk 0.1.0

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.
@@ -0,0 +1,3454 @@
1
+ import { Options } from 'ky';
2
+
3
+ /**
4
+ * OAuth2 authentication module for Taboola Backstage API
5
+ */
6
+ /**
7
+ * OAuth2 authentication manager
8
+ * Handles token acquisition and automatic refresh
9
+ */
10
+ declare class OAuthManager {
11
+ private readonly clientId;
12
+ private readonly clientSecret;
13
+ private storedToken;
14
+ private tokenPromise;
15
+ constructor(clientId: string, clientSecret: string);
16
+ /**
17
+ * Get a valid access token, refreshing if necessary
18
+ */
19
+ getAccessToken(): Promise<string>;
20
+ /**
21
+ * Force refresh the token (e.g., after a 401 response)
22
+ */
23
+ refreshToken(): Promise<string>;
24
+ /**
25
+ * Clear the stored token
26
+ */
27
+ clearToken(): void;
28
+ /**
29
+ * Check if a token is expired or about to expire
30
+ */
31
+ private isTokenExpired;
32
+ /**
33
+ * Fetch a new token from the OAuth endpoint
34
+ */
35
+ private fetchToken;
36
+ }
37
+
38
+ /**
39
+ * HTTP client wrapper using ky
40
+ */
41
+
42
+ /** Default API base URL */
43
+ declare const DEFAULT_BASE_URL = "https://backstage.taboola.com/backstage/api/1.0";
44
+ interface HttpClientOptions {
45
+ baseUrl?: string | undefined;
46
+ timeout?: number | undefined;
47
+ retries?: number | undefined;
48
+ debug?: boolean | undefined;
49
+ }
50
+ /**
51
+ * HTTP client for Taboola API requests
52
+ */
53
+ declare class HttpClient {
54
+ private readonly client;
55
+ private readonly authManager;
56
+ private readonly debug;
57
+ constructor(authManager: OAuthManager, options?: HttpClientOptions);
58
+ /**
59
+ * Make a GET request
60
+ */
61
+ get<T>(path: string, options?: Options): Promise<T>;
62
+ /**
63
+ * Make a POST request
64
+ */
65
+ post<T>(path: string, body?: unknown, options?: Options): Promise<T>;
66
+ /**
67
+ * Make a PUT request
68
+ */
69
+ put<T>(path: string, body?: unknown, options?: Options): Promise<T>;
70
+ /**
71
+ * Make a PATCH request
72
+ */
73
+ patch<T>(path: string, body?: unknown, options?: Options): Promise<T>;
74
+ /**
75
+ * Make a DELETE request
76
+ */
77
+ delete<T>(path: string, options?: Options): Promise<T>;
78
+ /**
79
+ * Internal request handler
80
+ */
81
+ private request;
82
+ }
83
+
84
+ /**
85
+ * Common types shared across the SDK
86
+ */
87
+ /**
88
+ * Targeting type - specifies inclusion/exclusion behavior
89
+ */
90
+ type TargetingType = 'ALL' | 'INCLUDE' | 'EXCLUDE';
91
+ /**
92
+ * Generic targeting object used across various targeting fields
93
+ */
94
+ interface TargetingValue<T = string> {
95
+ type: TargetingType;
96
+ value: T[] | null;
97
+ href?: string | null;
98
+ }
99
+ /**
100
+ * Multi-targeting state for audience segments
101
+ */
102
+ type MultiTargetingState = 'ALL' | 'EXISTS' | 'NOT_EXISTS';
103
+ /**
104
+ * Multi-targeting object used for audience targeting
105
+ */
106
+ interface MultiTargeting {
107
+ state: MultiTargetingState;
108
+ value: unknown[] | null;
109
+ href?: string | null;
110
+ }
111
+ /**
112
+ * Pagination parameters for list endpoints
113
+ */
114
+ interface PaginationParams {
115
+ page?: number;
116
+ page_size?: number;
117
+ }
118
+ /**
119
+ * Standard list response wrapper
120
+ */
121
+ interface ListResponse<T> {
122
+ results: T[];
123
+ metadata?: {
124
+ total?: number;
125
+ count?: number;
126
+ };
127
+ }
128
+ /**
129
+ * Date string in YYYY-MM-DD format
130
+ */
131
+ type DateString = string;
132
+ /**
133
+ * Currency codes (ISO 4217)
134
+ * Common values: USD, EUR, GBP, JPY, AUD, CAD
135
+ */
136
+ type CurrencyCode = string;
137
+ /**
138
+ * Approval states for campaigns and items
139
+ */
140
+ type ApprovalState = 'APPROVED' | 'PENDING' | 'REJECTED';
141
+ /**
142
+ * Status values for campaigns
143
+ */
144
+ type CampaignStatus = 'RUNNING' | 'PAUSED' | 'PENDING_APPROVAL' | 'REJECTED' | 'FROZEN' | 'PENDING_START_DATE' | 'EXPIRED' | 'TERMINATED' | 'DEPLETED' | 'DEPLETED_MONTHLY';
145
+ /**
146
+ * Status values for items
147
+ */
148
+ type ItemStatus = 'RUNNING' | 'CRAWLING' | 'CRAWLING_ERROR' | 'NEED_TO_EDIT' | 'PAUSED' | 'STOPPED' | 'PENDING_APPROVAL' | 'REJECTED';
149
+ /**
150
+ * Pricing models
151
+ */
152
+ type PricingModel = 'CPC' | 'CPM' | 'VCPM' | 'CPV' | 'CPA';
153
+ /**
154
+ * Spending limit models
155
+ */
156
+ type SpendingLimitModel = 'MONTHLY' | 'ENTIRE' | 'DAILY' | 'NONE';
157
+ /**
158
+ * Daily ad delivery models
159
+ */
160
+ type DailyAdDeliveryModel = 'ACCELERATED' | 'BALANCED' | 'STRICT';
161
+ /**
162
+ * Marketing objectives
163
+ */
164
+ type MarketingObjective = 'DRIVE_WEBSITE_TRAFFIC' | 'BRAND_AWARENESS' | 'DRIVE_PURCHASES' | 'GENERATE_LEADS' | 'DRIVE_APP_INSTALLS' | 'MAX_CONVERSIONS';
165
+ /**
166
+ * Bid strategies
167
+ */
168
+ type BidStrategy = 'FIXED' | 'SMART' | 'TARGET_CPA' | 'MAX_CONVERSIONS' | 'TARGET_ROAS';
169
+ /**
170
+ * Traffic allocation modes
171
+ */
172
+ type TrafficAllocationMode = 'OPTIMIZED' | 'EVEN';
173
+ /**
174
+ * Platform types
175
+ */
176
+ type PlatformType = 'DESK' | 'PHON' | 'TBLT';
177
+ /**
178
+ * Connection types
179
+ */
180
+ type ConnectionType = 'WIFI' | 'CELLULAR';
181
+ /**
182
+ * Operating systems
183
+ */
184
+ type OperatingSystem = 'WINDOWS' | 'MACOSX' | 'LINUX' | 'IOS' | 'ANDROID';
185
+ /**
186
+ * Call-to-action button types
187
+ */
188
+ type CTAType = 'NONE' | 'APPLY_NOW' | 'BOOK_NOW' | 'CONTACT_US' | 'DOWNLOAD' | 'GET_OFFER' | 'GET_QUOTE' | 'INSTALL' | 'LEARN_MORE' | 'ORDER_NOW' | 'PLAY_NOW' | 'READ_MORE' | 'SEE_MORE' | 'SHOP_NOW' | 'SIGN_UP' | 'SUBSCRIBE' | 'WATCH_MORE';
189
+ /**
190
+ * Item types
191
+ */
192
+ type ItemType = 'ITEM' | 'RSS' | 'RSS_CHILD' | 'VIDEO';
193
+ /**
194
+ * External brand safety providers
195
+ */
196
+ type BrandSafetyProvider = 'IAS' | 'DV' | 'MOAT' | 'NONE';
197
+ /**
198
+ * Report dimension types
199
+ */
200
+ type ReportDimension = 'day' | 'week' | 'month' | 'campaign' | 'campaign_day' | 'campaign_week' | 'campaign_month' | 'site' | 'site_day' | 'country' | 'country_day' | 'platform' | 'platform_day' | 'browser' | 'browser_day' | 'os_family' | 'os_family_day' | 'item_breakdown';
201
+
202
+ /**
203
+ * Authentication types for Taboola Backstage API
204
+ */
205
+ /**
206
+ * Client configuration for TaboolaClient
207
+ */
208
+ interface TaboolaConfig {
209
+ /** OAuth2 client ID provided by Taboola */
210
+ clientId: string;
211
+ /** OAuth2 client secret provided by Taboola */
212
+ clientSecret: string;
213
+ /** Base URL for the API (defaults to production) */
214
+ baseUrl?: string;
215
+ /** Enable debug logging */
216
+ debug?: boolean;
217
+ /** Request timeout in milliseconds (default: 30000) */
218
+ timeout?: number;
219
+ /** Number of retry attempts for failed requests (default: 3) */
220
+ retries?: number;
221
+ }
222
+ /**
223
+ * OAuth2 token response from Taboola
224
+ */
225
+ interface TokenResponse {
226
+ /** The access token to use for API requests */
227
+ access_token: string;
228
+ /** Token type (always "bearer") */
229
+ token_type: 'bearer';
230
+ /** Token lifetime in seconds (typically 43200 = 12 hours) */
231
+ expires_in: number;
232
+ }
233
+ /**
234
+ * Internal token storage with expiry tracking
235
+ */
236
+ interface StoredToken {
237
+ /** The access token */
238
+ accessToken: string;
239
+ /** Timestamp when the token expires */
240
+ expiresAt: number;
241
+ }
242
+
243
+ /**
244
+ * Account types for Taboola Backstage API
245
+ */
246
+
247
+ /**
248
+ * Partner types
249
+ */
250
+ type PartnerType = 'PUBLISHER' | 'ADVERTISER';
251
+ /**
252
+ * Account types
253
+ */
254
+ type AccountType = 'PARTNER' | 'NETWORK';
255
+ /**
256
+ * Campaign types available to account
257
+ */
258
+ type CampaignType = 'PAID' | 'VIDEO';
259
+ /**
260
+ * Account details response
261
+ */
262
+ interface Account {
263
+ /** Numeric account ID */
264
+ id: number;
265
+ /** Account display name */
266
+ name: string;
267
+ /** Alphabetic account ID used in API paths */
268
+ account_id: string;
269
+ /** Types of partnerships */
270
+ partner_types: PartnerType[];
271
+ /** Account type */
272
+ type: AccountType;
273
+ /** Available campaign types */
274
+ campaign_types: CampaignType[];
275
+ /** Account currency */
276
+ currency: CurrencyCode;
277
+ }
278
+ /**
279
+ * Advertiser account in network
280
+ */
281
+ interface AdvertiserAccount {
282
+ /** Numeric account ID */
283
+ id: number;
284
+ /** Account display name */
285
+ name: string;
286
+ /** Alphabetic account ID */
287
+ account_id: string;
288
+ /** Partner types */
289
+ partner_types: PartnerType[];
290
+ /** Account type */
291
+ type: AccountType;
292
+ /** Campaign types */
293
+ campaign_types: CampaignType[];
294
+ /** Account currency */
295
+ currency: CurrencyCode;
296
+ }
297
+ /**
298
+ * Response for allowed accounts list
299
+ */
300
+ interface AllowedAccountsResponse {
301
+ results: Account[];
302
+ }
303
+ /**
304
+ * Response for network advertisers list
305
+ */
306
+ interface NetworkAdvertisersResponse {
307
+ results: AdvertiserAccount[];
308
+ }
309
+
310
+ /**
311
+ * Campaign types for Taboola Backstage API
312
+ */
313
+
314
+ /**
315
+ * Publisher bid modifier entry
316
+ */
317
+ interface PublisherBidModifier {
318
+ /** Publisher ID */
319
+ publisher_id: string;
320
+ /** Bid modifier value (1.0 = no change, 1.5 = +50%, 0.5 = -50%) */
321
+ modifier: number;
322
+ }
323
+ /**
324
+ * Publisher bid modifier collection
325
+ */
326
+ interface PublisherBidModifierCollection {
327
+ values: PublisherBidModifier[];
328
+ }
329
+ /**
330
+ * Publisher bid strategy modifier entry
331
+ */
332
+ interface PublisherBidStrategyModifier {
333
+ /** Publisher ID */
334
+ publisher_id: string;
335
+ /** Target CPA for this publisher */
336
+ target_cpa?: number;
337
+ }
338
+ /**
339
+ * Publisher bid strategy modifier collection
340
+ */
341
+ interface PublisherBidStrategyModifierCollection {
342
+ values: PublisherBidStrategyModifier[];
343
+ }
344
+ /**
345
+ * External brand safety configuration
346
+ */
347
+ interface ExternalBrandSafety {
348
+ /** Brand safety provider type */
349
+ type: BrandSafetyProvider;
350
+ /** Provider-specific values */
351
+ values: string[];
352
+ }
353
+ /**
354
+ * Verification pixel configuration
355
+ */
356
+ interface VerificationPixel {
357
+ /** Pixel type */
358
+ type: string;
359
+ /** Pixel URL or code */
360
+ value: string;
361
+ }
362
+ /**
363
+ * Viewability tag configuration
364
+ */
365
+ interface ViewabilityTag {
366
+ /** Tag type */
367
+ type: string;
368
+ /** Tag value */
369
+ value: string;
370
+ }
371
+ /**
372
+ * Activity schedule rule for day-parting
373
+ */
374
+ interface ActivityScheduleRule {
375
+ /** Day of week (SUNDAY, MONDAY, etc.) */
376
+ day: string;
377
+ /** Start hour (0-23) */
378
+ from_hour: number;
379
+ /** End hour (0-23) */
380
+ until_hour: number;
381
+ }
382
+ /**
383
+ * Activity schedule configuration
384
+ */
385
+ interface ActivitySchedule {
386
+ /** Schedule mode */
387
+ mode: 'ALWAYS' | 'CUSTOM';
388
+ /** Schedule rules (only when mode is CUSTOM) */
389
+ rules: ActivityScheduleRule[];
390
+ /** Timezone for the schedule */
391
+ time_zone: string | null;
392
+ }
393
+ /**
394
+ * Policy review status
395
+ */
396
+ interface PolicyReview {
397
+ /** Rejection reason if rejected */
398
+ reject_reason: string | null;
399
+ }
400
+ /**
401
+ * Full Campaign object
402
+ */
403
+ interface Campaign {
404
+ /** Unique campaign ID */
405
+ id: string;
406
+ /** Account ID the campaign belongs to */
407
+ advertiser_id: string;
408
+ /** Campaign name */
409
+ name: string;
410
+ /** Branding text shown with ads */
411
+ branding_text: string;
412
+ /** Tracking code appended to URLs */
413
+ tracking_code?: string;
414
+ /** Pricing model */
415
+ pricing_model: PricingModel;
416
+ /** Cost per click */
417
+ cpc: number;
418
+ /** Daily spending cap (0 = no cap) */
419
+ daily_cap: number;
420
+ /** Daily delivery model */
421
+ daily_ad_delivery_model: DailyAdDeliveryModel;
422
+ /** Total spending limit */
423
+ spending_limit: number;
424
+ /** Spending limit period */
425
+ spending_limit_model: SpendingLimitModel;
426
+ /** Target CPA goal */
427
+ cpa_goal: number;
428
+ /** Country targeting */
429
+ country_targeting: TargetingValue;
430
+ /** Sub-country (region) targeting */
431
+ sub_country_targeting: TargetingValue;
432
+ /** DMA targeting (US only) */
433
+ dma_country_targeting?: TargetingValue;
434
+ /** Region targeting */
435
+ region_country_targeting?: TargetingValue;
436
+ /** City targeting */
437
+ city_targeting?: TargetingValue;
438
+ /** Postal code targeting */
439
+ postal_code_targeting: TargetingValue;
440
+ /** Contextual targeting */
441
+ contextual_targeting?: TargetingValue;
442
+ /** Platform targeting */
443
+ platform_targeting: TargetingValue;
444
+ /** Publisher targeting (blocking) */
445
+ publisher_targeting: TargetingValue;
446
+ /** OS targeting */
447
+ os_targeting: TargetingValue;
448
+ /** Connection type targeting */
449
+ connection_type_targeting: TargetingValue;
450
+ /** Browser targeting */
451
+ browser_targeting?: TargetingValue;
452
+ /** Auto publisher targeting */
453
+ auto_publisher_targeting?: TargetingValue;
454
+ /** Publisher bid modifiers */
455
+ publisher_bid_modifier: PublisherBidModifierCollection;
456
+ /** Publisher bid strategy modifiers */
457
+ publisher_bid_strategy_modifiers: PublisherBidStrategyModifierCollection;
458
+ /** Campaign profile ID */
459
+ campaign_profile?: string | null;
460
+ /** Internal comments */
461
+ comments: string;
462
+ /** Total amount spent */
463
+ spent: number;
464
+ /** Bid strategy */
465
+ bid_strategy?: BidStrategy;
466
+ /** @deprecated Use bid_strategy instead */
467
+ bid_type?: string;
468
+ /** Traffic allocation mode */
469
+ traffic_allocation_mode: TrafficAllocationMode;
470
+ /** A/B test end date */
471
+ traffic_allocation_ab_test_end_date?: DateString | null;
472
+ /** External brand safety config */
473
+ external_brand_safety: ExternalBrandSafety;
474
+ /** Campaign start date */
475
+ start_date: DateString | null;
476
+ /** Campaign end date */
477
+ end_date: DateString;
478
+ /** Approval state */
479
+ approval_state: ApprovalState;
480
+ /** Whether campaign is active */
481
+ is_active: boolean;
482
+ /** Campaign status */
483
+ status: CampaignStatus;
484
+ /** Marketplace audience targeting */
485
+ audience_segments_multi_targeting: MultiTargeting;
486
+ /** Custom audience targeting */
487
+ custom_audience_targeting: MultiTargeting;
488
+ /** Marking label targeting */
489
+ marking_label_multi_targeting?: MultiTargeting;
490
+ /** Lookalike audience targeting */
491
+ lookalike_audience_targeting: MultiTargeting;
492
+ /** Contextual segments targeting */
493
+ contextual_segments_targeting?: MultiTargeting;
494
+ /** Marketing objective */
495
+ marketing_objective: MarketingObjective;
496
+ /** Verification pixel config */
497
+ verification_pixel?: VerificationPixel;
498
+ /** Viewability tag config */
499
+ viewability_tag?: ViewabilityTag;
500
+ /** Activity schedule */
501
+ activity_schedule: ActivitySchedule;
502
+ /** Policy review status */
503
+ policy_review: PolicyReview;
504
+ /** Account currency */
505
+ currency?: CurrencyCode;
506
+ }
507
+ /**
508
+ * Campaign creation request
509
+ */
510
+ interface CreateCampaignRequest {
511
+ /** Campaign name (required) */
512
+ name: string;
513
+ /** Branding text (required) */
514
+ branding_text: string;
515
+ /** Cost per click */
516
+ cpc?: number;
517
+ /** Spending limit */
518
+ spending_limit?: number;
519
+ /** Spending limit model */
520
+ spending_limit_model?: SpendingLimitModel;
521
+ /** Marketing objective (required) */
522
+ marketing_objective: MarketingObjective;
523
+ /** Daily cap */
524
+ daily_cap?: number;
525
+ /** Daily ad delivery model */
526
+ daily_ad_delivery_model?: DailyAdDeliveryModel;
527
+ /** Bid strategy */
528
+ bid_strategy?: BidStrategy;
529
+ /** CPA goal */
530
+ cpa_goal?: number;
531
+ /** Country targeting */
532
+ country_targeting?: TargetingValue;
533
+ /** Platform targeting */
534
+ platform_targeting?: TargetingValue;
535
+ /** OS targeting */
536
+ os_targeting?: TargetingValue;
537
+ /** Start date */
538
+ start_date?: DateString;
539
+ /** End date */
540
+ end_date?: DateString;
541
+ /** Tracking code */
542
+ tracking_code?: string;
543
+ /** Comments */
544
+ comments?: string;
545
+ /** Traffic allocation mode */
546
+ traffic_allocation_mode?: TrafficAllocationMode;
547
+ }
548
+ /**
549
+ * Campaign update request
550
+ */
551
+ interface UpdateCampaignRequest {
552
+ /** Campaign name */
553
+ name?: string;
554
+ /** Branding text */
555
+ branding_text?: string;
556
+ /** Cost per click */
557
+ cpc?: number;
558
+ /** Spending limit */
559
+ spending_limit?: number;
560
+ /** Spending limit model */
561
+ spending_limit_model?: SpendingLimitModel;
562
+ /** Daily cap */
563
+ daily_cap?: number;
564
+ /** Daily ad delivery model */
565
+ daily_ad_delivery_model?: DailyAdDeliveryModel;
566
+ /** Bid strategy */
567
+ bid_strategy?: BidStrategy;
568
+ /** CPA goal */
569
+ cpa_goal?: number;
570
+ /** Country targeting */
571
+ country_targeting?: TargetingValue;
572
+ /** Platform targeting */
573
+ platform_targeting?: TargetingValue;
574
+ /** OS targeting */
575
+ os_targeting?: TargetingValue;
576
+ /** Start date */
577
+ start_date?: DateString;
578
+ /** End date */
579
+ end_date?: DateString;
580
+ /** Whether campaign is active */
581
+ is_active?: boolean;
582
+ /** Tracking code */
583
+ tracking_code?: string;
584
+ /** Comments */
585
+ comments?: string;
586
+ /** Activity schedule */
587
+ activity_schedule?: ActivitySchedule;
588
+ }
589
+ /**
590
+ * Campaign list response
591
+ */
592
+ interface CampaignListResponse {
593
+ results: Campaign[];
594
+ metadata?: {
595
+ total: number;
596
+ count: number;
597
+ };
598
+ }
599
+ /**
600
+ * Bulk campaign update request item
601
+ */
602
+ interface BulkCampaignUpdate {
603
+ /** Campaign ID to update */
604
+ campaign_id: string;
605
+ /** Fields to update */
606
+ update: UpdateCampaignRequest;
607
+ }
608
+ /**
609
+ * Bulk campaign update request
610
+ */
611
+ interface BulkCampaignUpdateRequest {
612
+ campaigns: BulkCampaignUpdate[];
613
+ }
614
+ /**
615
+ * Campaign patch operation
616
+ */
617
+ type PatchOperation = 'ADD' | 'REMOVE' | 'REPLACE';
618
+ /**
619
+ * Campaign patch request for collections
620
+ */
621
+ interface CampaignPatchRequest {
622
+ /** Operation type */
623
+ op: PatchOperation;
624
+ /** Path to the field */
625
+ path: string;
626
+ /** Value to set */
627
+ value: unknown;
628
+ }
629
+ /**
630
+ * Campaign reach estimation request
631
+ */
632
+ interface CampaignReachEstimatorRequest {
633
+ /** Country codes */
634
+ country_targeting?: string[];
635
+ /** Platform types */
636
+ platform_targeting?: string[];
637
+ /** Daily budget */
638
+ daily_cap?: number;
639
+ /** CPC bid */
640
+ cpc?: number;
641
+ }
642
+ /**
643
+ * Campaign reach estimation response
644
+ */
645
+ interface CampaignReachEstimatorResponse {
646
+ /** Estimated daily impressions */
647
+ estimated_impressions: number;
648
+ /** Estimated daily clicks */
649
+ estimated_clicks: number;
650
+ /** Estimated daily reach */
651
+ estimated_reach: number;
652
+ }
653
+
654
+ /**
655
+ * Campaign Item (Ad) types for Taboola Backstage API
656
+ */
657
+
658
+ /**
659
+ * Creative focus type
660
+ * @deprecated Use automatic cropping instead
661
+ */
662
+ type CreativeFocusType = 'AUTOMATIC' | 'CUSTOM';
663
+ /**
664
+ * Coordinates for custom creative focus
665
+ * @deprecated
666
+ */
667
+ interface Coordinates {
668
+ top: number;
669
+ left: number;
670
+ right: number;
671
+ bottom: number;
672
+ }
673
+ /**
674
+ * Creative focus configuration
675
+ * @deprecated
676
+ */
677
+ interface CreativeFocus {
678
+ type: CreativeFocusType;
679
+ coordinates: Coordinates | null;
680
+ }
681
+ /**
682
+ * CTA (Call to Action) configuration
683
+ */
684
+ interface CTA {
685
+ /** CTA button type */
686
+ cta_type: CTAType;
687
+ /** Custom CTA text (if applicable) */
688
+ cta_text?: string;
689
+ }
690
+ /**
691
+ * Verification pixel for item
692
+ */
693
+ interface ItemVerificationPixel {
694
+ /** Pixel type */
695
+ type: string;
696
+ /** Pixel URL */
697
+ url: string;
698
+ }
699
+ /**
700
+ * Viewability tag for item
701
+ */
702
+ interface ItemViewabilityTag {
703
+ /** Tag type */
704
+ type: string;
705
+ /** Tag value */
706
+ value: string;
707
+ }
708
+ /**
709
+ * Policy review status for item
710
+ */
711
+ interface ItemPolicyReview {
712
+ /** Rejection reason if rejected */
713
+ reject_reason: string | null;
714
+ }
715
+ /**
716
+ * Full Campaign Item (Ad) object
717
+ */
718
+ interface CampaignItem {
719
+ /** Unique item ID */
720
+ id: string;
721
+ /** Campaign ID this item belongs to */
722
+ campaign_id: string;
723
+ /** Item type */
724
+ type: ItemType;
725
+ /** Landing page URL */
726
+ url: string;
727
+ /** Thumbnail image URL */
728
+ thumbnail_url: string;
729
+ /** Ad title/headline */
730
+ title: string;
731
+ /** Ad description */
732
+ description?: string;
733
+ /** Approval state */
734
+ approval_state: ApprovalState;
735
+ /** Whether item is active */
736
+ is_active: boolean;
737
+ /** Item status */
738
+ status: ItemStatus;
739
+ /** Policy review status */
740
+ policy_review: ItemPolicyReview;
741
+ /** CTA button configuration */
742
+ cta: CTA | null;
743
+ /**
744
+ * Creative focus configuration
745
+ * @deprecated
746
+ */
747
+ creative_focus?: CreativeFocus;
748
+ /** Verification pixel */
749
+ verification_pixel?: ItemVerificationPixel;
750
+ /** Viewability tag */
751
+ viewability_tag?: ItemViewabilityTag;
752
+ /** Custom data for tracking */
753
+ custom_data?: string;
754
+ /** Fallback URL */
755
+ fallback_url?: string;
756
+ /** Third-party tracking pixel URLs */
757
+ third_party_tags?: string[];
758
+ /** RSS feed URL (for RSS items) */
759
+ rss_url?: string;
760
+ /** Parent item ID (for RSS children) */
761
+ parent_id?: string;
762
+ }
763
+ /**
764
+ * Create campaign item request
765
+ */
766
+ interface CreateItemRequest {
767
+ /** Landing page URL (required) */
768
+ url: string;
769
+ /** Ad title/headline (required) */
770
+ title: string;
771
+ /** Thumbnail image URL (required unless uploading) */
772
+ thumbnail_url?: string;
773
+ /** Ad description */
774
+ description?: string;
775
+ /** CTA configuration */
776
+ cta?: CTA;
777
+ /** Custom tracking data */
778
+ custom_data?: string;
779
+ /** Third-party tracking pixels */
780
+ third_party_tags?: string[];
781
+ /** RSS feed URL (creates RSS item) */
782
+ rss_url?: string;
783
+ }
784
+ /**
785
+ * Update campaign item request
786
+ */
787
+ interface UpdateItemRequest {
788
+ /** Ad title */
789
+ title?: string;
790
+ /** Ad description */
791
+ description?: string;
792
+ /** Thumbnail image URL */
793
+ thumbnail_url?: string;
794
+ /** Whether item is active */
795
+ is_active?: boolean;
796
+ /** CTA configuration */
797
+ cta?: CTA;
798
+ /** Custom tracking data */
799
+ custom_data?: string;
800
+ /** Third-party tracking pixels */
801
+ third_party_tags?: string[];
802
+ }
803
+ /**
804
+ * Campaign item list response
805
+ */
806
+ interface CampaignItemListResponse {
807
+ results: CampaignItem[];
808
+ metadata?: {
809
+ total: number;
810
+ count: number;
811
+ };
812
+ }
813
+ /**
814
+ * Bulk item creation request
815
+ */
816
+ interface BulkCreateItemsRequest {
817
+ items: CreateItemRequest[];
818
+ }
819
+ /**
820
+ * Bulk item creation response
821
+ */
822
+ interface BulkCreateItemsResponse {
823
+ results: CampaignItem[];
824
+ failed?: {
825
+ item: CreateItemRequest;
826
+ error: string;
827
+ }[];
828
+ }
829
+ /**
830
+ * Bulk item update request (across campaigns)
831
+ */
832
+ interface BulkUpdateItemsRequest {
833
+ items: {
834
+ /** Item ID */
835
+ id: string;
836
+ /** Campaign ID */
837
+ campaign_id: string;
838
+ /** Fields to update */
839
+ update: UpdateItemRequest;
840
+ }[];
841
+ }
842
+ /**
843
+ * Bulk item delete request (across campaigns)
844
+ */
845
+ interface BulkDeleteItemsRequest {
846
+ items: {
847
+ /** Item ID */
848
+ id: string;
849
+ /** Campaign ID */
850
+ campaign_id: string;
851
+ }[];
852
+ }
853
+ /**
854
+ * RSS child item
855
+ */
856
+ interface RSSChildItem extends CampaignItem {
857
+ /** Parent RSS item ID */
858
+ parent_id: string;
859
+ }
860
+ /**
861
+ * RSS children list response
862
+ */
863
+ interface RSSChildrenListResponse {
864
+ results: RSSChildItem[];
865
+ metadata?: {
866
+ total: number;
867
+ count: number;
868
+ };
869
+ }
870
+ /**
871
+ * Image upload response
872
+ */
873
+ interface ImageUploadResponse {
874
+ /** URL of the uploaded image */
875
+ url: string;
876
+ /** Image width */
877
+ width: number;
878
+ /** Image height */
879
+ height: number;
880
+ }
881
+ /**
882
+ * Image library search parameters
883
+ */
884
+ interface ImageLibrarySearchParams {
885
+ /** Search query */
886
+ query: string;
887
+ /** Number of results */
888
+ limit?: number;
889
+ /** Result offset */
890
+ offset?: number;
891
+ }
892
+ /**
893
+ * Image library item
894
+ */
895
+ interface ImageLibraryItem {
896
+ /** Image ID */
897
+ id: string;
898
+ /** Preview URL */
899
+ preview_url: string;
900
+ /** Full URL */
901
+ url: string;
902
+ /** Image width */
903
+ width: number;
904
+ /** Image height */
905
+ height: number;
906
+ /** Image source */
907
+ source: string;
908
+ }
909
+ /**
910
+ * Image library search response
911
+ */
912
+ interface ImageLibrarySearchResponse {
913
+ results: ImageLibraryItem[];
914
+ total: number;
915
+ }
916
+
917
+ /**
918
+ * Dictionary API Types
919
+ *
920
+ * Types for Taboola Backstage API reference/dictionary data.
921
+ */
922
+ /**
923
+ * Country for geo targeting
924
+ */
925
+ interface Country {
926
+ name: string;
927
+ value: string;
928
+ }
929
+ /**
930
+ * Region/state within a country
931
+ */
932
+ interface Region {
933
+ name: string;
934
+ value: string;
935
+ country: string;
936
+ }
937
+ /**
938
+ * DMA (Designated Market Area) - US only
939
+ */
940
+ interface DMA {
941
+ name: string;
942
+ value: string;
943
+ country: string;
944
+ }
945
+ /**
946
+ * Postal code for geo targeting
947
+ */
948
+ interface PostalCode {
949
+ name: string;
950
+ value: string;
951
+ country: string;
952
+ }
953
+ /**
954
+ * Platform for device targeting
955
+ */
956
+ interface Platform {
957
+ name: string;
958
+ value: string;
959
+ }
960
+ /**
961
+ * Operating system for device targeting
962
+ */
963
+ interface OperatingSystemInfo {
964
+ name: string;
965
+ value: string;
966
+ }
967
+ /**
968
+ * OS version for device targeting
969
+ */
970
+ interface OSVersion {
971
+ name: string;
972
+ value: string;
973
+ os_family: string;
974
+ }
975
+ /**
976
+ * Browser for device targeting
977
+ */
978
+ interface Browser {
979
+ name: string;
980
+ value: string;
981
+ }
982
+ /**
983
+ * Day of week for activity scheduling
984
+ */
985
+ interface DayOfWeek {
986
+ name: string;
987
+ value: string;
988
+ }
989
+ /**
990
+ * Minimum CPC value per country/platform
991
+ */
992
+ interface MinimumCPC {
993
+ country: string;
994
+ platform: string;
995
+ currency: string;
996
+ min_cpc: number;
997
+ }
998
+ /**
999
+ * Marketplace audience segment
1000
+ */
1001
+ interface MarketplaceAudience {
1002
+ id: string;
1003
+ name: string;
1004
+ description: string | null;
1005
+ provider: string | null;
1006
+ data_partner_id: string | null;
1007
+ parent_id: string | null;
1008
+ has_children: boolean;
1009
+ country: string | null;
1010
+ platform: string | null;
1011
+ full_path: string | null;
1012
+ }
1013
+ /**
1014
+ * Lookalike audience
1015
+ */
1016
+ interface LookalikeAudience {
1017
+ id: string;
1018
+ name: string;
1019
+ description: string | null;
1020
+ source_audience_id: string | null;
1021
+ status: string;
1022
+ size: number | null;
1023
+ country: string | null;
1024
+ }
1025
+ /**
1026
+ * Contextual segment
1027
+ */
1028
+ interface ContextualSegment {
1029
+ id: string;
1030
+ name: string;
1031
+ description: string | null;
1032
+ category: string | null;
1033
+ parent_id: string | null;
1034
+ has_children: boolean;
1035
+ }
1036
+ /**
1037
+ * Campaign property enums response
1038
+ */
1039
+ type CampaignEnums = Record<string, EnumValue[]>;
1040
+ /**
1041
+ * Item property enums response
1042
+ */
1043
+ type ItemEnums = Record<string, EnumValue[]>;
1044
+ /**
1045
+ * Enum value object
1046
+ */
1047
+ interface EnumValue {
1048
+ name: string;
1049
+ value: string;
1050
+ description: string | null;
1051
+ }
1052
+ /**
1053
+ * Postal code search params
1054
+ */
1055
+ interface PostalCodeSearchParams {
1056
+ search?: string | undefined;
1057
+ page?: number | undefined;
1058
+ page_size?: number | undefined;
1059
+ }
1060
+ /**
1061
+ * Supported image library language
1062
+ */
1063
+ interface ImageLibraryLanguage {
1064
+ name: string;
1065
+ value: string;
1066
+ }
1067
+ /**
1068
+ * Image taxonomy
1069
+ */
1070
+ interface ImageTaxonomy {
1071
+ id: string;
1072
+ name: string;
1073
+ parent_id: string | null;
1074
+ has_children: boolean;
1075
+ }
1076
+
1077
+ /**
1078
+ * Publisher API Types
1079
+ *
1080
+ * Types for Taboola Backstage API publisher targeting and blocking.
1081
+ */
1082
+
1083
+ /**
1084
+ * Publisher information
1085
+ */
1086
+ interface Publisher {
1087
+ site: string;
1088
+ site_id: string;
1089
+ is_blocked: boolean;
1090
+ }
1091
+ /**
1092
+ * Response for listing publishers
1093
+ */
1094
+ type PublisherListResponse = ListResponse<Publisher>;
1095
+ /**
1096
+ * Blocked publisher at account level
1097
+ */
1098
+ interface BlockedPublisher {
1099
+ site: string;
1100
+ site_id: string;
1101
+ }
1102
+ /**
1103
+ * Response for blocked publishers
1104
+ */
1105
+ interface BlockedPublishersResponse {
1106
+ results: BlockedPublisher[];
1107
+ }
1108
+ /**
1109
+ * Request to update blocked publishers at account level
1110
+ */
1111
+ interface UpdateBlockedPublishersRequest {
1112
+ sites: string[];
1113
+ }
1114
+
1115
+ /**
1116
+ * Targeting API Types
1117
+ *
1118
+ * Types for Taboola Backstage API campaign targeting including
1119
+ * postal codes, audience segments, and contextual targeting.
1120
+ */
1121
+
1122
+ /**
1123
+ * Postal code targeting configuration
1124
+ */
1125
+ interface PostalCodeTargeting {
1126
+ type: 'INCLUDE' | 'EXCLUDE' | 'ALL';
1127
+ values: PostalCodeValue[];
1128
+ restrictions: PostalCodeRestrictions | null;
1129
+ }
1130
+ /**
1131
+ * Individual postal code value
1132
+ */
1133
+ interface PostalCodeValue {
1134
+ postal_code: string;
1135
+ country: string;
1136
+ }
1137
+ /**
1138
+ * Postal code targeting restrictions
1139
+ */
1140
+ interface PostalCodeRestrictions {
1141
+ max_postal_codes: number;
1142
+ supported_countries: string[];
1143
+ }
1144
+ /**
1145
+ * Request to update postal code targeting
1146
+ */
1147
+ interface UpdatePostalCodeTargetingRequest {
1148
+ type: 'INCLUDE' | 'EXCLUDE' | 'ALL';
1149
+ values: PostalCodeValue[];
1150
+ }
1151
+ /**
1152
+ * Audience segment for targeting
1153
+ */
1154
+ interface AudienceSegment {
1155
+ id: string;
1156
+ name: string | null;
1157
+ }
1158
+ /**
1159
+ * Audience targeting configuration (marketplace, custom, lookalike)
1160
+ */
1161
+ interface AudienceTargeting {
1162
+ collection: AudienceSegment[];
1163
+ type: MultiTargetingState;
1164
+ }
1165
+ /**
1166
+ * Request to update audience targeting
1167
+ */
1168
+ interface UpdateAudienceTargetingRequest {
1169
+ type: MultiTargetingState;
1170
+ collection?: AudienceSegment[] | undefined;
1171
+ and_collection?: AudienceSegment[][] | undefined;
1172
+ or_collection?: AudienceSegment[][] | undefined;
1173
+ }
1174
+ /**
1175
+ * Contextual segment for targeting
1176
+ */
1177
+ interface ContextualSegmentValue {
1178
+ id: string;
1179
+ name: string | null;
1180
+ }
1181
+ /**
1182
+ * Contextual targeting configuration
1183
+ */
1184
+ interface ContextualTargeting {
1185
+ type: MultiTargetingState;
1186
+ collection: ContextualSegmentValue[];
1187
+ }
1188
+ /**
1189
+ * Request to update contextual targeting
1190
+ */
1191
+ interface UpdateContextualTargetingRequest {
1192
+ type: MultiTargetingState;
1193
+ collection: ContextualSegmentValue[];
1194
+ }
1195
+ /**
1196
+ * First party audience targeting
1197
+ */
1198
+ interface FirstPartyAudienceTargeting {
1199
+ type: MultiTargetingState;
1200
+ collection: AudienceSegment[];
1201
+ }
1202
+ /**
1203
+ * Request to update first party audience targeting
1204
+ */
1205
+ interface UpdateFirstPartyAudienceTargetingRequest {
1206
+ type: MultiTargetingState;
1207
+ collection: AudienceSegment[];
1208
+ }
1209
+
1210
+ /**
1211
+ * Audience API Types
1212
+ *
1213
+ * Types for Combined Audiences and First Party Audience Onboarding.
1214
+ */
1215
+
1216
+ /**
1217
+ * Combined audience - combines multiple audience types with AND/OR logic
1218
+ */
1219
+ interface CombinedAudience {
1220
+ id: string;
1221
+ name: string;
1222
+ description: string | null;
1223
+ status: CombinedAudienceStatus;
1224
+ created_at: string;
1225
+ updated_at: string;
1226
+ include_rules: CombinedAudienceRule[];
1227
+ exclude_rules: CombinedAudienceRule[];
1228
+ }
1229
+ /**
1230
+ * Combined audience status
1231
+ */
1232
+ type CombinedAudienceStatus = 'ACTIVE' | 'INACTIVE' | 'DELETED';
1233
+ /**
1234
+ * Rule within a combined audience
1235
+ */
1236
+ interface CombinedAudienceRule {
1237
+ audience_type: CombinedAudienceType;
1238
+ audiences: CombinedAudienceItem[];
1239
+ }
1240
+ /**
1241
+ * Type of audience in a combined audience rule
1242
+ */
1243
+ type CombinedAudienceType = 'CUSTOM_AUDIENCE' | 'LOOKALIKE_AUDIENCE' | 'MARKETPLACE_AUDIENCE' | 'FIRST_PARTY_AUDIENCE';
1244
+ /**
1245
+ * Individual audience item in a rule
1246
+ */
1247
+ interface CombinedAudienceItem {
1248
+ id: string;
1249
+ name: string | null;
1250
+ }
1251
+ /**
1252
+ * Response for listing combined audiences
1253
+ */
1254
+ type CombinedAudienceListResponse = ListResponse<CombinedAudience>;
1255
+ /**
1256
+ * Request to create a combined audience
1257
+ */
1258
+ interface CreateCombinedAudienceRequest {
1259
+ name: string;
1260
+ description?: string | undefined;
1261
+ include_rules: CombinedAudienceRule[];
1262
+ exclude_rules?: CombinedAudienceRule[] | undefined;
1263
+ }
1264
+ /**
1265
+ * Request to update a combined audience
1266
+ */
1267
+ interface UpdateCombinedAudienceRequest {
1268
+ name?: string | undefined;
1269
+ description?: string | undefined;
1270
+ include_rules?: CombinedAudienceRule[] | undefined;
1271
+ exclude_rules?: CombinedAudienceRule[] | undefined;
1272
+ }
1273
+ /**
1274
+ * Available audience for combined audience creation
1275
+ */
1276
+ interface AvailableAudience {
1277
+ id: string;
1278
+ name: string;
1279
+ type: CombinedAudienceType;
1280
+ size: number | null;
1281
+ status: string;
1282
+ }
1283
+ /**
1284
+ * Response for listing available audiences
1285
+ */
1286
+ type AvailableAudiencesResponse = ListResponse<AvailableAudience>;
1287
+ /**
1288
+ * First party audience for onboarding
1289
+ */
1290
+ interface FirstPartyAudience {
1291
+ id: string;
1292
+ name: string;
1293
+ description: string | null;
1294
+ status: FirstPartyAudienceStatus;
1295
+ size: number | null;
1296
+ match_rate: number | null;
1297
+ created_at: string;
1298
+ updated_at: string;
1299
+ ttl_days: number | null;
1300
+ source_type: FirstPartyAudienceSourceType;
1301
+ }
1302
+ /**
1303
+ * First party audience status
1304
+ */
1305
+ type FirstPartyAudienceStatus = 'BUILDING' | 'READY' | 'FAILED' | 'EXPIRED' | 'ARCHIVED';
1306
+ /**
1307
+ * First party audience source type
1308
+ */
1309
+ type FirstPartyAudienceSourceType = 'CRM' | 'EMAIL' | 'PHONE' | 'DEVICE_ID' | 'CUSTOM';
1310
+ /**
1311
+ * Request to create a first party audience
1312
+ */
1313
+ interface CreateFirstPartyAudienceRequest {
1314
+ name: string;
1315
+ description?: string | undefined;
1316
+ ttl_days?: number | undefined;
1317
+ source_type: FirstPartyAudienceSourceType;
1318
+ }
1319
+ /**
1320
+ * User identifier for first party audience
1321
+ */
1322
+ interface FirstPartyAudienceUser {
1323
+ identifier_type: FirstPartyIdentifierType;
1324
+ identifier_value: string;
1325
+ }
1326
+ /**
1327
+ * Type of user identifier
1328
+ */
1329
+ type FirstPartyIdentifierType = 'EMAIL' | 'EMAIL_SHA256' | 'PHONE' | 'PHONE_SHA256' | 'DEVICE_ID' | 'DEVICE_ID_SHA256';
1330
+ /**
1331
+ * Request to add or remove users from first party audience
1332
+ */
1333
+ interface AddRemoveUsersRequest {
1334
+ add?: FirstPartyAudienceUser[] | undefined;
1335
+ remove?: FirstPartyAudienceUser[] | undefined;
1336
+ }
1337
+ /**
1338
+ * Response for add/remove users operation
1339
+ */
1340
+ interface AddRemoveUsersResponse {
1341
+ added_count: number;
1342
+ removed_count: number;
1343
+ failed_count: number;
1344
+ errors: AddRemoveUserError[];
1345
+ }
1346
+ /**
1347
+ * Error from add/remove users operation
1348
+ */
1349
+ interface AddRemoveUserError {
1350
+ identifier: string;
1351
+ error: string;
1352
+ }
1353
+
1354
+ /**
1355
+ * Pixel API Types
1356
+ *
1357
+ * Types for Taboola Universal Pixel API including
1358
+ * conversion rules and custom audience rules.
1359
+ */
1360
+
1361
+ /**
1362
+ * Conversion rule for tracking conversions
1363
+ */
1364
+ interface ConversionRule {
1365
+ id: string;
1366
+ display_name: string;
1367
+ status: ConversionRuleStatus;
1368
+ type: ConversionRuleType;
1369
+ include_in_total_conversions: boolean;
1370
+ include_in_total_value: boolean;
1371
+ category: ConversionCategory | null;
1372
+ conversion_window_days: number;
1373
+ view_through_window_days: number;
1374
+ counting_method: CountingMethod;
1375
+ aggregation_type: AggregationType;
1376
+ default_conversion_value: number | null;
1377
+ conditions: Condition[];
1378
+ effect: Effect;
1379
+ event_name: string | null;
1380
+ created_at: string;
1381
+ updated_at: string;
1382
+ }
1383
+ /**
1384
+ * Conversion rule status
1385
+ */
1386
+ type ConversionRuleStatus = 'ACTIVE' | 'ARCHIVED';
1387
+ /**
1388
+ * Conversion rule type
1389
+ */
1390
+ type ConversionRuleType = 'EVENT_BASED' | 'URL_BASED' | 'CUSTOM';
1391
+ /**
1392
+ * Conversion category
1393
+ */
1394
+ type ConversionCategory = 'PURCHASE' | 'LEAD' | 'SIGN_UP' | 'ADD_TO_CART' | 'CHECKOUT' | 'CONTENT_VIEW' | 'SEARCH' | 'ADD_PAYMENT_INFO' | 'SUBSCRIBE' | 'PAGE_VIEW' | 'COMPLETE_REGISTRATION' | 'OTHER';
1395
+ /**
1396
+ * Counting method for conversions
1397
+ */
1398
+ type CountingMethod = 'ALL' | 'ONE';
1399
+ /**
1400
+ * Aggregation type for conversion values
1401
+ */
1402
+ type AggregationType = 'SUM' | 'COUNT';
1403
+ /**
1404
+ * Condition for matching conversions
1405
+ */
1406
+ interface Condition {
1407
+ type: ConditionType;
1408
+ operator: ConditionOperator;
1409
+ value: string;
1410
+ parameter?: string | undefined;
1411
+ }
1412
+ /**
1413
+ * Condition type
1414
+ */
1415
+ type ConditionType = 'URL' | 'URL_PARAMETER' | 'EVENT_NAME' | 'EVENT_PARAMETER';
1416
+ /**
1417
+ * Condition operator
1418
+ */
1419
+ type ConditionOperator = 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'NOT_CONTAINS' | 'STARTS_WITH' | 'ENDS_WITH' | 'REGEX';
1420
+ /**
1421
+ * Effect of matching a conversion rule
1422
+ */
1423
+ interface Effect {
1424
+ type: EffectType;
1425
+ value: number | null;
1426
+ currency: string | null;
1427
+ value_parameter: string | null;
1428
+ }
1429
+ /**
1430
+ * Effect type
1431
+ */
1432
+ type EffectType = 'FIXED_VALUE' | 'DYNAMIC_VALUE' | 'NO_VALUE';
1433
+ /**
1434
+ * Response for listing conversion rules
1435
+ */
1436
+ type ConversionRuleListResponse = ListResponse<ConversionRule>;
1437
+ /**
1438
+ * Request to create a conversion rule
1439
+ */
1440
+ interface CreateConversionRuleRequest {
1441
+ display_name: string;
1442
+ type: ConversionRuleType;
1443
+ include_in_total_conversions?: boolean | undefined;
1444
+ include_in_total_value?: boolean | undefined;
1445
+ category?: ConversionCategory | undefined;
1446
+ conversion_window_days?: number | undefined;
1447
+ view_through_window_days?: number | undefined;
1448
+ counting_method?: CountingMethod | undefined;
1449
+ aggregation_type?: AggregationType | undefined;
1450
+ default_conversion_value?: number | undefined;
1451
+ conditions: Condition[];
1452
+ effect: Effect;
1453
+ event_name?: string | undefined;
1454
+ }
1455
+ /**
1456
+ * Request to update a conversion rule
1457
+ */
1458
+ interface UpdateConversionRuleRequest {
1459
+ display_name?: string | undefined;
1460
+ status?: ConversionRuleStatus | undefined;
1461
+ include_in_total_conversions?: boolean | undefined;
1462
+ include_in_total_value?: boolean | undefined;
1463
+ category?: ConversionCategory | undefined;
1464
+ conversion_window_days?: number | undefined;
1465
+ view_through_window_days?: number | undefined;
1466
+ counting_method?: CountingMethod | undefined;
1467
+ aggregation_type?: AggregationType | undefined;
1468
+ default_conversion_value?: number | undefined;
1469
+ conditions?: Condition[] | undefined;
1470
+ effect?: Effect | undefined;
1471
+ }
1472
+ /**
1473
+ * Custom audience rule for building audiences from pixel data
1474
+ */
1475
+ interface CustomAudienceRule {
1476
+ id: string;
1477
+ display_name: string;
1478
+ status: CustomAudienceRuleStatus;
1479
+ conditions: Condition[];
1480
+ ttl_days: number;
1481
+ size: number | null;
1482
+ created_at: string;
1483
+ updated_at: string;
1484
+ }
1485
+ /**
1486
+ * Custom audience rule status
1487
+ */
1488
+ type CustomAudienceRuleStatus = 'ACTIVE' | 'PAUSED' | 'ARCHIVED';
1489
+ /**
1490
+ * Response for listing custom audience rules
1491
+ */
1492
+ type CustomAudienceRuleListResponse = ListResponse<CustomAudienceRule>;
1493
+ /**
1494
+ * Request to create a custom audience rule
1495
+ */
1496
+ interface CreateCustomAudienceRuleRequest {
1497
+ display_name: string;
1498
+ conditions: Condition[];
1499
+ ttl_days?: number | undefined;
1500
+ }
1501
+ /**
1502
+ * Request to update a custom audience rule
1503
+ */
1504
+ interface UpdateCustomAudienceRuleRequest {
1505
+ display_name?: string | undefined;
1506
+ status?: CustomAudienceRuleStatus | undefined;
1507
+ conditions?: Condition[] | undefined;
1508
+ ttl_days?: number | undefined;
1509
+ }
1510
+ /**
1511
+ * Conversion rule with additional performance data
1512
+ */
1513
+ interface ConversionRuleWithData extends ConversionRule {
1514
+ conversions_30d: number;
1515
+ conversions_value_30d: number;
1516
+ last_conversion_at: string | null;
1517
+ }
1518
+ /**
1519
+ * Response for listing conversion rules with data
1520
+ */
1521
+ type ConversionRuleWithDataListResponse = ListResponse<ConversionRuleWithData>;
1522
+
1523
+ /**
1524
+ * Report API Types
1525
+ *
1526
+ * Types for Taboola Backstage API reporting including
1527
+ * Campaign Summary, Top Campaign Content, and Realtime reports.
1528
+ */
1529
+
1530
+ /**
1531
+ * Common report parameters
1532
+ */
1533
+ interface BaseReportParams {
1534
+ start_date: string;
1535
+ end_date: string;
1536
+ }
1537
+ /**
1538
+ * Campaign Summary Report parameters
1539
+ */
1540
+ interface CampaignSummaryReportParams extends BaseReportParams {
1541
+ /** Filter by specific campaign ID */
1542
+ campaign?: string | undefined;
1543
+ /** Filter by specific site (publisher) */
1544
+ site?: string | undefined;
1545
+ /** Filter by country code */
1546
+ country?: string | undefined;
1547
+ /** Filter by platform */
1548
+ platform?: string | undefined;
1549
+ /** Include custom conversion columns (comma-separated rule names or 'all') */
1550
+ include_conversions?: string | undefined;
1551
+ }
1552
+ /**
1553
+ * Top Campaign Content Report parameters
1554
+ */
1555
+ interface TopCampaignContentReportParams extends BaseReportParams {
1556
+ /** Filter by specific campaign ID */
1557
+ campaign?: string | undefined;
1558
+ /** Limit number of results */
1559
+ limit?: number | undefined;
1560
+ /** Include custom conversion columns */
1561
+ include_conversions?: string | undefined;
1562
+ }
1563
+ /**
1564
+ * Realtime Report parameters
1565
+ */
1566
+ interface RealtimeReportParams {
1567
+ /** Filter by specific campaign ID */
1568
+ campaign?: string | undefined;
1569
+ }
1570
+ /**
1571
+ * Campaign Summary Report response
1572
+ */
1573
+ interface CampaignSummaryReport {
1574
+ 'last-used-rawdata-update-time': string;
1575
+ 'last-used-rawdata-update-time-gmt-millisec': number;
1576
+ timezone: string;
1577
+ results: CampaignSummaryRow[];
1578
+ recordCount: number;
1579
+ metadata: ReportMetadata;
1580
+ }
1581
+ /**
1582
+ * Campaign summary report row
1583
+ */
1584
+ interface CampaignSummaryRow {
1585
+ /** Date of the data (for day/week/month dimensions) */
1586
+ date?: string | undefined;
1587
+ date_end_period?: string | undefined;
1588
+ /** Campaign ID (for campaign dimension) */
1589
+ campaign?: string | undefined;
1590
+ campaign_name?: string | undefined;
1591
+ /** Site name (for site dimension) */
1592
+ site?: string | undefined;
1593
+ site_id?: string | undefined;
1594
+ /** Country code (for country dimension) */
1595
+ country?: string | undefined;
1596
+ /** Platform (for platform dimension) */
1597
+ platform?: string | undefined;
1598
+ /** Number of clicks */
1599
+ clicks: number;
1600
+ /** Number of impressions */
1601
+ impressions: number;
1602
+ /** Number of visible impressions */
1603
+ visible_impressions: number;
1604
+ /** Total spend */
1605
+ spent: number;
1606
+ /** Click-through rate */
1607
+ ctr: number;
1608
+ /** Visible click-through rate */
1609
+ vctr: number;
1610
+ /** Cost per thousand impressions */
1611
+ cpm: number;
1612
+ /** Visible cost per thousand impressions */
1613
+ vcpm: number;
1614
+ /** Cost per click */
1615
+ cpc: number;
1616
+ /** Number of campaigns */
1617
+ campaigns_num?: number | undefined;
1618
+ /** Currency code */
1619
+ currency: string;
1620
+ /** Total conversion value */
1621
+ conversions_value: number;
1622
+ /** Return on ad spend */
1623
+ roas: number;
1624
+ /** Cost per action (all) */
1625
+ cpa: number;
1626
+ /** CPA from clicks */
1627
+ cpa_clicks: number;
1628
+ /** CPA from views */
1629
+ cpa_views: number;
1630
+ /** Number of conversion actions */
1631
+ cpa_actions_num: number;
1632
+ /** Actions from clicks */
1633
+ cpa_actions_num_from_clicks: number;
1634
+ /** Actions from views */
1635
+ cpa_actions_num_from_views: number;
1636
+ /** Conversion rate (all) */
1637
+ cpa_conversion_rate: number;
1638
+ /** Conversion rate from clicks */
1639
+ cpa_conversion_rate_clicks: number;
1640
+ /** Conversion rate from views */
1641
+ cpa_conversion_rate_views: number;
1642
+ /** Custom conversion columns (dynamic based on include_conversions) */
1643
+ [key: string]: unknown;
1644
+ }
1645
+ /**
1646
+ * Top Campaign Content Report response
1647
+ */
1648
+ interface TopCampaignContentReport {
1649
+ 'last-used-rawdata-update-time': string;
1650
+ 'last-used-rawdata-update-time-gmt-millisec': number;
1651
+ timezone: string;
1652
+ results: TopCampaignContentRow[];
1653
+ recordCount: number;
1654
+ metadata: ReportMetadata;
1655
+ }
1656
+ /**
1657
+ * Top campaign content report row
1658
+ */
1659
+ interface TopCampaignContentRow {
1660
+ /** Item ID */
1661
+ item: string;
1662
+ item_name: string;
1663
+ /** Thumbnail URL */
1664
+ thumbnail_url: string;
1665
+ /** Campaign ID */
1666
+ campaign: string;
1667
+ campaign_name: string;
1668
+ /** Metrics */
1669
+ clicks: number;
1670
+ impressions: number;
1671
+ visible_impressions: number;
1672
+ spent: number;
1673
+ ctr: number;
1674
+ vctr: number;
1675
+ cpm: number;
1676
+ vcpm: number;
1677
+ cpc: number;
1678
+ currency: string;
1679
+ conversions_value: number;
1680
+ roas: number;
1681
+ cpa: number;
1682
+ cpa_actions_num: number;
1683
+ cpa_conversion_rate: number;
1684
+ /** Custom conversion columns */
1685
+ [key: string]: unknown;
1686
+ }
1687
+ /**
1688
+ * Realtime Campaign Report response
1689
+ */
1690
+ interface RealtimeCampaignReport {
1691
+ timestamp: string;
1692
+ results: RealtimeCampaignRow[];
1693
+ }
1694
+ /**
1695
+ * Realtime campaign report row
1696
+ */
1697
+ interface RealtimeCampaignRow {
1698
+ campaign: string;
1699
+ campaign_name: string;
1700
+ status: string;
1701
+ clicks: number;
1702
+ impressions: number;
1703
+ spent: number;
1704
+ ctr: number;
1705
+ cpc: number;
1706
+ conversions: number;
1707
+ currency: string;
1708
+ }
1709
+ /**
1710
+ * Realtime Ads Report response
1711
+ */
1712
+ interface RealtimeAdsReport {
1713
+ timestamp: string;
1714
+ results: RealtimeAdsRow[];
1715
+ }
1716
+ /**
1717
+ * Realtime ads report row
1718
+ */
1719
+ interface RealtimeAdsRow {
1720
+ item: string;
1721
+ item_name: string;
1722
+ campaign: string;
1723
+ campaign_name: string;
1724
+ status: string;
1725
+ clicks: number;
1726
+ impressions: number;
1727
+ spent: number;
1728
+ ctr: number;
1729
+ cpc: number;
1730
+ conversions: number;
1731
+ currency: string;
1732
+ }
1733
+ /**
1734
+ * Report metadata
1735
+ */
1736
+ interface ReportMetadata {
1737
+ total: number;
1738
+ count: number;
1739
+ static_fields: ReportField[];
1740
+ }
1741
+ /**
1742
+ * Report field definition
1743
+ */
1744
+ interface ReportField {
1745
+ id: string;
1746
+ format: string | null;
1747
+ data_type: ReportDataType;
1748
+ }
1749
+ /**
1750
+ * Report data type
1751
+ */
1752
+ type ReportDataType = 'DATE' | 'STRING' | 'NUMERIC' | 'CURRENCY' | 'PERCENTAGE';
1753
+
1754
+ /**
1755
+ * Account API for Taboola Backstage
1756
+ */
1757
+
1758
+ /**
1759
+ * Account management API
1760
+ */
1761
+ declare class AccountsAPI {
1762
+ private readonly http;
1763
+ constructor(http: HttpClient);
1764
+ /**
1765
+ * Get current account details
1766
+ *
1767
+ * Returns details of your primary account including the account_id
1768
+ * needed for most API operations.
1769
+ *
1770
+ * @example
1771
+ * ```typescript
1772
+ * const account = await client.accounts.getCurrent();
1773
+ * console.log(account.account_id); // 'my-account-id'
1774
+ * ```
1775
+ */
1776
+ getCurrent(): Promise<Account>;
1777
+ /**
1778
+ * Get all allowed accounts for the current user
1779
+ *
1780
+ * Returns all accounts the current API credentials have access to.
1781
+ *
1782
+ * @example
1783
+ * ```typescript
1784
+ * const { results } = await client.accounts.getAllowed();
1785
+ * for (const account of results) {
1786
+ * console.log(account.name, account.account_id);
1787
+ * }
1788
+ * ```
1789
+ */
1790
+ getAllowed(): Promise<AllowedAccountsResponse>;
1791
+ /**
1792
+ * Get advertiser accounts in a network
1793
+ *
1794
+ * For network accounts, returns all advertiser accounts within the network.
1795
+ *
1796
+ * @param accountId - Network account ID
1797
+ *
1798
+ * @example
1799
+ * ```typescript
1800
+ * const { results } = await client.accounts.getNetworkAdvertisers('my-network');
1801
+ * for (const advertiser of results) {
1802
+ * console.log(advertiser.name);
1803
+ * }
1804
+ * ```
1805
+ */
1806
+ getNetworkAdvertisers(accountId: string): Promise<NetworkAdvertisersResponse>;
1807
+ /**
1808
+ * Get a specific advertiser account
1809
+ *
1810
+ * @param accountId - Account ID to retrieve
1811
+ *
1812
+ * @example
1813
+ * ```typescript
1814
+ * const account = await client.accounts.get('my-account-id');
1815
+ * console.log(account.currency);
1816
+ * ```
1817
+ */
1818
+ get(accountId: string): Promise<AdvertiserAccount>;
1819
+ }
1820
+
1821
+ /**
1822
+ * Campaigns API for Taboola Backstage
1823
+ */
1824
+
1825
+ /**
1826
+ * Options for listing campaigns
1827
+ */
1828
+ interface ListCampaignsOptions {
1829
+ /** Page number (1-indexed) */
1830
+ page?: number;
1831
+ /** Number of results per page */
1832
+ pageSize?: number;
1833
+ /** Filter by status */
1834
+ status?: string;
1835
+ /** Filter by approval state */
1836
+ approvalState?: string;
1837
+ }
1838
+ /**
1839
+ * Campaign management API
1840
+ */
1841
+ declare class CampaignsAPI {
1842
+ private readonly http;
1843
+ constructor(http: HttpClient);
1844
+ /**
1845
+ * List all campaigns for an account
1846
+ *
1847
+ * @param accountId - Account ID
1848
+ * @param options - Pagination and filter options
1849
+ *
1850
+ * @example
1851
+ * ```typescript
1852
+ * const { results } = await client.campaigns.list('my-account');
1853
+ * for (const campaign of results) {
1854
+ * console.log(campaign.name, campaign.status);
1855
+ * }
1856
+ * ```
1857
+ */
1858
+ list(accountId: string, options?: ListCampaignsOptions): Promise<CampaignListResponse>;
1859
+ /**
1860
+ * Get a single campaign by ID
1861
+ *
1862
+ * @param accountId - Account ID
1863
+ * @param campaignId - Campaign ID
1864
+ *
1865
+ * @example
1866
+ * ```typescript
1867
+ * const campaign = await client.campaigns.get('my-account', '12345');
1868
+ * console.log(campaign.name, campaign.cpc);
1869
+ * ```
1870
+ */
1871
+ get(accountId: string, campaignId: string): Promise<Campaign>;
1872
+ /**
1873
+ * Create a new campaign
1874
+ *
1875
+ * @param accountId - Account ID
1876
+ * @param campaign - Campaign data
1877
+ *
1878
+ * @example
1879
+ * ```typescript
1880
+ * const campaign = await client.campaigns.create('my-account', {
1881
+ * name: 'My New Campaign',
1882
+ * branding_text: 'My Brand',
1883
+ * cpc: 0.50,
1884
+ * spending_limit: 1000,
1885
+ * spending_limit_model: 'MONTHLY',
1886
+ * marketing_objective: 'DRIVE_WEBSITE_TRAFFIC',
1887
+ * });
1888
+ * console.log('Created campaign:', campaign.id);
1889
+ * ```
1890
+ */
1891
+ create(accountId: string, campaign: CreateCampaignRequest): Promise<Campaign>;
1892
+ /**
1893
+ * Update an existing campaign
1894
+ *
1895
+ * @param accountId - Account ID
1896
+ * @param campaignId - Campaign ID
1897
+ * @param updates - Fields to update
1898
+ *
1899
+ * @example
1900
+ * ```typescript
1901
+ * const campaign = await client.campaigns.update('my-account', '12345', {
1902
+ * cpc: 0.75,
1903
+ * daily_cap: 500,
1904
+ * });
1905
+ * ```
1906
+ */
1907
+ update(accountId: string, campaignId: string, updates: UpdateCampaignRequest): Promise<Campaign>;
1908
+ /**
1909
+ * Delete a campaign
1910
+ *
1911
+ * @param accountId - Account ID
1912
+ * @param campaignId - Campaign ID
1913
+ *
1914
+ * @example
1915
+ * ```typescript
1916
+ * await client.campaigns.delete('my-account', '12345');
1917
+ * ```
1918
+ */
1919
+ delete(accountId: string, campaignId: string): Promise<void>;
1920
+ /**
1921
+ * Duplicate a campaign
1922
+ *
1923
+ * Creates a copy of an existing campaign with a new name.
1924
+ *
1925
+ * @param accountId - Account ID
1926
+ * @param campaignId - Campaign ID to duplicate
1927
+ * @param newName - Name for the new campaign
1928
+ *
1929
+ * @example
1930
+ * ```typescript
1931
+ * const newCampaign = await client.campaigns.duplicate(
1932
+ * 'my-account',
1933
+ * '12345',
1934
+ * 'My Campaign - Copy'
1935
+ * );
1936
+ * ```
1937
+ */
1938
+ duplicate(accountId: string, campaignId: string, newName: string): Promise<Campaign>;
1939
+ /**
1940
+ * Pause a campaign
1941
+ *
1942
+ * @param accountId - Account ID
1943
+ * @param campaignId - Campaign ID
1944
+ *
1945
+ * @example
1946
+ * ```typescript
1947
+ * await client.campaigns.pause('my-account', '12345');
1948
+ * ```
1949
+ */
1950
+ pause(accountId: string, campaignId: string): Promise<Campaign>;
1951
+ /**
1952
+ * Unpause (resume) a campaign
1953
+ *
1954
+ * @param accountId - Account ID
1955
+ * @param campaignId - Campaign ID
1956
+ *
1957
+ * @example
1958
+ * ```typescript
1959
+ * await client.campaigns.unpause('my-account', '12345');
1960
+ * ```
1961
+ */
1962
+ unpause(accountId: string, campaignId: string): Promise<Campaign>;
1963
+ /**
1964
+ * Bulk update multiple campaigns
1965
+ *
1966
+ * @param accountId - Account ID
1967
+ * @param updates - Array of campaign updates
1968
+ *
1969
+ * @example
1970
+ * ```typescript
1971
+ * await client.campaigns.bulkUpdate('my-account', {
1972
+ * campaigns: [
1973
+ * { campaign_id: '12345', update: { is_active: false } },
1974
+ * { campaign_id: '12346', update: { is_active: false } },
1975
+ * ],
1976
+ * });
1977
+ * ```
1978
+ */
1979
+ bulkUpdate(accountId: string, updates: BulkCampaignUpdateRequest): Promise<CampaignListResponse>;
1980
+ /**
1981
+ * Patch a campaign collection (targeting, bid modifiers, etc.)
1982
+ *
1983
+ * @param accountId - Account ID
1984
+ * @param campaignId - Campaign ID
1985
+ * @param collection - Collection name (e.g., 'publisher_targeting')
1986
+ * @param patches - Patch operations
1987
+ *
1988
+ * @example
1989
+ * ```typescript
1990
+ * await client.campaigns.patch('my-account', '12345', 'publisher_targeting', [
1991
+ * { op: 'ADD', path: '/value', value: ['pub-123'] },
1992
+ * ]);
1993
+ * ```
1994
+ */
1995
+ patch(accountId: string, campaignId: string, collection: string, patches: CampaignPatchRequest[]): Promise<Campaign>;
1996
+ /**
1997
+ * Get all campaigns across a network
1998
+ *
1999
+ * @param networkAccountId - Network account ID
2000
+ *
2001
+ * @example
2002
+ * ```typescript
2003
+ * const { results } = await client.campaigns.listNetwork('my-network');
2004
+ * ```
2005
+ */
2006
+ listNetwork(networkAccountId: string): Promise<CampaignListResponse>;
2007
+ /**
2008
+ * Estimate campaign reach
2009
+ *
2010
+ * Get estimated impressions, clicks, and reach for a campaign configuration.
2011
+ *
2012
+ * @param accountId - Account ID
2013
+ * @param params - Targeting and budget parameters
2014
+ *
2015
+ * @example
2016
+ * ```typescript
2017
+ * const estimate = await client.campaigns.estimateReach('my-account', {
2018
+ * country_targeting: ['US'],
2019
+ * platform_targeting: ['DESK', 'PHON'],
2020
+ * daily_cap: 100,
2021
+ * cpc: 0.50,
2022
+ * });
2023
+ * console.log('Estimated clicks:', estimate.estimated_clicks);
2024
+ * ```
2025
+ */
2026
+ estimateReach(accountId: string, params: CampaignReachEstimatorRequest): Promise<CampaignReachEstimatorResponse>;
2027
+ }
2028
+
2029
+ /**
2030
+ * Campaign Items (Ads) API for Taboola Backstage
2031
+ */
2032
+
2033
+ /**
2034
+ * Options for listing campaign items
2035
+ */
2036
+ interface ListItemsOptions {
2037
+ /** Page number (1-indexed) */
2038
+ page?: number;
2039
+ /** Number of results per page */
2040
+ pageSize?: number;
2041
+ /** Filter by status */
2042
+ status?: string;
2043
+ /** Filter by approval state */
2044
+ approvalState?: string;
2045
+ }
2046
+ /**
2047
+ * Campaign Items (Ads) management API
2048
+ */
2049
+ declare class ItemsAPI {
2050
+ private readonly http;
2051
+ constructor(http: HttpClient);
2052
+ /**
2053
+ * List all items for a campaign
2054
+ *
2055
+ * @param accountId - Account ID
2056
+ * @param campaignId - Campaign ID
2057
+ * @param options - Pagination and filter options
2058
+ *
2059
+ * @example
2060
+ * ```typescript
2061
+ * const { results } = await client.items.list('my-account', '12345');
2062
+ * for (const item of results) {
2063
+ * console.log(item.title, item.status);
2064
+ * }
2065
+ * ```
2066
+ */
2067
+ list(accountId: string, campaignId: string, options?: ListItemsOptions): Promise<CampaignItemListResponse>;
2068
+ /**
2069
+ * Get a single item by ID
2070
+ *
2071
+ * @param accountId - Account ID
2072
+ * @param campaignId - Campaign ID
2073
+ * @param itemId - Item ID
2074
+ *
2075
+ * @example
2076
+ * ```typescript
2077
+ * const item = await client.items.get('my-account', '12345', '67890');
2078
+ * console.log(item.title, item.url);
2079
+ * ```
2080
+ */
2081
+ get(accountId: string, campaignId: string, itemId: string): Promise<CampaignItem>;
2082
+ /**
2083
+ * Create a new item (ad) in a campaign
2084
+ *
2085
+ * @param accountId - Account ID
2086
+ * @param campaignId - Campaign ID
2087
+ * @param item - Item data
2088
+ *
2089
+ * @example
2090
+ * ```typescript
2091
+ * const item = await client.items.create('my-account', '12345', {
2092
+ * url: 'https://example.com/landing-page',
2093
+ * title: 'Check Out Our Amazing Product!',
2094
+ * thumbnail_url: 'https://example.com/image.jpg',
2095
+ * description: 'Learn more about our product',
2096
+ * cta: { cta_type: 'LEARN_MORE' },
2097
+ * });
2098
+ * console.log('Created item:', item.id);
2099
+ * ```
2100
+ */
2101
+ create(accountId: string, campaignId: string, item: CreateItemRequest): Promise<CampaignItem>;
2102
+ /**
2103
+ * Update an existing item
2104
+ *
2105
+ * @param accountId - Account ID
2106
+ * @param campaignId - Campaign ID
2107
+ * @param itemId - Item ID
2108
+ * @param updates - Fields to update
2109
+ *
2110
+ * @example
2111
+ * ```typescript
2112
+ * const item = await client.items.update('my-account', '12345', '67890', {
2113
+ * title: 'Updated Title!',
2114
+ * is_active: true,
2115
+ * });
2116
+ * ```
2117
+ */
2118
+ update(accountId: string, campaignId: string, itemId: string, updates: UpdateItemRequest): Promise<CampaignItem>;
2119
+ /**
2120
+ * Delete an item from a campaign
2121
+ *
2122
+ * @param accountId - Account ID
2123
+ * @param campaignId - Campaign ID
2124
+ * @param itemId - Item ID
2125
+ *
2126
+ * @example
2127
+ * ```typescript
2128
+ * await client.items.delete('my-account', '12345', '67890');
2129
+ * ```
2130
+ */
2131
+ delete(accountId: string, campaignId: string, itemId: string): Promise<void>;
2132
+ /**
2133
+ * Pause an item
2134
+ *
2135
+ * @param accountId - Account ID
2136
+ * @param campaignId - Campaign ID
2137
+ * @param itemId - Item ID
2138
+ *
2139
+ * @example
2140
+ * ```typescript
2141
+ * await client.items.pause('my-account', '12345', '67890');
2142
+ * ```
2143
+ */
2144
+ pause(accountId: string, campaignId: string, itemId: string): Promise<CampaignItem>;
2145
+ /**
2146
+ * Unpause (resume) an item
2147
+ *
2148
+ * @param accountId - Account ID
2149
+ * @param campaignId - Campaign ID
2150
+ * @param itemId - Item ID
2151
+ *
2152
+ * @example
2153
+ * ```typescript
2154
+ * await client.items.unpause('my-account', '12345', '67890');
2155
+ * ```
2156
+ */
2157
+ unpause(accountId: string, campaignId: string, itemId: string): Promise<CampaignItem>;
2158
+ /**
2159
+ * Create multiple items at once (mass create)
2160
+ *
2161
+ * @param accountId - Account ID
2162
+ * @param campaignId - Campaign ID
2163
+ * @param items - Array of items to create
2164
+ *
2165
+ * @example
2166
+ * ```typescript
2167
+ * const response = await client.items.bulkCreate('my-account', '12345', {
2168
+ * items: [
2169
+ * { url: 'https://example.com/page1', title: 'Title 1', thumbnail_url: '...' },
2170
+ * { url: 'https://example.com/page2', title: 'Title 2', thumbnail_url: '...' },
2171
+ * ],
2172
+ * });
2173
+ * console.log('Created', response.results.length, 'items');
2174
+ * ```
2175
+ */
2176
+ bulkCreate(accountId: string, campaignId: string, request: BulkCreateItemsRequest): Promise<BulkCreateItemsResponse>;
2177
+ /**
2178
+ * Bulk create items across multiple campaigns
2179
+ *
2180
+ * @param accountId - Account ID
2181
+ * @param items - Array of items with campaign IDs
2182
+ *
2183
+ * @example
2184
+ * ```typescript
2185
+ * await client.items.bulkCreateAcrossCampaigns('my-account', [
2186
+ * { campaign_id: '12345', url: '...', title: '...' },
2187
+ * { campaign_id: '12346', url: '...', title: '...' },
2188
+ * ]);
2189
+ * ```
2190
+ */
2191
+ bulkCreateAcrossCampaigns(accountId: string, items: (CreateItemRequest & {
2192
+ campaign_id: string;
2193
+ })[]): Promise<BulkCreateItemsResponse>;
2194
+ /**
2195
+ * Bulk update items across multiple campaigns
2196
+ *
2197
+ * @param accountId - Account ID
2198
+ * @param request - Bulk update request
2199
+ *
2200
+ * @example
2201
+ * ```typescript
2202
+ * await client.items.bulkUpdate('my-account', {
2203
+ * items: [
2204
+ * { id: '67890', campaign_id: '12345', update: { is_active: false } },
2205
+ * { id: '67891', campaign_id: '12346', update: { is_active: false } },
2206
+ * ],
2207
+ * });
2208
+ * ```
2209
+ */
2210
+ bulkUpdate(accountId: string, request: BulkUpdateItemsRequest): Promise<CampaignItemListResponse>;
2211
+ /**
2212
+ * Bulk delete items across multiple campaigns
2213
+ *
2214
+ * @param accountId - Account ID
2215
+ * @param request - Bulk delete request
2216
+ *
2217
+ * @example
2218
+ * ```typescript
2219
+ * await client.items.bulkDelete('my-account', {
2220
+ * items: [
2221
+ * { id: '67890', campaign_id: '12345' },
2222
+ * { id: '67891', campaign_id: '12346' },
2223
+ * ],
2224
+ * });
2225
+ * ```
2226
+ */
2227
+ bulkDelete(accountId: string, request: BulkDeleteItemsRequest): Promise<void>;
2228
+ /**
2229
+ * Get children of an RSS item
2230
+ *
2231
+ * @param accountId - Account ID
2232
+ * @param campaignId - Campaign ID
2233
+ * @param itemId - Parent RSS item ID
2234
+ *
2235
+ * @example
2236
+ * ```typescript
2237
+ * const { results } = await client.items.listRSSChildren('my-account', '12345', '67890');
2238
+ * ```
2239
+ */
2240
+ listRSSChildren(accountId: string, campaignId: string, itemId: string): Promise<RSSChildrenListResponse>;
2241
+ /**
2242
+ * Get a specific RSS child item
2243
+ *
2244
+ * @param accountId - Account ID
2245
+ * @param campaignId - Campaign ID
2246
+ * @param itemId - Parent RSS item ID
2247
+ * @param childId - Child item ID
2248
+ */
2249
+ getRSSChild(accountId: string, campaignId: string, itemId: string, childId: string): Promise<RSSChildItem>;
2250
+ /**
2251
+ * Update an RSS child item
2252
+ *
2253
+ * @param accountId - Account ID
2254
+ * @param campaignId - Campaign ID
2255
+ * @param itemId - Parent RSS item ID
2256
+ * @param childId - Child item ID
2257
+ * @param updates - Fields to update
2258
+ */
2259
+ updateRSSChild(accountId: string, campaignId: string, itemId: string, childId: string, updates: UpdateItemRequest): Promise<RSSChildItem>;
2260
+ }
2261
+
2262
+ /**
2263
+ * Dictionary API
2264
+ *
2265
+ * Reference data and enum values for the Taboola Backstage API.
2266
+ * Provides lists of countries, platforms, operating systems, browsers,
2267
+ * audience segments, and other reference data needed for targeting.
2268
+ */
2269
+
2270
+ /**
2271
+ * Dictionary API for reference data
2272
+ */
2273
+ declare class DictionaryAPI {
2274
+ private readonly http;
2275
+ constructor(http: HttpClient);
2276
+ /**
2277
+ * Get list of all supported countries
2278
+ */
2279
+ getCountries(): Promise<Country[]>;
2280
+ /**
2281
+ * Get regions/states within a country
2282
+ *
2283
+ * @param countryCode - Country code (e.g., 'US', 'GB')
2284
+ */
2285
+ getRegions(countryCode: string): Promise<Region[]>;
2286
+ /**
2287
+ * Get DMAs (Designated Market Areas) for a country
2288
+ * Note: Only available for US
2289
+ *
2290
+ * @param countryCode - Country code (typically 'US')
2291
+ */
2292
+ getDMAs(countryCode: string): Promise<DMA[]>;
2293
+ /**
2294
+ * Get postal codes for a country
2295
+ *
2296
+ * @param countryCode - Country code (e.g., 'US', 'GB')
2297
+ * @param params - Optional search and pagination parameters
2298
+ */
2299
+ getPostalCodes(countryCode: string, params?: PostalCodeSearchParams): Promise<PostalCode[]>;
2300
+ /**
2301
+ * Get list of supported platforms
2302
+ */
2303
+ getPlatforms(): Promise<Platform[]>;
2304
+ /**
2305
+ * Get list of supported operating systems
2306
+ */
2307
+ getOperatingSystems(): Promise<OperatingSystemInfo[]>;
2308
+ /**
2309
+ * Get list of iOS versions for targeting
2310
+ */
2311
+ getIOSVersions(): Promise<OSVersion[]>;
2312
+ /**
2313
+ * Get list of Android versions for targeting
2314
+ */
2315
+ getAndroidVersions(): Promise<OSVersion[]>;
2316
+ /**
2317
+ * Get list of supported browsers
2318
+ */
2319
+ getBrowsers(): Promise<Browser[]>;
2320
+ /**
2321
+ * Get campaign property enums (statuses, bid strategies, etc.)
2322
+ */
2323
+ getCampaignEnums(): Promise<CampaignEnums>;
2324
+ /**
2325
+ * Get item property enums (statuses, types, etc.)
2326
+ */
2327
+ getItemEnums(): Promise<ItemEnums>;
2328
+ /**
2329
+ * Get days of week for activity scheduling
2330
+ */
2331
+ getDaysOfWeek(): Promise<DayOfWeek[]>;
2332
+ /**
2333
+ * Get possible values for campaign category
2334
+ */
2335
+ getCampaignCategories(): Promise<string[]>;
2336
+ /**
2337
+ * Get possible values for item status
2338
+ */
2339
+ getItemStatuses(): Promise<string[]>;
2340
+ /**
2341
+ * Get possible values for item CTA (call-to-action)
2342
+ */
2343
+ getItemCTAs(): Promise<string[]>;
2344
+ /**
2345
+ * Get minimum CPC values per country/platform
2346
+ */
2347
+ getMinimumCPCs(): Promise<MinimumCPC[]>;
2348
+ /**
2349
+ * Get supported languages for image library search
2350
+ */
2351
+ getImageLibraryLanguages(): Promise<ImageLibraryLanguage[]>;
2352
+ /**
2353
+ * Get image taxonomies for categorizing images
2354
+ *
2355
+ * @param accountId - Account ID
2356
+ */
2357
+ getImageTaxonomies(accountId: string): Promise<ImageTaxonomy[]>;
2358
+ /**
2359
+ * Get marketplace audience segments available for targeting
2360
+ *
2361
+ * @param accountId - Account ID
2362
+ */
2363
+ getMarketplaceAudiences(accountId: string): Promise<MarketplaceAudience[]>;
2364
+ /**
2365
+ * Get marketplace audience segments for a specific country
2366
+ *
2367
+ * @param accountId - Account ID
2368
+ * @param countryCode - Country code (e.g., 'US', 'GB')
2369
+ */
2370
+ getMarketplaceAudiencesByCountry(accountId: string, countryCode: string): Promise<MarketplaceAudience[]>;
2371
+ /**
2372
+ * Get lookalike audiences available for targeting
2373
+ *
2374
+ * @param accountId - Account ID
2375
+ */
2376
+ getLookalikeAudiences(accountId: string): Promise<LookalikeAudience[]>;
2377
+ /**
2378
+ * Get lookalike audiences for a specific country
2379
+ *
2380
+ * @param accountId - Account ID
2381
+ * @param countryCode - Country code (e.g., 'US', 'GB')
2382
+ */
2383
+ getLookalikeAudiencesByCountry(accountId: string, countryCode: string): Promise<LookalikeAudience[]>;
2384
+ /**
2385
+ * Get contextual segments available for targeting
2386
+ *
2387
+ * @param accountId - Account ID
2388
+ */
2389
+ getContextualSegments(accountId: string): Promise<ContextualSegment[]>;
2390
+ }
2391
+
2392
+ /**
2393
+ * Publishers API
2394
+ *
2395
+ * Manage publisher targeting and blocking for Taboola campaigns.
2396
+ * Allows listing available publishers and managing blocked publishers
2397
+ * at the account level.
2398
+ */
2399
+
2400
+ /**
2401
+ * Publishers API for managing publisher targeting
2402
+ */
2403
+ declare class PublishersAPI {
2404
+ private readonly http;
2405
+ constructor(http: HttpClient);
2406
+ /**
2407
+ * List all available publishers for an account
2408
+ *
2409
+ * @param accountId - Account ID
2410
+ * @returns List of publishers with blocking status
2411
+ *
2412
+ * @example
2413
+ * ```typescript
2414
+ * const publishers = await client.publishers.list('my-account');
2415
+ * console.log(`Found ${publishers.length} publishers`);
2416
+ * ```
2417
+ */
2418
+ list(accountId: string): Promise<Publisher[]>;
2419
+ /**
2420
+ * Get blocked publishers at the account level
2421
+ *
2422
+ * @param accountId - Account ID
2423
+ * @returns List of blocked publishers
2424
+ *
2425
+ * @example
2426
+ * ```typescript
2427
+ * const blocked = await client.publishers.getBlocked('my-account');
2428
+ * console.log(`${blocked.length} publishers blocked at account level`);
2429
+ * ```
2430
+ */
2431
+ getBlocked(accountId: string): Promise<BlockedPublisher[]>;
2432
+ /**
2433
+ * Update blocked publishers at the account level
2434
+ *
2435
+ * This replaces the current list of blocked publishers with the
2436
+ * provided list. To add to existing blocks, first get the current
2437
+ * list and append.
2438
+ *
2439
+ * @param accountId - Account ID
2440
+ * @param sites - Array of site names to block
2441
+ * @returns Updated list of blocked publishers
2442
+ *
2443
+ * @example
2444
+ * ```typescript
2445
+ * // Block specific publishers
2446
+ * await client.publishers.updateBlocked('my-account', {
2447
+ * sites: ['site1.com', 'site2.com']
2448
+ * });
2449
+ *
2450
+ * // Add to existing blocks
2451
+ * const current = await client.publishers.getBlocked('my-account');
2452
+ * const currentSites = current.map(p => p.site);
2453
+ * await client.publishers.updateBlocked('my-account', {
2454
+ * sites: [...currentSites, 'newsite.com']
2455
+ * });
2456
+ * ```
2457
+ */
2458
+ updateBlocked(accountId: string, request: UpdateBlockedPublishersRequest): Promise<BlockedPublisher[]>;
2459
+ /**
2460
+ * Block a single publisher at the account level
2461
+ *
2462
+ * Convenience method that adds a publisher to the existing block list.
2463
+ *
2464
+ * @param accountId - Account ID
2465
+ * @param site - Site name to block
2466
+ * @returns Updated list of blocked publishers
2467
+ */
2468
+ blockPublisher(accountId: string, site: string): Promise<BlockedPublisher[]>;
2469
+ /**
2470
+ * Unblock a single publisher at the account level
2471
+ *
2472
+ * Convenience method that removes a publisher from the block list.
2473
+ *
2474
+ * @param accountId - Account ID
2475
+ * @param site - Site name to unblock
2476
+ * @returns Updated list of blocked publishers
2477
+ */
2478
+ unblockPublisher(accountId: string, site: string): Promise<BlockedPublisher[]>;
2479
+ /**
2480
+ * Clear all blocked publishers at the account level
2481
+ *
2482
+ * @param accountId - Account ID
2483
+ * @returns Empty list
2484
+ */
2485
+ clearBlocked(accountId: string): Promise<BlockedPublisher[]>;
2486
+ }
2487
+
2488
+ /**
2489
+ * Targeting API
2490
+ *
2491
+ * Manage campaign-level targeting including postal codes,
2492
+ * audience segments (marketplace, custom, lookalike), and
2493
+ * contextual targeting.
2494
+ */
2495
+
2496
+ /**
2497
+ * Targeting API for campaign-level targeting configuration
2498
+ */
2499
+ declare class TargetingAPI {
2500
+ private readonly http;
2501
+ constructor(http: HttpClient);
2502
+ /**
2503
+ * Get postal code targeting for a campaign
2504
+ *
2505
+ * @param accountId - Account ID
2506
+ * @param campaignId - Campaign ID
2507
+ * @returns Postal code targeting configuration
2508
+ *
2509
+ * @example
2510
+ * ```typescript
2511
+ * const targeting = await client.targeting.getPostalCodes('my-account', '12345');
2512
+ * console.log(`Targeting type: ${targeting.type}`);
2513
+ * console.log(`Postal codes: ${targeting.values.length}`);
2514
+ * ```
2515
+ */
2516
+ getPostalCodes(accountId: string, campaignId: string): Promise<PostalCodeTargeting>;
2517
+ /**
2518
+ * Update postal code targeting for a campaign
2519
+ *
2520
+ * @param accountId - Account ID
2521
+ * @param campaignId - Campaign ID
2522
+ * @param targeting - Postal code targeting configuration
2523
+ * @returns Updated targeting configuration
2524
+ *
2525
+ * @example
2526
+ * ```typescript
2527
+ * await client.targeting.updatePostalCodes('my-account', '12345', {
2528
+ * type: 'INCLUDE',
2529
+ * values: [
2530
+ * { postal_code: '10001', country: 'US' },
2531
+ * { postal_code: '10002', country: 'US' },
2532
+ * ]
2533
+ * });
2534
+ * ```
2535
+ */
2536
+ updatePostalCodes(accountId: string, campaignId: string, targeting: UpdatePostalCodeTargetingRequest): Promise<PostalCodeTargeting>;
2537
+ /**
2538
+ * Get marketplace audience targeting for a campaign
2539
+ *
2540
+ * Marketplace audiences are third-party audience segments
2541
+ * available for targeting through Taboola's marketplace.
2542
+ *
2543
+ * @param accountId - Account ID
2544
+ * @param campaignId - Campaign ID
2545
+ * @returns Audience targeting configuration
2546
+ */
2547
+ getMarketplaceAudiences(accountId: string, campaignId: string): Promise<AudienceTargeting>;
2548
+ /**
2549
+ * Update marketplace audience targeting for a campaign
2550
+ *
2551
+ * @param accountId - Account ID
2552
+ * @param campaignId - Campaign ID
2553
+ * @param targeting - Audience targeting configuration
2554
+ * @returns Updated targeting configuration
2555
+ *
2556
+ * @example
2557
+ * ```typescript
2558
+ * await client.targeting.updateMarketplaceAudiences('my-account', '12345', {
2559
+ * type: 'INCLUDE',
2560
+ * collection: [
2561
+ * { id: 'segment-1', name: null },
2562
+ * { id: 'segment-2', name: null },
2563
+ * ]
2564
+ * });
2565
+ * ```
2566
+ */
2567
+ updateMarketplaceAudiences(accountId: string, campaignId: string, targeting: UpdateAudienceTargetingRequest): Promise<AudienceTargeting>;
2568
+ /**
2569
+ * Get custom audience targeting for a campaign
2570
+ *
2571
+ * Custom audiences are audiences created from pixel data
2572
+ * or uploaded lists.
2573
+ *
2574
+ * @param accountId - Account ID
2575
+ * @param campaignId - Campaign ID
2576
+ * @returns Audience targeting configuration
2577
+ */
2578
+ getCustomAudiences(accountId: string, campaignId: string): Promise<AudienceTargeting>;
2579
+ /**
2580
+ * Update custom audience targeting for a campaign
2581
+ *
2582
+ * @param accountId - Account ID
2583
+ * @param campaignId - Campaign ID
2584
+ * @param targeting - Audience targeting configuration
2585
+ * @returns Updated targeting configuration
2586
+ */
2587
+ updateCustomAudiences(accountId: string, campaignId: string, targeting: UpdateAudienceTargetingRequest): Promise<AudienceTargeting>;
2588
+ /**
2589
+ * Get lookalike audience targeting for a campaign
2590
+ *
2591
+ * Lookalike audiences are modeled after your existing
2592
+ * custom audiences to find similar users.
2593
+ *
2594
+ * @param accountId - Account ID
2595
+ * @param campaignId - Campaign ID
2596
+ * @returns Audience targeting configuration
2597
+ */
2598
+ getLookalikeAudiences(accountId: string, campaignId: string): Promise<AudienceTargeting>;
2599
+ /**
2600
+ * Update lookalike audience targeting for a campaign
2601
+ *
2602
+ * @param accountId - Account ID
2603
+ * @param campaignId - Campaign ID
2604
+ * @param targeting - Audience targeting configuration
2605
+ * @returns Updated targeting configuration
2606
+ */
2607
+ updateLookalikeAudiences(accountId: string, campaignId: string, targeting: UpdateAudienceTargetingRequest): Promise<AudienceTargeting>;
2608
+ /**
2609
+ * Get contextual targeting for a campaign
2610
+ *
2611
+ * Contextual targeting allows you to target based on the
2612
+ * content of the pages where your ads appear.
2613
+ *
2614
+ * @param accountId - Account ID
2615
+ * @param campaignId - Campaign ID
2616
+ * @returns Contextual targeting configuration
2617
+ */
2618
+ getContextual(accountId: string, campaignId: string): Promise<ContextualTargeting>;
2619
+ /**
2620
+ * Update contextual targeting for a campaign
2621
+ *
2622
+ * @param accountId - Account ID
2623
+ * @param campaignId - Campaign ID
2624
+ * @param targeting - Contextual targeting configuration
2625
+ * @returns Updated targeting configuration
2626
+ *
2627
+ * @example
2628
+ * ```typescript
2629
+ * await client.targeting.updateContextual('my-account', '12345', {
2630
+ * type: 'INCLUDE',
2631
+ * collection: [
2632
+ * { id: 'context-1', name: null },
2633
+ * { id: 'context-2', name: null },
2634
+ * ]
2635
+ * });
2636
+ * ```
2637
+ */
2638
+ updateContextual(accountId: string, campaignId: string, targeting: UpdateContextualTargetingRequest): Promise<ContextualTargeting>;
2639
+ /**
2640
+ * Get first party audience targeting for a campaign
2641
+ *
2642
+ * First party audiences are your own uploaded audience data.
2643
+ *
2644
+ * @param accountId - Account ID
2645
+ * @param campaignId - Campaign ID
2646
+ * @returns First party audience targeting configuration
2647
+ */
2648
+ getFirstPartyAudiences(accountId: string, campaignId: string): Promise<FirstPartyAudienceTargeting>;
2649
+ /**
2650
+ * Update first party audience targeting for a campaign
2651
+ *
2652
+ * @param accountId - Account ID
2653
+ * @param campaignId - Campaign ID
2654
+ * @param targeting - First party audience targeting configuration
2655
+ * @returns Updated targeting configuration
2656
+ */
2657
+ updateFirstPartyAudiences(accountId: string, campaignId: string, targeting: UpdateFirstPartyAudienceTargetingRequest): Promise<FirstPartyAudienceTargeting>;
2658
+ }
2659
+
2660
+ /**
2661
+ * Combined Audiences API
2662
+ *
2663
+ * Manage combined audiences that combine multiple audience types
2664
+ * (custom, lookalike, marketplace, first-party) with AND/OR logic.
2665
+ */
2666
+
2667
+ /**
2668
+ * Combined Audiences API for managing combined audiences
2669
+ */
2670
+ declare class CombinedAudiencesAPI {
2671
+ private readonly http;
2672
+ constructor(http: HttpClient);
2673
+ /**
2674
+ * List available audiences for combining
2675
+ *
2676
+ * Returns all audiences that can be used in combined audience rules,
2677
+ * including custom, lookalike, marketplace, and first-party audiences.
2678
+ *
2679
+ * @param accountId - Account ID
2680
+ * @returns List of available audiences
2681
+ *
2682
+ * @example
2683
+ * ```typescript
2684
+ * const available = await client.combinedAudiences.listAvailable('my-account');
2685
+ * console.log(`${available.length} audiences available for combining`);
2686
+ * ```
2687
+ */
2688
+ listAvailable(accountId: string): Promise<AvailableAudience[]>;
2689
+ /**
2690
+ * List all combined audiences
2691
+ *
2692
+ * @param accountId - Account ID
2693
+ * @returns List of combined audiences
2694
+ *
2695
+ * @example
2696
+ * ```typescript
2697
+ * const audiences = await client.combinedAudiences.list('my-account');
2698
+ * for (const audience of audiences) {
2699
+ * console.log(`${audience.name}: ${audience.status}`);
2700
+ * }
2701
+ * ```
2702
+ */
2703
+ list(accountId: string): Promise<CombinedAudience[]>;
2704
+ /**
2705
+ * Get a single combined audience
2706
+ *
2707
+ * @param accountId - Account ID
2708
+ * @param audienceId - Combined audience ID
2709
+ * @returns Combined audience details
2710
+ */
2711
+ get(accountId: string, audienceId: string): Promise<CombinedAudience>;
2712
+ /**
2713
+ * Create a combined audience
2714
+ *
2715
+ * @param accountId - Account ID
2716
+ * @param audience - Combined audience configuration
2717
+ * @returns Created combined audience
2718
+ *
2719
+ * @example
2720
+ * ```typescript
2721
+ * const audience = await client.combinedAudiences.create('my-account', {
2722
+ * name: 'High-Value Engaged Users',
2723
+ * description: 'Users who are both high-value and engaged',
2724
+ * include_rules: [
2725
+ * {
2726
+ * audience_type: 'CUSTOM_AUDIENCE',
2727
+ * audiences: [{ id: 'custom-1', name: null }]
2728
+ * },
2729
+ * {
2730
+ * audience_type: 'LOOKALIKE_AUDIENCE',
2731
+ * audiences: [{ id: 'lookalike-1', name: null }]
2732
+ * }
2733
+ * ],
2734
+ * exclude_rules: [
2735
+ * {
2736
+ * audience_type: 'CUSTOM_AUDIENCE',
2737
+ * audiences: [{ id: 'converters', name: null }]
2738
+ * }
2739
+ * ]
2740
+ * });
2741
+ * ```
2742
+ */
2743
+ create(accountId: string, audience: CreateCombinedAudienceRequest): Promise<CombinedAudience>;
2744
+ /**
2745
+ * Update a combined audience
2746
+ *
2747
+ * @param accountId - Account ID
2748
+ * @param audienceId - Combined audience ID
2749
+ * @param updates - Fields to update
2750
+ * @returns Updated combined audience
2751
+ */
2752
+ update(accountId: string, audienceId: string, updates: UpdateCombinedAudienceRequest): Promise<CombinedAudience>;
2753
+ }
2754
+
2755
+ /**
2756
+ * First Party Audiences API
2757
+ *
2758
+ * Manage first party audience onboarding, allowing you to upload
2759
+ * your own customer data (email, phone, device IDs) for targeting.
2760
+ */
2761
+
2762
+ /**
2763
+ * First Party Audiences API for audience onboarding
2764
+ */
2765
+ declare class FirstPartyAudiencesAPI {
2766
+ private readonly http;
2767
+ constructor(http: HttpClient);
2768
+ /**
2769
+ * List all first party audiences
2770
+ *
2771
+ * @param accountId - Account ID
2772
+ * @returns List of first party audiences
2773
+ *
2774
+ * @example
2775
+ * ```typescript
2776
+ * const audiences = await client.firstPartyAudiences.list('my-account');
2777
+ * for (const audience of audiences) {
2778
+ * console.log(`${audience.name}: ${audience.status} (${audience.size} users)`);
2779
+ * }
2780
+ * ```
2781
+ */
2782
+ list(accountId: string): Promise<FirstPartyAudience[]>;
2783
+ /**
2784
+ * Get a single first party audience
2785
+ *
2786
+ * @param accountId - Account ID
2787
+ * @param audienceId - Audience ID
2788
+ * @returns First party audience details
2789
+ */
2790
+ get(accountId: string, audienceId: string): Promise<FirstPartyAudience>;
2791
+ /**
2792
+ * Create a first party audience
2793
+ *
2794
+ * After creation, use addUsers() to populate the audience with identifiers.
2795
+ *
2796
+ * @param accountId - Account ID
2797
+ * @param audience - Audience configuration
2798
+ * @returns Created audience
2799
+ *
2800
+ * @example
2801
+ * ```typescript
2802
+ * const audience = await client.firstPartyAudiences.create('my-account', {
2803
+ * name: 'High-Value Customers',
2804
+ * description: 'Customers with LTV > $1000',
2805
+ * source_type: 'CRM',
2806
+ * ttl_days: 90
2807
+ * });
2808
+ *
2809
+ * // Then add users
2810
+ * await client.firstPartyAudiences.addUsers('my-account', audience.id, {
2811
+ * add: [
2812
+ * { identifier_type: 'EMAIL_SHA256', identifier_value: 'sha256hash1' },
2813
+ * { identifier_type: 'EMAIL_SHA256', identifier_value: 'sha256hash2' },
2814
+ * ]
2815
+ * });
2816
+ * ```
2817
+ */
2818
+ create(accountId: string, audience: CreateFirstPartyAudienceRequest): Promise<FirstPartyAudience>;
2819
+ /**
2820
+ * Add or remove users from a first party audience
2821
+ *
2822
+ * Users are identified by hashed identifiers (email, phone, device ID).
2823
+ * It's recommended to use SHA256 hashed values for privacy.
2824
+ *
2825
+ * @param accountId - Account ID
2826
+ * @param audienceId - Audience ID
2827
+ * @param request - Add/remove request with user identifiers
2828
+ * @returns Operation result with counts
2829
+ *
2830
+ * @example
2831
+ * ```typescript
2832
+ * // Add users
2833
+ * const result = await client.firstPartyAudiences.addUsers('my-account', 'audience-1', {
2834
+ * add: [
2835
+ * { identifier_type: 'EMAIL_SHA256', identifier_value: 'sha256hash1' },
2836
+ * { identifier_type: 'EMAIL_SHA256', identifier_value: 'sha256hash2' },
2837
+ * ]
2838
+ * });
2839
+ * console.log(`Added ${result.added_count} users`);
2840
+ *
2841
+ * // Remove users
2842
+ * const result2 = await client.firstPartyAudiences.addUsers('my-account', 'audience-1', {
2843
+ * remove: [
2844
+ * { identifier_type: 'EMAIL_SHA256', identifier_value: 'sha256hash3' },
2845
+ * ]
2846
+ * });
2847
+ * console.log(`Removed ${result2.removed_count} users`);
2848
+ * ```
2849
+ */
2850
+ addUsers(accountId: string, audienceId: string, request: AddRemoveUsersRequest): Promise<AddRemoveUsersResponse>;
2851
+ /**
2852
+ * Remove users from a first party audience
2853
+ *
2854
+ * Convenience method that wraps addUsers with only remove operations.
2855
+ *
2856
+ * @param accountId - Account ID
2857
+ * @param audienceId - Audience ID
2858
+ * @param request - Remove request with user identifiers
2859
+ * @returns Operation result with counts
2860
+ */
2861
+ removeUsers(accountId: string, audienceId: string, request: Pick<AddRemoveUsersRequest, 'remove'>): Promise<AddRemoveUsersResponse>;
2862
+ }
2863
+
2864
+ /**
2865
+ * Pixel API
2866
+ *
2867
+ * Manage Taboola Universal Pixel conversion rules and custom audience rules.
2868
+ * Conversion rules track conversions on your site, while custom audience
2869
+ * rules build retargeting audiences based on pixel events.
2870
+ */
2871
+
2872
+ /**
2873
+ * Pixel API for managing conversion and custom audience rules
2874
+ */
2875
+ declare class PixelAPI {
2876
+ private readonly http;
2877
+ constructor(http: HttpClient);
2878
+ /**
2879
+ * List all conversion rules
2880
+ *
2881
+ * @param accountId - Account ID
2882
+ * @returns List of conversion rules
2883
+ *
2884
+ * @example
2885
+ * ```typescript
2886
+ * const rules = await client.pixel.listConversionRules('my-account');
2887
+ * for (const rule of rules) {
2888
+ * console.log(`${rule.display_name}: ${rule.status}`);
2889
+ * }
2890
+ * ```
2891
+ */
2892
+ listConversionRules(accountId: string): Promise<ConversionRule[]>;
2893
+ /**
2894
+ * Get a single conversion rule
2895
+ *
2896
+ * @param accountId - Account ID
2897
+ * @param ruleId - Conversion rule ID
2898
+ * @returns Conversion rule details
2899
+ */
2900
+ getConversionRule(accountId: string, ruleId: string): Promise<ConversionRule>;
2901
+ /**
2902
+ * List conversion rules with performance data
2903
+ *
2904
+ * Returns conversion rules with additional data like 30-day conversion
2905
+ * counts and values.
2906
+ *
2907
+ * @param accountId - Account ID
2908
+ * @returns List of conversion rules with data
2909
+ */
2910
+ listConversionRulesWithData(accountId: string): Promise<ConversionRuleWithData[]>;
2911
+ /**
2912
+ * Create a conversion rule
2913
+ *
2914
+ * @param accountId - Account ID
2915
+ * @param rule - Conversion rule configuration
2916
+ * @returns Created conversion rule
2917
+ *
2918
+ * @example
2919
+ * ```typescript
2920
+ * // URL-based conversion rule
2921
+ * const rule = await client.pixel.createConversionRule('my-account', {
2922
+ * display_name: 'Purchase Completed',
2923
+ * type: 'URL_BASED',
2924
+ * category: 'PURCHASE',
2925
+ * conditions: [
2926
+ * {
2927
+ * type: 'URL',
2928
+ * operator: 'CONTAINS',
2929
+ * value: '/thank-you'
2930
+ * }
2931
+ * ],
2932
+ * effect: {
2933
+ * type: 'DYNAMIC_VALUE',
2934
+ * value: null,
2935
+ * currency: 'USD',
2936
+ * value_parameter: 'order_total'
2937
+ * },
2938
+ * conversion_window_days: 30,
2939
+ * view_through_window_days: 1
2940
+ * });
2941
+ *
2942
+ * // Event-based conversion rule
2943
+ * const eventRule = await client.pixel.createConversionRule('my-account', {
2944
+ * display_name: 'Add to Cart',
2945
+ * type: 'EVENT_BASED',
2946
+ * category: 'ADD_TO_CART',
2947
+ * event_name: 'add_to_cart',
2948
+ * conditions: [],
2949
+ * effect: {
2950
+ * type: 'FIXED_VALUE',
2951
+ * value: 10,
2952
+ * currency: 'USD',
2953
+ * value_parameter: null
2954
+ * }
2955
+ * });
2956
+ * ```
2957
+ */
2958
+ createConversionRule(accountId: string, rule: CreateConversionRuleRequest): Promise<ConversionRule>;
2959
+ /**
2960
+ * Update a conversion rule
2961
+ *
2962
+ * @param accountId - Account ID
2963
+ * @param ruleId - Conversion rule ID
2964
+ * @param updates - Fields to update
2965
+ * @returns Updated conversion rule
2966
+ */
2967
+ updateConversionRule(accountId: string, ruleId: string, updates: UpdateConversionRuleRequest): Promise<ConversionRule>;
2968
+ /**
2969
+ * Archive a conversion rule
2970
+ *
2971
+ * Archived rules stop tracking conversions but remain in the account
2972
+ * for historical reporting.
2973
+ *
2974
+ * @param accountId - Account ID
2975
+ * @param ruleId - Conversion rule ID
2976
+ * @returns Archived conversion rule
2977
+ */
2978
+ archiveConversionRule(accountId: string, ruleId: string): Promise<ConversionRule>;
2979
+ /**
2980
+ * Unarchive a conversion rule
2981
+ *
2982
+ * Reactivates an archived conversion rule.
2983
+ *
2984
+ * @param accountId - Account ID
2985
+ * @param ruleId - Conversion rule ID
2986
+ * @returns Reactivated conversion rule
2987
+ */
2988
+ unarchiveConversionRule(accountId: string, ruleId: string): Promise<ConversionRule>;
2989
+ /**
2990
+ * List all custom audience rules
2991
+ *
2992
+ * Custom audience rules build retargeting audiences based on pixel
2993
+ * events and page visits.
2994
+ *
2995
+ * @param accountId - Account ID
2996
+ * @returns List of custom audience rules
2997
+ *
2998
+ * @example
2999
+ * ```typescript
3000
+ * const rules = await client.pixel.listCustomAudienceRules('my-account');
3001
+ * for (const rule of rules) {
3002
+ * console.log(`${rule.display_name}: ${rule.size} users`);
3003
+ * }
3004
+ * ```
3005
+ */
3006
+ listCustomAudienceRules(accountId: string): Promise<CustomAudienceRule[]>;
3007
+ /**
3008
+ * Get a single custom audience rule
3009
+ *
3010
+ * @param accountId - Account ID
3011
+ * @param ruleId - Custom audience rule ID
3012
+ * @returns Custom audience rule details
3013
+ */
3014
+ getCustomAudienceRule(accountId: string, ruleId: string): Promise<CustomAudienceRule>;
3015
+ /**
3016
+ * Create a custom audience rule
3017
+ *
3018
+ * @param accountId - Account ID
3019
+ * @param rule - Custom audience rule configuration
3020
+ * @returns Created custom audience rule
3021
+ *
3022
+ * @example
3023
+ * ```typescript
3024
+ * // All visitors audience
3025
+ * const allVisitors = await client.pixel.createCustomAudienceRule('my-account', {
3026
+ * display_name: 'All Visitors - 30 Days',
3027
+ * conditions: [],
3028
+ * ttl_days: 30
3029
+ * });
3030
+ *
3031
+ * // Product page visitors
3032
+ * const productViewers = await client.pixel.createCustomAudienceRule('my-account', {
3033
+ * display_name: 'Product Page Viewers',
3034
+ * conditions: [
3035
+ * {
3036
+ * type: 'URL',
3037
+ * operator: 'CONTAINS',
3038
+ * value: '/products/'
3039
+ * }
3040
+ * ],
3041
+ * ttl_days: 14
3042
+ * });
3043
+ *
3044
+ * // Cart abandoners
3045
+ * const cartAbandoners = await client.pixel.createCustomAudienceRule('my-account', {
3046
+ * display_name: 'Cart Abandoners',
3047
+ * conditions: [
3048
+ * {
3049
+ * type: 'EVENT_NAME',
3050
+ * operator: 'EQUALS',
3051
+ * value: 'add_to_cart'
3052
+ * }
3053
+ * ],
3054
+ * ttl_days: 7
3055
+ * });
3056
+ * ```
3057
+ */
3058
+ createCustomAudienceRule(accountId: string, rule: CreateCustomAudienceRuleRequest): Promise<CustomAudienceRule>;
3059
+ /**
3060
+ * Update a custom audience rule
3061
+ *
3062
+ * @param accountId - Account ID
3063
+ * @param ruleId - Custom audience rule ID
3064
+ * @param updates - Fields to update
3065
+ * @returns Updated custom audience rule
3066
+ */
3067
+ updateCustomAudienceRule(accountId: string, ruleId: string, updates: UpdateCustomAudienceRuleRequest): Promise<CustomAudienceRule>;
3068
+ /**
3069
+ * Pause a custom audience rule
3070
+ *
3071
+ * Paused rules stop adding new users but retain existing audience members.
3072
+ *
3073
+ * @param accountId - Account ID
3074
+ * @param ruleId - Custom audience rule ID
3075
+ * @returns Paused custom audience rule
3076
+ */
3077
+ pauseCustomAudienceRule(accountId: string, ruleId: string): Promise<CustomAudienceRule>;
3078
+ /**
3079
+ * Resume a paused custom audience rule
3080
+ *
3081
+ * @param accountId - Account ID
3082
+ * @param ruleId - Custom audience rule ID
3083
+ * @returns Resumed custom audience rule
3084
+ */
3085
+ resumeCustomAudienceRule(accountId: string, ruleId: string): Promise<CustomAudienceRule>;
3086
+ /**
3087
+ * Archive a custom audience rule
3088
+ *
3089
+ * Archived rules stop building and the audience becomes inaccessible
3090
+ * for targeting.
3091
+ *
3092
+ * @param accountId - Account ID
3093
+ * @param ruleId - Custom audience rule ID
3094
+ * @returns Archived custom audience rule
3095
+ */
3096
+ archiveCustomAudienceRule(accountId: string, ruleId: string): Promise<CustomAudienceRule>;
3097
+ }
3098
+
3099
+ /**
3100
+ * Reports API
3101
+ *
3102
+ * Access Taboola Backstage reporting data including Campaign Summary,
3103
+ * Top Campaign Content, and Realtime reports.
3104
+ */
3105
+
3106
+ /**
3107
+ * Reports API for accessing reporting data
3108
+ */
3109
+ declare class ReportsAPI {
3110
+ private readonly http;
3111
+ constructor(http: HttpClient);
3112
+ /**
3113
+ * Get Campaign Summary Report
3114
+ *
3115
+ * The Campaign Summary report provides aggregated performance metrics
3116
+ * across various dimensions like day, week, month, campaign, site, etc.
3117
+ *
3118
+ * @param accountId - Account ID
3119
+ * @param dimension - Report dimension (day, week, month, campaign, site, etc.)
3120
+ * @param params - Report parameters including date range and filters
3121
+ * @returns Campaign summary report with metrics
3122
+ *
3123
+ * @example
3124
+ * ```typescript
3125
+ * // Daily report for last 30 days
3126
+ * const report = await client.reports.campaignSummary('my-account', 'day', {
3127
+ * start_date: '2024-01-01',
3128
+ * end_date: '2024-01-31',
3129
+ * });
3130
+ *
3131
+ * for (const row of report.results) {
3132
+ * console.log(`${row.date}: ${row.clicks} clicks, $${row.spent} spent`);
3133
+ * }
3134
+ *
3135
+ * // Campaign-level report with conversion data
3136
+ * const campaignReport = await client.reports.campaignSummary('my-account', 'campaign', {
3137
+ * start_date: '2024-01-01',
3138
+ * end_date: '2024-01-31',
3139
+ * include_conversions: 'all',
3140
+ * });
3141
+ *
3142
+ * // Filtered by specific campaign
3143
+ * const filteredReport = await client.reports.campaignSummary('my-account', 'day', {
3144
+ * start_date: '2024-01-01',
3145
+ * end_date: '2024-01-31',
3146
+ * campaign: '12345',
3147
+ * });
3148
+ * ```
3149
+ */
3150
+ campaignSummary(accountId: string, dimension: ReportDimension, params: CampaignSummaryReportParams): Promise<CampaignSummaryReport>;
3151
+ /**
3152
+ * Get Top Campaign Content Report
3153
+ *
3154
+ * The Top Campaign Content report shows performance metrics for individual
3155
+ * items (ads) across campaigns.
3156
+ *
3157
+ * @param accountId - Account ID
3158
+ * @param params - Report parameters including date range and filters
3159
+ * @returns Top campaign content report with item metrics
3160
+ *
3161
+ * @example
3162
+ * ```typescript
3163
+ * const report = await client.reports.topCampaignContent('my-account', {
3164
+ * start_date: '2024-01-01',
3165
+ * end_date: '2024-01-31',
3166
+ * limit: 100,
3167
+ * });
3168
+ *
3169
+ * for (const item of report.results) {
3170
+ * console.log(`${item.item_name}: ${item.clicks} clicks, CTR: ${item.ctr}%`);
3171
+ * }
3172
+ * ```
3173
+ */
3174
+ topCampaignContent(accountId: string, params: TopCampaignContentReportParams): Promise<TopCampaignContentReport>;
3175
+ /**
3176
+ * Get Realtime Campaign Report
3177
+ *
3178
+ * The Realtime Campaign report shows current day performance metrics
3179
+ * for campaigns, updated frequently throughout the day.
3180
+ *
3181
+ * @param accountId - Account ID
3182
+ * @param params - Optional filter parameters
3183
+ * @returns Realtime campaign report
3184
+ *
3185
+ * @example
3186
+ * ```typescript
3187
+ * const report = await client.reports.realtimeCampaign('my-account');
3188
+ * console.log(`Data as of: ${report.timestamp}`);
3189
+ *
3190
+ * for (const campaign of report.results) {
3191
+ * console.log(`${campaign.campaign_name}: ${campaign.clicks} clicks today`);
3192
+ * }
3193
+ * ```
3194
+ */
3195
+ realtimeCampaign(accountId: string, params?: RealtimeReportParams): Promise<RealtimeCampaignReport>;
3196
+ /**
3197
+ * Get Realtime Ads Report
3198
+ *
3199
+ * The Realtime Ads report shows current day performance metrics
3200
+ * for individual items (ads), updated frequently throughout the day.
3201
+ *
3202
+ * @param accountId - Account ID
3203
+ * @param params - Optional filter parameters
3204
+ * @returns Realtime ads report
3205
+ *
3206
+ * @example
3207
+ * ```typescript
3208
+ * const report = await client.reports.realtimeAds('my-account');
3209
+ * console.log(`Data as of: ${report.timestamp}`);
3210
+ *
3211
+ * for (const ad of report.results) {
3212
+ * console.log(`${ad.item_name}: ${ad.clicks} clicks, ${ad.impressions} impressions`);
3213
+ * }
3214
+ * ```
3215
+ */
3216
+ realtimeAds(accountId: string, params?: RealtimeReportParams): Promise<RealtimeAdsReport>;
3217
+ }
3218
+
3219
+ /**
3220
+ * Taboola Backstage SDK Client
3221
+ *
3222
+ * Main entry point for the SDK. Creates and configures all API modules.
3223
+ */
3224
+
3225
+ /**
3226
+ * Taboola Backstage API Client
3227
+ *
3228
+ * The main client for interacting with the Taboola Backstage API.
3229
+ * Provides access to all API modules through namespaced properties.
3230
+ *
3231
+ * @example
3232
+ * ```typescript
3233
+ * import { TaboolaClient } from 'taboola-backstage-sdk';
3234
+ *
3235
+ * const client = new TaboolaClient({
3236
+ * clientId: 'your-client-id',
3237
+ * clientSecret: 'your-client-secret',
3238
+ * });
3239
+ *
3240
+ * // Get current account
3241
+ * const account = await client.accounts.getCurrent();
3242
+ * console.log('Account ID:', account.account_id);
3243
+ *
3244
+ * // List campaigns
3245
+ * const { results: campaigns } = await client.campaigns.list(account.account_id);
3246
+ * console.log('Found', campaigns.length, 'campaigns');
3247
+ *
3248
+ * // Create a new campaign
3249
+ * const campaign = await client.campaigns.create(account.account_id, {
3250
+ * name: 'My Campaign',
3251
+ * branding_text: 'My Brand',
3252
+ * cpc: 0.50,
3253
+ * spending_limit: 1000,
3254
+ * spending_limit_model: 'MONTHLY',
3255
+ * marketing_objective: 'DRIVE_WEBSITE_TRAFFIC',
3256
+ * });
3257
+ * ```
3258
+ */
3259
+ declare class TaboolaClient {
3260
+ /**
3261
+ * Account management API
3262
+ */
3263
+ readonly accounts: AccountsAPI;
3264
+ /**
3265
+ * Campaign management API
3266
+ */
3267
+ readonly campaigns: CampaignsAPI;
3268
+ /**
3269
+ * Campaign items (ads) management API
3270
+ */
3271
+ readonly items: ItemsAPI;
3272
+ /**
3273
+ * Dictionary/reference data API
3274
+ */
3275
+ readonly dictionary: DictionaryAPI;
3276
+ /**
3277
+ * Publishers management API
3278
+ */
3279
+ readonly publishers: PublishersAPI;
3280
+ /**
3281
+ * Campaign targeting API
3282
+ */
3283
+ readonly targeting: TargetingAPI;
3284
+ /**
3285
+ * Combined audiences API
3286
+ */
3287
+ readonly combinedAudiences: CombinedAudiencesAPI;
3288
+ /**
3289
+ * First party audiences API
3290
+ */
3291
+ readonly firstPartyAudiences: FirstPartyAudiencesAPI;
3292
+ /**
3293
+ * Pixel conversion and custom audience rules API
3294
+ */
3295
+ readonly pixel: PixelAPI;
3296
+ /**
3297
+ * Reports and analytics API
3298
+ */
3299
+ readonly reports: ReportsAPI;
3300
+ /**
3301
+ * Internal OAuth manager (for advanced use cases)
3302
+ */
3303
+ private readonly authManager;
3304
+ /**
3305
+ * Internal HTTP client (for advanced use cases)
3306
+ */
3307
+ private readonly httpClient;
3308
+ /**
3309
+ * Create a new Taboola client
3310
+ *
3311
+ * @param config - Client configuration
3312
+ */
3313
+ constructor(config: TaboolaConfig);
3314
+ /**
3315
+ * Get the base URL used for API requests
3316
+ */
3317
+ get baseUrl(): string;
3318
+ /**
3319
+ * Force refresh the access token
3320
+ *
3321
+ * Useful if you need to ensure a fresh token before a series of operations.
3322
+ */
3323
+ refreshToken(): Promise<void>;
3324
+ /**
3325
+ * Clear the cached access token
3326
+ *
3327
+ * Forces a new token to be fetched on the next request.
3328
+ */
3329
+ clearToken(): void;
3330
+ }
3331
+ /**
3332
+ * Create a new Taboola client
3333
+ *
3334
+ * Convenience function for creating a new client instance.
3335
+ *
3336
+ * @param config - Client configuration
3337
+ *
3338
+ * @example
3339
+ * ```typescript
3340
+ * import { createClient } from 'taboola-backstage-sdk';
3341
+ *
3342
+ * const client = createClient({
3343
+ * clientId: process.env.TABOOLA_CLIENT_ID!,
3344
+ * clientSecret: process.env.TABOOLA_CLIENT_SECRET!,
3345
+ * });
3346
+ * ```
3347
+ */
3348
+ declare function createClient(config: TaboolaConfig): TaboolaClient;
3349
+
3350
+ /**
3351
+ * Custom error classes for Taboola Backstage SDK
3352
+ */
3353
+ /**
3354
+ * Base error class for all Taboola SDK errors
3355
+ */
3356
+ declare class TaboolaError extends Error {
3357
+ /** HTTP status code if applicable */
3358
+ readonly statusCode: number | undefined;
3359
+ /** Original error response body */
3360
+ readonly response: unknown;
3361
+ /** Request URL that caused the error */
3362
+ readonly url: string | undefined;
3363
+ constructor(message: string, options?: {
3364
+ statusCode?: number;
3365
+ response?: unknown;
3366
+ url?: string;
3367
+ cause?: Error;
3368
+ });
3369
+ }
3370
+ /**
3371
+ * Authentication error (401)
3372
+ * Thrown when OAuth token is invalid or expired
3373
+ */
3374
+ declare class TaboolaAuthError extends TaboolaError {
3375
+ constructor(message?: string, options?: {
3376
+ response?: unknown;
3377
+ url?: string;
3378
+ cause?: Error;
3379
+ });
3380
+ }
3381
+ /**
3382
+ * Validation error (400)
3383
+ * Thrown when request parameters are invalid
3384
+ */
3385
+ declare class TaboolaValidationError extends TaboolaError {
3386
+ /** Specific field errors if available */
3387
+ readonly fieldErrors: Record<string, string[]> | undefined;
3388
+ constructor(message?: string, options?: {
3389
+ response?: unknown;
3390
+ url?: string;
3391
+ cause?: Error;
3392
+ fieldErrors?: Record<string, string[]>;
3393
+ });
3394
+ }
3395
+ /**
3396
+ * Not found error (404)
3397
+ * Thrown when requested resource doesn't exist
3398
+ */
3399
+ declare class TaboolaNotFoundError extends TaboolaError {
3400
+ /** The resource type that wasn't found */
3401
+ readonly resourceType: string | undefined;
3402
+ /** The resource ID that wasn't found */
3403
+ readonly resourceId: string | undefined;
3404
+ constructor(message?: string, options?: {
3405
+ response?: unknown;
3406
+ url?: string;
3407
+ cause?: Error;
3408
+ resourceType?: string;
3409
+ resourceId?: string;
3410
+ });
3411
+ }
3412
+ /**
3413
+ * Rate limit error (429)
3414
+ * Thrown when API rate limits are exceeded
3415
+ */
3416
+ declare class TaboolaRateLimitError extends TaboolaError {
3417
+ /** Seconds until rate limit resets */
3418
+ readonly retryAfter: number | undefined;
3419
+ constructor(message?: string, options?: {
3420
+ response?: unknown;
3421
+ url?: string;
3422
+ cause?: Error;
3423
+ retryAfter?: number;
3424
+ });
3425
+ }
3426
+ /**
3427
+ * Forbidden error (403)
3428
+ * Thrown when access to resource is denied
3429
+ */
3430
+ declare class TaboolaForbiddenError extends TaboolaError {
3431
+ constructor(message?: string, options?: {
3432
+ response?: unknown;
3433
+ url?: string;
3434
+ cause?: Error;
3435
+ });
3436
+ }
3437
+ /**
3438
+ * Server error (5xx)
3439
+ * Thrown when Taboola servers encounter an error
3440
+ */
3441
+ declare class TaboolaServerError extends TaboolaError {
3442
+ constructor(message?: string, options?: {
3443
+ statusCode?: number;
3444
+ response?: unknown;
3445
+ url?: string;
3446
+ cause?: Error;
3447
+ });
3448
+ }
3449
+ /**
3450
+ * Parse API error response and throw appropriate error class
3451
+ */
3452
+ declare function parseApiError(statusCode: number, response: unknown, url: string): TaboolaError;
3453
+
3454
+ export { type Account, type AccountType, AccountsAPI, type ActivitySchedule, type ActivityScheduleRule, type AddRemoveUsersRequest, type AddRemoveUsersResponse, type AdvertiserAccount, type AllowedAccountsResponse, type ApprovalState, type AudienceSegment, type AudienceTargeting, type AvailableAudience, type AvailableAudiencesResponse, type BidStrategy, type BlockedPublisher, type BlockedPublishersResponse, type BrandSafetyProvider, type Browser, type BulkCampaignUpdate, type BulkCampaignUpdateRequest, type BulkCreateItemsRequest, type BulkCreateItemsResponse, type BulkDeleteItemsRequest, type BulkUpdateItemsRequest, type CTA, type CTAType, type Campaign, type CampaignEnums, type CampaignItem, type CampaignItemListResponse, type CampaignListResponse, type CampaignPatchRequest, type CampaignReachEstimatorRequest, type CampaignReachEstimatorResponse, type CampaignStatus, type CampaignSummaryReport, type CampaignSummaryReportParams, type CampaignSummaryRow, type CampaignType, CampaignsAPI, type CombinedAudience, type CombinedAudienceListResponse, type CombinedAudienceRule, CombinedAudiencesAPI, type Condition, type ConditionOperator, type ConditionType, type ConnectionType, type ContextualSegment, type ContextualSegmentValue, type ContextualTargeting, type ConversionRule, type ConversionRuleListResponse, type ConversionRuleStatus, type ConversionRuleType, type ConversionRuleWithData, type ConversionRuleWithDataListResponse, type Coordinates, type Country, type CreateCampaignRequest, type CreateCombinedAudienceRequest, type CreateConversionRuleRequest, type CreateCustomAudienceRuleRequest, type CreateFirstPartyAudienceRequest, type CreateItemRequest, type CreativeFocus, type CreativeFocusType, type CurrencyCode, type CustomAudienceRule, type CustomAudienceRuleListResponse, type CustomAudienceRuleStatus, DEFAULT_BASE_URL, type DMA, type DailyAdDeliveryModel, type DateString, type DayOfWeek, DictionaryAPI, type Effect, type EffectType, type ExternalBrandSafety, type FirstPartyAudience, type FirstPartyAudienceTargeting, type FirstPartyAudienceUser, FirstPartyAudiencesAPI, HttpClient, type HttpClientOptions, type ImageLibraryItem, type ImageLibrarySearchParams, type ImageLibrarySearchResponse, type ImageUploadResponse, type ItemEnums, type ItemPolicyReview, type ItemStatus, type ItemType, type ItemVerificationPixel, type ItemViewabilityTag, ItemsAPI, type ListCampaignsOptions, type ListItemsOptions, type ListResponse, type LookalikeAudience, type MarketingObjective, type MarketplaceAudience, type MinimumCPC, type MultiTargeting, type MultiTargetingState, type NetworkAdvertisersResponse, OAuthManager, type OSVersion, type OperatingSystem, type OperatingSystemInfo, type PaginationParams, type PartnerType, type PatchOperation, PixelAPI, type Platform, type PlatformType, type PolicyReview, type PostalCode, type PostalCodeTargeting, type PostalCodeValue, type PricingModel, type Publisher, type PublisherBidModifier, type PublisherBidModifierCollection, type PublisherBidStrategyModifier, type PublisherBidStrategyModifierCollection, type PublisherListResponse, PublishersAPI, type RSSChildItem, type RSSChildrenListResponse, type RealtimeAdsReport, type RealtimeAdsRow, type RealtimeCampaignReport, type RealtimeCampaignRow, type RealtimeReportParams, type Region, type ReportDimension, type ReportMetadata, ReportsAPI, type SpendingLimitModel, type StoredToken, TaboolaAuthError, TaboolaClient, type TaboolaConfig, TaboolaError, TaboolaForbiddenError, TaboolaNotFoundError, TaboolaRateLimitError, TaboolaServerError, TaboolaValidationError, TargetingAPI, type TargetingType, type TargetingValue, type TokenResponse, type TopCampaignContentReport, type TopCampaignContentReportParams, type TopCampaignContentRow, type TrafficAllocationMode, type UpdateAudienceTargetingRequest, type UpdateBlockedPublishersRequest, type UpdateCampaignRequest, type UpdateCombinedAudienceRequest, type UpdateContextualTargetingRequest, type UpdateConversionRuleRequest, type UpdateCustomAudienceRuleRequest, type UpdateFirstPartyAudienceTargetingRequest, type UpdateItemRequest, type UpdatePostalCodeTargetingRequest, type VerificationPixel, type ViewabilityTag, createClient, parseApiError };