@adcp/client 4.7.2 → 4.8.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.
Files changed (52) hide show
  1. package/dist/lib/agents/index.generated.d.ts +17 -17
  2. package/dist/lib/agents/index.generated.d.ts.map +1 -1
  3. package/dist/lib/agents/index.generated.js +24 -24
  4. package/dist/lib/agents/index.generated.js.map +1 -1
  5. package/dist/lib/core/CreativeAgentClient.d.ts +17 -1
  6. package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
  7. package/dist/lib/core/CreativeAgentClient.js +21 -0
  8. package/dist/lib/core/CreativeAgentClient.js.map +1 -1
  9. package/dist/lib/index.d.ts +2 -2
  10. package/dist/lib/index.d.ts.map +1 -1
  11. package/dist/lib/index.js.map +1 -1
  12. package/dist/lib/testing/agent-tester.d.ts +1 -1
  13. package/dist/lib/testing/agent-tester.d.ts.map +1 -1
  14. package/dist/lib/testing/agent-tester.js +2 -1
  15. package/dist/lib/testing/agent-tester.js.map +1 -1
  16. package/dist/lib/testing/formatter.d.ts.map +1 -1
  17. package/dist/lib/testing/formatter.js +6 -5
  18. package/dist/lib/testing/formatter.js.map +1 -1
  19. package/dist/lib/testing/index.d.ts +1 -1
  20. package/dist/lib/testing/index.d.ts.map +1 -1
  21. package/dist/lib/testing/index.js +3 -2
  22. package/dist/lib/testing/index.js.map +1 -1
  23. package/dist/lib/testing/orchestrator.d.ts.map +1 -1
  24. package/dist/lib/testing/orchestrator.js +10 -3
  25. package/dist/lib/testing/orchestrator.js.map +1 -1
  26. package/dist/lib/testing/scenarios/capabilities.d.ts.map +1 -1
  27. package/dist/lib/testing/scenarios/capabilities.js +50 -39
  28. package/dist/lib/testing/scenarios/capabilities.js.map +1 -1
  29. package/dist/lib/testing/scenarios/index.d.ts +1 -1
  30. package/dist/lib/testing/scenarios/index.d.ts.map +1 -1
  31. package/dist/lib/testing/scenarios/index.js +2 -1
  32. package/dist/lib/testing/scenarios/index.js.map +1 -1
  33. package/dist/lib/testing/scenarios/media-buy.d.ts +13 -1
  34. package/dist/lib/testing/scenarios/media-buy.d.ts.map +1 -1
  35. package/dist/lib/testing/scenarios/media-buy.js +60 -33
  36. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  37. package/dist/lib/testing/types.d.ts +1 -1
  38. package/dist/lib/testing/types.d.ts.map +1 -1
  39. package/dist/lib/types/core.generated.d.ts +118 -3
  40. package/dist/lib/types/core.generated.d.ts.map +1 -1
  41. package/dist/lib/types/core.generated.js +1 -1
  42. package/dist/lib/types/schemas.generated.d.ts +25675 -21635
  43. package/dist/lib/types/schemas.generated.d.ts.map +1 -1
  44. package/dist/lib/types/schemas.generated.js +230 -183
  45. package/dist/lib/types/schemas.generated.js.map +1 -1
  46. package/dist/lib/types/tools.generated.d.ts +1323 -1225
  47. package/dist/lib/types/tools.generated.d.ts.map +1 -1
  48. package/dist/lib/utils/capabilities.d.ts +1 -1
  49. package/dist/lib/utils/capabilities.d.ts.map +1 -1
  50. package/dist/lib/utils/capabilities.js +9 -4
  51. package/dist/lib/utils/capabilities.js.map +1 -1
  52. package/package.json +6 -20
@@ -3482,9 +3482,9 @@ export interface Account {
3482
3482
  */
3483
3483
  rate_card?: string;
3484
3484
  /**
3485
- * Payment terms (e.g., 'net_30', 'prepay')
3485
+ * Payment terms agreed for this account. Binding for all invoices when the account is active.
3486
3486
  */
3487
- payment_terms?: string;
3487
+ payment_terms?: 'net_15' | 'net_30' | 'net_45' | 'net_60' | 'net_90' | 'prepay';
3488
3488
  /**
3489
3489
  * Maximum outstanding balance allowed
3490
3490
  */
@@ -3599,461 +3599,293 @@ export interface CreateMediaBuyError {
3599
3599
  ext?: ExtensionObject;
3600
3600
  }
3601
3601
  /**
3602
- * Validation strictness. 'strict' fails entire sync on any validation error. 'lenient' processes valid creatives and reports errors.
3603
- */
3604
- export type ValidationMode = 'strict' | 'lenient';
3605
- /**
3606
- * Request parameters for syncing creative assets with upsert semantics - supports bulk operations, scoped updates, and assignment management
3602
+ * Request parameters for updating campaign and package settings
3607
3603
  */
3608
- export interface SyncCreativesRequest {
3609
- account: AccountReference;
3604
+ export type UpdateMediaBuyRequest = {
3610
3605
  /**
3611
- * Array of creative assets to sync (create or update)
3612
- *
3613
- * @maxItems 100
3606
+ * Publisher's ID of the media buy to update
3614
3607
  */
3615
- creatives: CreativeAsset[];
3608
+ media_buy_id?: string;
3616
3609
  /**
3617
- * Optional filter to limit sync scope to specific creative IDs. When provided, only these creatives will be created/updated. Other creatives in the library are unaffected. Useful for partial updates and error recovery.
3618
- *
3619
- * @maxItems 100
3610
+ * Buyer's reference for the media buy to update
3620
3611
  */
3621
- creative_ids?: string[];
3612
+ buyer_ref?: string;
3622
3613
  /**
3623
- * Optional bulk assignment of creatives to packages. Each entry maps one creative to one package with optional weight and placement targeting.
3614
+ * Pause/resume the entire media buy (true = paused, false = active)
3624
3615
  */
3625
- assignments?: {
3626
- /**
3627
- * ID of the creative to assign
3628
- */
3629
- creative_id: string;
3630
- /**
3631
- * ID of the package to assign the creative to
3632
- */
3633
- package_id: string;
3634
- /**
3635
- * Relative delivery weight (0–100). When multiple creatives are assigned to the same package, weights determine impression distribution proportionally — a creative with weight 2 gets twice the delivery of weight 1. When omitted, the creative receives equal rotation with other unweighted creatives. A weight of 0 means the creative is assigned but paused (receives no delivery).
3636
- */
3637
- weight?: number;
3638
- /**
3639
- * Restrict this creative to specific placements within the package. When omitted, the creative is eligible for all placements.
3640
- */
3641
- placement_ids?: string[];
3642
- }[];
3616
+ paused?: boolean;
3617
+ start_time?: StartTiming;
3643
3618
  /**
3644
- * Client-generated idempotency key for safe retries. If a sync fails without a response, resending with the same idempotency_key guarantees at-most-once execution.
3619
+ * New end date/time in ISO 8601 format
3645
3620
  */
3646
- idempotency_key?: string;
3621
+ end_time?: string;
3647
3622
  /**
3648
- * When true, creatives not included in this sync will be archived. Use with caution for full library replacement.
3623
+ * Package-specific updates
3649
3624
  */
3650
- delete_missing?: boolean;
3625
+ packages?: PackageUpdate[];
3626
+ reporting_webhook?: ReportingWebhook;
3627
+ push_notification_config?: PushNotificationConfig;
3651
3628
  /**
3652
- * When true, preview changes without applying them. Returns what would be created/updated/deleted.
3629
+ * Client-generated idempotency key for safe retries. If an update fails without a response, resending with the same idempotency_key guarantees the update is applied at most once.
3653
3630
  */
3654
- dry_run?: boolean;
3655
- validation_mode?: ValidationMode;
3656
- push_notification_config?: PushNotificationConfig;
3631
+ idempotency_key?: string;
3657
3632
  context?: ContextObject;
3658
3633
  ext?: ExtensionObject;
3659
- }
3660
- /**
3661
- * Response from creative sync operation. Returns either per-creative results (best-effort processing) OR operation-level errors (complete failure). This enforces atomic semantics at the operation level while allowing per-item failures within successful operations.
3662
- */
3663
- export type SyncCreativesResponse = SyncCreativesSuccess | SyncCreativesError;
3664
- /**
3665
- * Action taken for this creative
3666
- */
3667
- export type CreativeAction = 'created' | 'updated' | 'unchanged' | 'failed' | 'deleted';
3634
+ } & {
3635
+ [k: string]: unknown | undefined;
3636
+ };
3668
3637
  /**
3669
- * Success response - sync operation processed creatives (may include per-item failures)
3638
+ * Package update configuration for update_media_buy. Identifies package by package_id or buyer_ref and specifies fields to modify. Fields not present are left unchanged. Note: product_id, format_ids, and pricing_option_id cannot be changed after creation.
3670
3639
  */
3671
- export interface SyncCreativesSuccess {
3640
+ export type PackageUpdate = {
3672
3641
  /**
3673
- * Whether this was a dry run (no actual changes made)
3642
+ * Publisher's ID of package to update
3674
3643
  */
3675
- dry_run?: boolean;
3644
+ package_id?: string;
3676
3645
  /**
3677
- * Results for each creative processed. Items with action='failed' indicate per-item validation/processing failures, not operation-level failures.
3646
+ * Buyer's reference for the package to update
3678
3647
  */
3679
- creatives: {
3648
+ buyer_ref?: string;
3649
+ /**
3650
+ * Updated budget allocation for this package in the currency specified by the pricing option
3651
+ */
3652
+ budget?: number;
3653
+ pacing?: Pacing;
3654
+ /**
3655
+ * Updated bid price for auction-based pricing options. This is the exact bid/price to honor unless selected pricing_option has max_bid=true, in which case bid_price is the buyer's maximum willingness to pay (ceiling).
3656
+ */
3657
+ bid_price?: number;
3658
+ /**
3659
+ * Updated impression goal for this package
3660
+ */
3661
+ impressions?: number;
3662
+ /**
3663
+ * Updated flight start date/time for this package in ISO 8601 format. Must fall within the media buy's date range.
3664
+ */
3665
+ start_time?: string;
3666
+ /**
3667
+ * Updated flight end date/time for this package in ISO 8601 format. Must fall within the media buy's date range.
3668
+ */
3669
+ end_time?: string;
3670
+ /**
3671
+ * Pause/resume specific package (true = paused, false = active)
3672
+ */
3673
+ paused?: boolean;
3674
+ /**
3675
+ * Replace the catalogs this package promotes. Uses replacement semantics — the provided array replaces the current list. Omit to leave catalogs unchanged.
3676
+ */
3677
+ catalogs?: Catalog[];
3678
+ /**
3679
+ * Replace all optimization goals for this package. Uses replacement semantics — omit to leave goals unchanged.
3680
+ */
3681
+ optimization_goals?: OptimizationGoal[];
3682
+ targeting_overlay?: TargetingOverlay;
3683
+ /**
3684
+ * Keyword targets to add or update on this package. Upserts by (keyword, match_type) identity: if the pair already exists, its bid_price is updated; if not, a new keyword target is added. Use targeting_overlay.keyword_targets in create_media_buy to set the initial list.
3685
+ */
3686
+ keyword_targets_add?: {
3680
3687
  /**
3681
- * Creative ID from the request
3688
+ * The keyword to target
3682
3689
  */
3683
- creative_id: string;
3684
- account?: Account;
3685
- action: CreativeAction;
3690
+ keyword: string;
3686
3691
  /**
3687
- * Platform-specific ID assigned to the creative
3692
+ * Match type for this keyword
3688
3693
  */
3689
- platform_id?: string;
3694
+ match_type: 'broad' | 'phrase' | 'exact';
3690
3695
  /**
3691
- * Field names that were modified (only present when action='updated')
3696
+ * Per-keyword bid price. Inherits currency and max_bid interpretation from the package's pricing option.
3692
3697
  */
3693
- changes?: string[];
3698
+ bid_price?: number;
3699
+ }[];
3700
+ /**
3701
+ * Keyword targets to remove from this package. Removes matching (keyword, match_type) pairs. If a specified pair is not present, sellers SHOULD treat it as a no-op for that entry.
3702
+ */
3703
+ keyword_targets_remove?: {
3694
3704
  /**
3695
- * Validation or processing errors (only present when action='failed')
3705
+ * The keyword to stop targeting
3696
3706
  */
3697
- errors?: string[];
3707
+ keyword: string;
3698
3708
  /**
3699
- * Non-fatal warnings about this creative
3709
+ * Match type to remove
3700
3710
  */
3701
- warnings?: string[];
3711
+ match_type: 'broad' | 'phrase' | 'exact';
3712
+ }[];
3713
+ /**
3714
+ * Negative keywords to add to this package. Appends to the existing negative keyword list — does not replace it. If a keyword+match_type pair already exists, sellers SHOULD treat it as a no-op for that entry. Use targeting_overlay.negative_keywords in create_media_buy to set the initial list.
3715
+ */
3716
+ negative_keywords_add?: {
3702
3717
  /**
3703
- * Preview URL for generative creatives (only present for generative formats)
3718
+ * The keyword to exclude
3704
3719
  */
3705
- preview_url?: string;
3720
+ keyword: string;
3706
3721
  /**
3707
- * ISO 8601 timestamp when preview link expires (only present when preview_url exists)
3722
+ * Match type for exclusion
3708
3723
  */
3709
- expires_at?: string;
3724
+ match_type: 'broad' | 'phrase' | 'exact';
3725
+ }[];
3726
+ /**
3727
+ * Negative keywords to remove from this package. Removes matching keyword+match_type pairs from the existing list. If a specified pair is not present, sellers SHOULD treat it as a no-op for that entry.
3728
+ */
3729
+ negative_keywords_remove?: {
3710
3730
  /**
3711
- * Package IDs this creative was successfully assigned to (only present when assignments were requested)
3731
+ * The keyword to stop excluding
3712
3732
  */
3713
- assigned_to?: string[];
3733
+ keyword: string;
3714
3734
  /**
3715
- * Assignment errors by package ID (only present when assignment failures occurred)
3735
+ * Match type to remove
3716
3736
  */
3717
- assignment_errors?: {
3718
- /**
3719
- * Error message for this package assignment
3720
- *
3721
- * This interface was referenced by `undefined`'s JSON-Schema definition
3722
- * via the `patternProperty` "^[a-zA-Z0-9_-]+$".
3723
- */
3724
- [k: string]: string | undefined;
3725
- };
3737
+ match_type: 'broad' | 'phrase' | 'exact';
3726
3738
  }[];
3727
3739
  /**
3728
- * When true, this response contains simulated data from sandbox mode.
3740
+ * Replace creative assignments for this package with optional weights and placement targeting. Uses replacement semantics - omit to leave assignments unchanged.
3729
3741
  */
3730
- sandbox?: boolean;
3731
- context?: ContextObject;
3732
- ext?: ExtensionObject;
3733
- }
3734
- /**
3735
- * Error response - operation failed completely, no creatives were processed
3736
- */
3737
- export interface SyncCreativesError {
3742
+ creative_assignments?: CreativeAssignment[];
3738
3743
  /**
3739
- * Operation-level errors that prevented processing any creatives (e.g., authentication failure, service unavailable, invalid request format)
3744
+ * Upload new creative assets and assign to this package (creatives will be added to library). Use creative_assignments instead for existing library creatives.
3745
+ *
3746
+ * @maxItems 100
3740
3747
  */
3741
- errors: Error[];
3742
- context?: ContextObject;
3748
+ creatives?: CreativeAsset[];
3743
3749
  ext?: ExtensionObject;
3744
- }
3745
- /**
3746
- * Field to sort by
3747
- */
3748
- export type CreativeSortField = 'created_date' | 'updated_date' | 'name' | 'status' | 'assignment_count' | 'performance_score';
3750
+ } & {
3751
+ [k: string]: unknown | undefined;
3752
+ };
3749
3753
  /**
3750
- * Sort direction
3754
+ * Response payload for update_media_buy task. Returns either complete success data OR error information, never both. This enforces atomic operation semantics - updates are either fully applied or not applied at all.
3751
3755
  */
3752
- export type SortDirection = 'asc' | 'desc';
3756
+ export type UpdateMediaBuyResponse = UpdateMediaBuySuccess | UpdateMediaBuyError;
3753
3757
  /**
3754
- * Request parameters for querying creative assets from the centralized library with filtering, sorting, and pagination
3758
+ * Success response - media buy updated successfully
3755
3759
  */
3756
- export interface ListCreativesRequest {
3757
- filters?: CreativeFilters;
3760
+ export interface UpdateMediaBuySuccess {
3758
3761
  /**
3759
- * Sorting parameters
3762
+ * Publisher's identifier for the media buy
3760
3763
  */
3761
- sort?: {
3762
- field?: CreativeSortField;
3763
- direction?: SortDirection;
3764
- };
3765
- pagination?: PaginationRequest;
3764
+ media_buy_id: string;
3766
3765
  /**
3767
- * Include package assignment information in response
3766
+ * Buyer's reference identifier for the media buy
3768
3767
  */
3769
- include_assignments?: boolean;
3768
+ buyer_ref: string;
3770
3769
  /**
3771
- * Include aggregated performance metrics in response
3770
+ * ISO 8601 timestamp when changes take effect (null if pending approval)
3772
3771
  */
3773
- include_performance?: boolean;
3772
+ implementation_date?: string | null;
3774
3773
  /**
3775
- * Include sub-assets (for carousel/native formats) in response
3774
+ * Array of packages that were modified with complete state information
3776
3775
  */
3777
- include_sub_assets?: boolean;
3776
+ affected_packages?: Package[];
3778
3777
  /**
3779
- * Specific fields to include in response (omit for all fields)
3778
+ * When true, this response contains simulated data from sandbox mode.
3780
3779
  */
3781
- fields?: ('creative_id' | 'name' | 'format' | 'status' | 'created_date' | 'updated_date' | 'tags' | 'assignments' | 'performance' | 'sub_assets')[];
3780
+ sandbox?: boolean;
3782
3781
  context?: ContextObject;
3783
3782
  ext?: ExtensionObject;
3784
3783
  }
3785
3784
  /**
3786
- * Filter criteria for querying creative assets from the centralized library. By default, archived creatives are excluded from results. To include archived creatives, explicitly filter by status='archived' or include 'archived' in the statuses array.
3785
+ * Error response - operation failed, no changes applied
3787
3786
  */
3788
- export interface CreativeFilters {
3787
+ export interface UpdateMediaBuyError {
3789
3788
  /**
3790
- * Filter creatives by owning accounts. Useful for agencies managing multiple client accounts.
3789
+ * Array of errors explaining why the operation failed
3791
3790
  */
3792
- accounts?: AccountReference[];
3791
+ errors: Error[];
3792
+ context?: ContextObject;
3793
+ ext?: ExtensionObject;
3794
+ }
3795
+ /**
3796
+ * Status of a media buy.
3797
+ */
3798
+ export type MediaBuyStatus = 'pending_activation' | 'active' | 'paused' | 'completed' | 'rejected' | 'canceled';
3799
+ /**
3800
+ * Request parameters for retrieving media buy status, creative approval state, and optional delivery snapshots
3801
+ */
3802
+ export interface GetMediaBuysRequest {
3803
+ account?: AccountReference;
3793
3804
  /**
3794
- * Filter by creative format types (e.g., video, audio, display)
3805
+ * Array of publisher media buy IDs to retrieve. When omitted along with buyer_refs, returns a paginated set of accessible media buys matching status_filter.
3795
3806
  */
3796
- formats?: string[];
3807
+ media_buy_ids?: string[];
3797
3808
  /**
3798
- * Filter by creative approval statuses
3809
+ * Array of buyer reference IDs to retrieve
3799
3810
  */
3800
- statuses?: CreativeStatus[];
3811
+ buyer_refs?: string[];
3801
3812
  /**
3802
- * Filter by creative tags (all tags must match)
3813
+ * Filter by status. Can be a single status or array of statuses. Defaults to ["active"] only when media_buy_ids and buyer_refs are both omitted. When media_buy_ids or buyer_refs are provided, no implicit status filter is applied.
3803
3814
  */
3804
- tags?: string[];
3805
- /**
3806
- * Filter by creative tags (any tag must match)
3807
- */
3808
- tags_any?: string[];
3809
- /**
3810
- * Filter by creative names containing this text (case-insensitive)
3811
- */
3812
- name_contains?: string;
3813
- /**
3814
- * Filter by specific creative IDs
3815
- *
3816
- * @maxItems 100
3817
- */
3818
- creative_ids?: string[];
3819
- /**
3820
- * Filter creatives created after this date (ISO 8601)
3821
- */
3822
- created_after?: string;
3823
- /**
3824
- * Filter creatives created before this date (ISO 8601)
3825
- */
3826
- created_before?: string;
3827
- /**
3828
- * Filter creatives last updated after this date (ISO 8601)
3829
- */
3830
- updated_after?: string;
3831
- /**
3832
- * Filter creatives last updated before this date (ISO 8601)
3833
- */
3834
- updated_before?: string;
3835
- /**
3836
- * Filter creatives assigned to any of these packages
3837
- */
3838
- assigned_to_packages?: string[];
3839
- /**
3840
- * Filter creatives assigned to any of these media buys
3841
- */
3842
- media_buy_ids?: string[];
3843
- /**
3844
- * Filter creatives assigned to media buys with any of these buyer references
3845
- */
3846
- buyer_refs?: string[];
3847
- /**
3848
- * Filter for unassigned creatives when true, assigned creatives when false
3849
- */
3850
- unassigned?: boolean;
3815
+ status_filter?: MediaBuyStatus | MediaBuyStatus[];
3851
3816
  /**
3852
- * Filter creatives that have performance data when true
3817
+ * When true, include a near-real-time delivery snapshot for each package. Snapshots reflect the latest available entity-level stats from the platform (e.g., updated every ~15 minutes on GAM, ~1 hour on batch-only platforms). The staleness_seconds field on each snapshot indicates data freshness. If a snapshot cannot be returned, package.snapshot_unavailable_reason explains why. Defaults to false.
3853
3818
  */
3854
- has_performance_data?: boolean;
3819
+ include_snapshot?: boolean;
3820
+ pagination?: PaginationRequest;
3821
+ context?: ContextObject;
3822
+ ext?: ExtensionObject;
3855
3823
  }
3856
3824
  /**
3857
- * Sub-asset for multi-asset creative formats, including carousel images and native ad template variables
3825
+ * Approval state of a creative on a specific package
3858
3826
  */
3859
- export type SubAsset = {
3860
- /**
3861
- * Discriminator indicating this is a media asset with content_uri
3862
- */
3863
- asset_kind: 'media';
3864
- /**
3865
- * Type of asset. Common types: thumbnail_image, product_image, featured_image, logo
3866
- */
3867
- asset_type: string;
3868
- /**
3869
- * Unique identifier for the asset within the creative
3870
- */
3871
- asset_id: string;
3872
- /**
3873
- * URL for media assets (images, videos, etc.)
3874
- */
3875
- content_uri: string;
3876
- } | {
3877
- /**
3878
- * Discriminator indicating this is a text asset with content
3879
- */
3880
- asset_kind: 'text';
3881
- /**
3882
- * Type of asset. Common types: headline, body_text, cta_text, price_text, sponsor_name, author_name, click_url
3883
- */
3884
- asset_type: string;
3885
- /**
3886
- * Unique identifier for the asset within the creative
3887
- */
3888
- asset_id: string;
3889
- /**
3890
- * Text content for text-based assets like headlines, body text, CTA text, etc.
3891
- */
3892
- content: string | string[];
3893
- };
3827
+ export type CreativeApprovalStatus = 'pending_review' | 'approved' | 'rejected';
3894
3828
  /**
3895
- * Response from creative library query with filtered results, metadata, and optional enriched data
3829
+ * Response payload for get_media_buys task. Returns media buy configuration, creative approval state, and optional delivery snapshots.
3896
3830
  */
3897
- export interface ListCreativesResponse {
3831
+ export interface GetMediaBuysResponse {
3898
3832
  /**
3899
- * Summary of the query that was executed
3833
+ * Array of media buys with status, creative approval state, and optional delivery snapshots
3900
3834
  */
3901
- query_summary: {
3902
- /**
3903
- * Total number of creatives matching filters (across all pages)
3904
- */
3905
- total_matching?: number;
3906
- /**
3907
- * Number of creatives returned in this response
3908
- */
3909
- returned?: number;
3835
+ media_buys: {
3910
3836
  /**
3911
- * List of filters that were applied to the query
3837
+ * Publisher's unique identifier for the media buy
3912
3838
  */
3913
- filters_applied?: string[];
3839
+ media_buy_id: string;
3914
3840
  /**
3915
- * Sort order that was applied
3841
+ * Buyer's reference identifier for this media buy
3916
3842
  */
3917
- sort_applied?: {
3918
- field?: string;
3919
- direction?: SortDirection;
3920
- };
3921
- };
3922
- pagination: PaginationResponse;
3923
- /**
3924
- * Array of creative assets matching the query
3925
- */
3926
- creatives: {
3843
+ buyer_ref?: string;
3927
3844
  /**
3928
- * Unique identifier for the creative
3845
+ * Buyer campaign reference label sourced from create_media_buy.buyer_campaign_ref. Groups related operations under a single campaign; may be absent when not provided at creation time.
3929
3846
  */
3930
- creative_id: string;
3847
+ buyer_campaign_ref?: string;
3931
3848
  account?: Account;
3849
+ status: MediaBuyStatus;
3932
3850
  /**
3933
- * Human-readable creative name
3851
+ * ISO 4217 currency code (e.g., USD, EUR, GBP) for monetary values at this media buy level. total_budget is always denominated in this currency. Package-level fields may override with package.currency.
3934
3852
  */
3935
- name: string;
3936
- format_id: FormatID;
3937
- status: CreativeStatus;
3853
+ currency: string;
3938
3854
  /**
3939
- * When the creative was uploaded to the library
3855
+ * Total budget amount across all packages, denominated in media_buy.currency
3940
3856
  */
3941
- created_date: string;
3857
+ total_budget?: number;
3942
3858
  /**
3943
- * When the creative was last modified
3859
+ * ISO 8601 flight start time for this media buy (earliest package start_time). Avoids requiring buyers to compute min(packages[].start_time).
3944
3860
  */
3945
- updated_date: string;
3861
+ start_time?: string;
3946
3862
  /**
3947
- * Assets for this creative, keyed by asset_id
3863
+ * ISO 8601 flight end time for this media buy (latest package end_time). Avoids requiring buyers to compute max(packages[].end_time).
3948
3864
  */
3949
- assets?: {
3950
- /**
3951
- * This interface was referenced by `undefined`'s JSON-Schema definition
3952
- * via the `patternProperty` "^[a-z0-9_]+$".
3953
- */
3954
- [k: string]: ImageAsset | VideoAsset | AudioAsset | VASTAsset | TextAsset | URLAsset | HTMLAsset | JavaScriptAsset | WebhookAsset | CSSAsset | DAASTAsset | MarkdownAsset | BriefAsset | CatalogAsset;
3955
- };
3865
+ end_time?: string;
3956
3866
  /**
3957
- * User-defined tags for organization and searchability
3867
+ * ISO 8601 timestamp for creative upload deadline
3958
3868
  */
3959
- tags?: string[];
3869
+ creative_deadline?: string;
3960
3870
  /**
3961
- * Current package assignments (included when include_assignments=true)
3871
+ * Creation timestamp
3962
3872
  */
3963
- assignments?: {
3964
- /**
3965
- * Total number of active package assignments
3966
- */
3967
- assignment_count: number;
3968
- /**
3969
- * List of packages this creative is assigned to
3970
- */
3971
- assigned_packages?: {
3972
- /**
3973
- * Package identifier
3974
- */
3975
- package_id: string;
3976
- /**
3977
- * Buyer's reference identifier for this package
3978
- */
3979
- buyer_ref?: string;
3980
- /**
3981
- * When this assignment was created
3982
- */
3983
- assigned_date: string;
3984
- }[];
3985
- };
3873
+ created_at?: string;
3986
3874
  /**
3987
- * Aggregated performance metrics (included when include_performance=true)
3875
+ * Last update timestamp
3988
3876
  */
3989
- performance?: {
3990
- /**
3991
- * Total impressions across all assignments
3992
- */
3993
- impressions?: number;
3994
- /**
3995
- * Total clicks across all assignments
3996
- */
3997
- clicks?: number;
3998
- /**
3999
- * Click-through rate (clicks/impressions)
4000
- */
4001
- ctr?: number;
4002
- /**
4003
- * Conversion rate across all assignments
4004
- */
4005
- conversion_rate?: number;
4006
- /**
4007
- * Aggregated performance score (0-100)
4008
- */
4009
- performance_score?: number;
4010
- /**
4011
- * When performance data was last updated
4012
- */
4013
- last_updated: string;
4014
- };
3877
+ updated_at?: string;
4015
3878
  /**
4016
- * Sub-assets for multi-asset formats (included when include_sub_assets=true)
3879
+ * Packages within this media buy, augmented with creative approval status and optional delivery snapshots
4017
3880
  */
4018
- sub_assets?: SubAsset[];
3881
+ packages: PackageStatus[];
3882
+ ext?: ExtensionObject;
4019
3883
  }[];
4020
3884
  /**
4021
- * Breakdown of creatives by format type
4022
- */
4023
- format_summary?: {
4024
- /**
4025
- * Number of creatives with this format
4026
- *
4027
- * This interface was referenced by `undefined`'s JSON-Schema definition
4028
- * via the `patternProperty` "^[a-zA-Z0-9_-]+$".
4029
- */
4030
- [k: string]: number | undefined;
4031
- };
4032
- /**
4033
- * Breakdown of creatives by status
3885
+ * Task-specific errors (e.g., media buy not found)
4034
3886
  */
4035
- status_summary?: {
4036
- /**
4037
- * Number of creatives being processed
4038
- */
4039
- processing?: number;
4040
- /**
4041
- * Number of approved creatives
4042
- */
4043
- approved?: number;
4044
- /**
4045
- * Number of creatives pending review
4046
- */
4047
- pending_review?: number;
4048
- /**
4049
- * Number of rejected creatives
4050
- */
4051
- rejected?: number;
4052
- /**
4053
- * Number of archived creatives
4054
- */
4055
- archived?: number;
4056
- };
3887
+ errors?: Error[];
3888
+ pagination?: PaginationResponse;
4057
3889
  /**
4058
3890
  * When true, this response contains simulated data from sandbox mode.
4059
3891
  */
@@ -4062,488 +3894,193 @@ export interface ListCreativesResponse {
4062
3894
  ext?: ExtensionObject;
4063
3895
  }
4064
3896
  /**
4065
- * Request parameters for updating campaign and package settings
3897
+ * Current status of a package within a media buy — includes creative approval state and optional delivery snapshot. For the creation input shape, see PackageRequest. For the creation output shape, see Package.
4066
3898
  */
4067
- export type UpdateMediaBuyRequest = {
3899
+ export interface PackageStatus {
4068
3900
  /**
4069
- * Publisher's ID of the media buy to update
3901
+ * Publisher's package identifier
4070
3902
  */
4071
- media_buy_id?: string;
3903
+ package_id: string;
4072
3904
  /**
4073
- * Buyer's reference for the media buy to update
3905
+ * Buyer's reference identifier for this package
4074
3906
  */
4075
3907
  buyer_ref?: string;
4076
3908
  /**
4077
- * Pause/resume the entire media buy (true = paused, false = active)
3909
+ * Product identifier this package is purchased from
4078
3910
  */
4079
- paused?: boolean;
4080
- start_time?: StartTiming;
3911
+ product_id?: string;
4081
3912
  /**
4082
- * New end date/time in ISO 8601 format
3913
+ * Package budget amount, denominated in package.currency when present, otherwise media_buy.currency
4083
3914
  */
4084
- end_time?: string;
3915
+ budget?: number;
4085
3916
  /**
4086
- * Package-specific updates
3917
+ * ISO 4217 currency code for monetary values at this package level (budget, bid_price, snapshot.spend). When absent, inherit media_buy.currency.
4087
3918
  */
4088
- packages?: PackageUpdate[];
4089
- reporting_webhook?: ReportingWebhook;
4090
- push_notification_config?: PushNotificationConfig;
3919
+ currency?: string;
4091
3920
  /**
4092
- * Client-generated idempotency key for safe retries. If an update fails without a response, resending with the same idempotency_key guarantees the update is applied at most once.
4093
- */
4094
- idempotency_key?: string;
4095
- context?: ContextObject;
4096
- ext?: ExtensionObject;
4097
- } & {
4098
- [k: string]: unknown | undefined;
4099
- };
4100
- /**
4101
- * Package update configuration for update_media_buy. Identifies package by package_id or buyer_ref and specifies fields to modify. Fields not present are left unchanged. Note: product_id, format_ids, and pricing_option_id cannot be changed after creation.
4102
- */
4103
- export type PackageUpdate = {
4104
- /**
4105
- * Publisher's ID of package to update
4106
- */
4107
- package_id?: string;
4108
- /**
4109
- * Buyer's reference for the package to update
4110
- */
4111
- buyer_ref?: string;
4112
- /**
4113
- * Updated budget allocation for this package in the currency specified by the pricing option
4114
- */
4115
- budget?: number;
4116
- pacing?: Pacing;
4117
- /**
4118
- * Updated bid price for auction-based pricing options. This is the exact bid/price to honor unless selected pricing_option has max_bid=true, in which case bid_price is the buyer's maximum willingness to pay (ceiling).
3921
+ * Current bid price for auction-based packages. Denominated in package.currency when present, otherwise media_buy.currency. Relevant for automated price optimization loops.
4119
3922
  */
4120
3923
  bid_price?: number;
4121
3924
  /**
4122
- * Updated impression goal for this package
3925
+ * Goal impression count for impression-based packages
4123
3926
  */
4124
3927
  impressions?: number;
4125
3928
  /**
4126
- * Updated flight start date/time for this package in ISO 8601 format. Must fall within the media buy's date range.
3929
+ * ISO 8601 flight start time for this package. Use to determine whether the package is within its scheduled flight before interpreting delivery status.
4127
3930
  */
4128
3931
  start_time?: string;
4129
3932
  /**
4130
- * Updated flight end date/time for this package in ISO 8601 format. Must fall within the media buy's date range.
3933
+ * ISO 8601 flight end time for this package
4131
3934
  */
4132
3935
  end_time?: string;
4133
3936
  /**
4134
- * Pause/resume specific package (true = paused, false = active)
3937
+ * Whether this package is currently paused by the buyer
4135
3938
  */
4136
3939
  paused?: boolean;
4137
3940
  /**
4138
- * Replace the catalogs this package promotes. Uses replacement semantics the provided array replaces the current list. Omit to leave catalogs unchanged.
3941
+ * Approval status for each creative assigned to this package. Absent when no creatives have been assigned.
4139
3942
  */
4140
- catalogs?: Catalog[];
3943
+ creative_approvals?: {
3944
+ /**
3945
+ * Creative identifier
3946
+ */
3947
+ creative_id: string;
3948
+ approval_status?: CreativeApprovalStatus;
3949
+ /**
3950
+ * Human-readable explanation of why the creative was rejected. Present only when approval_status is 'rejected'.
3951
+ */
3952
+ rejection_reason?: string;
3953
+ }[];
4141
3954
  /**
4142
- * Replace all optimization goals for this package. Uses replacement semantics omit to leave goals unchanged.
3955
+ * Format IDs from the original create_media_buy format_ids_to_provide that have not yet been uploaded via sync_creatives. When empty or absent, all required formats have been provided.
4143
3956
  */
4144
- optimization_goals?: OptimizationGoal[];
4145
- targeting_overlay?: TargetingOverlay;
3957
+ format_ids_pending?: FormatID[];
4146
3958
  /**
4147
- * Keyword targets to add or update on this package. Upserts by (keyword, match_type) identity: if the pair already exists, its bid_price is updated; if not, a new keyword target is added. Use targeting_overlay.keyword_targets in create_media_buy to set the initial list.
3959
+ * Machine-readable reason the snapshot is omitted. Present only when include_snapshot was true and snapshot is unavailable for this package.
4148
3960
  */
4149
- keyword_targets_add?: {
4150
- /**
4151
- * The keyword to target
4152
- */
4153
- keyword: string;
3961
+ snapshot_unavailable_reason?: 'SNAPSHOT_UNSUPPORTED' | 'SNAPSHOT_TEMPORARILY_UNAVAILABLE' | 'SNAPSHOT_PERMISSION_DENIED';
3962
+ /**
3963
+ * Near-real-time delivery snapshot for this package. Only present when include_snapshot was true in the request. Represents the latest available entity-level stats from the platform — not billing-grade data.
3964
+ */
3965
+ snapshot?: {
4154
3966
  /**
4155
- * Match type for this keyword
3967
+ * ISO 8601 timestamp when this snapshot was captured by the platform
4156
3968
  */
4157
- match_type: 'broad' | 'phrase' | 'exact';
3969
+ as_of: string;
4158
3970
  /**
4159
- * Per-keyword bid price. Inherits currency and max_bid interpretation from the package's pricing option.
3971
+ * Maximum age of this data in seconds. For example, 900 means the data may be up to 15 minutes old. Use this to interpret zero delivery: a value of 900 means zero impressions is likely real; a value of 14400 means reporting may still be catching up.
4160
3972
  */
4161
- bid_price?: number;
4162
- }[];
4163
- /**
4164
- * Keyword targets to remove from this package. Removes matching (keyword, match_type) pairs. If a specified pair is not present, sellers SHOULD treat it as a no-op for that entry.
4165
- */
4166
- keyword_targets_remove?: {
3973
+ staleness_seconds: number;
4167
3974
  /**
4168
- * The keyword to stop targeting
3975
+ * Total impressions delivered since package start
4169
3976
  */
4170
- keyword: string;
3977
+ impressions: number;
4171
3978
  /**
4172
- * Match type to remove
3979
+ * Total spend since package start, denominated in snapshot.currency when present, otherwise package.currency or media_buy.currency
4173
3980
  */
4174
- match_type: 'broad' | 'phrase' | 'exact';
4175
- }[];
4176
- /**
4177
- * Negative keywords to add to this package. Appends to the existing negative keyword list — does not replace it. If a keyword+match_type pair already exists, sellers SHOULD treat it as a no-op for that entry. Use targeting_overlay.negative_keywords in create_media_buy to set the initial list.
4178
- */
4179
- negative_keywords_add?: {
3981
+ spend: number;
4180
3982
  /**
4181
- * The keyword to exclude
3983
+ * ISO 4217 currency code for spend in this snapshot. Optional when unchanged from package.currency or media_buy.currency.
4182
3984
  */
4183
- keyword: string;
3985
+ currency?: string;
4184
3986
  /**
4185
- * Match type for exclusion
3987
+ * Total clicks since package start (when available)
4186
3988
  */
4187
- match_type: 'broad' | 'phrase' | 'exact';
4188
- }[];
4189
- /**
4190
- * Negative keywords to remove from this package. Removes matching keyword+match_type pairs from the existing list. If a specified pair is not present, sellers SHOULD treat it as a no-op for that entry.
4191
- */
4192
- negative_keywords_remove?: {
3989
+ clicks?: number;
4193
3990
  /**
4194
- * The keyword to stop excluding
3991
+ * Current delivery pace relative to expected (1.0 = on track, <1.0 = behind, >1.0 = ahead). Absent when pacing cannot be determined.
4195
3992
  */
4196
- keyword: string;
3993
+ pacing_index?: number;
4197
3994
  /**
4198
- * Match type to remove
3995
+ * Operational delivery state of this package. 'not_delivering' means the package is within its scheduled flight but has delivered zero impressions for at least one full staleness cycle — the signal for automated price adjustments or buyer alerts. Implementers must not return 'not_delivering' until at least staleness_seconds have elapsed since package activation.
4199
3996
  */
4200
- match_type: 'broad' | 'phrase' | 'exact';
4201
- }[];
4202
- /**
4203
- * Replace creative assignments for this package with optional weights and placement targeting. Uses replacement semantics - omit to leave assignments unchanged.
4204
- */
4205
- creative_assignments?: CreativeAssignment[];
4206
- /**
4207
- * Upload new creative assets and assign to this package (creatives will be added to library). Use creative_assignments instead for existing library creatives.
4208
- *
4209
- * @maxItems 100
4210
- */
4211
- creatives?: CreativeAsset[];
4212
- ext?: ExtensionObject;
4213
- } & {
4214
- [k: string]: unknown | undefined;
4215
- };
4216
- /**
4217
- * Response payload for update_media_buy task. Returns either complete success data OR error information, never both. This enforces atomic operation semantics - updates are either fully applied or not applied at all.
4218
- */
4219
- export type UpdateMediaBuyResponse = UpdateMediaBuySuccess | UpdateMediaBuyError;
4220
- /**
4221
- * Success response - media buy updated successfully
4222
- */
4223
- export interface UpdateMediaBuySuccess {
4224
- /**
4225
- * Publisher's identifier for the media buy
4226
- */
4227
- media_buy_id: string;
4228
- /**
4229
- * Buyer's reference identifier for the media buy
4230
- */
4231
- buyer_ref: string;
4232
- /**
4233
- * ISO 8601 timestamp when changes take effect (null if pending approval)
4234
- */
4235
- implementation_date?: string | null;
4236
- /**
4237
- * Array of packages that were modified with complete state information
4238
- */
4239
- affected_packages?: Package[];
4240
- /**
4241
- * When true, this response contains simulated data from sandbox mode.
4242
- */
4243
- sandbox?: boolean;
4244
- context?: ContextObject;
3997
+ delivery_status?: 'delivering' | 'not_delivering' | 'completed' | 'budget_exhausted' | 'flight_ended' | 'goal_met';
3998
+ ext?: ExtensionObject;
3999
+ };
4245
4000
  ext?: ExtensionObject;
4246
4001
  }
4247
4002
  /**
4248
- * Error response - operation failed, no changes applied
4003
+ * Attribution model to use. When omitted, the seller applies their default model.
4249
4004
  */
4250
- export interface UpdateMediaBuyError {
4251
- /**
4252
- * Array of errors explaining why the operation failed
4253
- */
4254
- errors: Error[];
4255
- context?: ContextObject;
4256
- ext?: ExtensionObject;
4257
- }
4005
+ export type AttributionModel = 'last_touch' | 'first_touch' | 'linear' | 'time_decay' | 'data_driven';
4258
4006
  /**
4259
- * Status of a media buy.
4007
+ * Metric to sort breakdown rows by (descending). Falls back to 'spend' if the seller does not report the requested metric.
4260
4008
  */
4261
- export type MediaBuyStatus = 'pending_activation' | 'active' | 'paused' | 'completed' | 'rejected' | 'canceled';
4009
+ export type SortMetric = 'impressions' | 'spend' | 'clicks' | 'ctr' | 'views' | 'completed_views' | 'completion_rate' | 'conversions' | 'conversion_value' | 'roas' | 'cost_per_acquisition' | 'new_to_brand_rate' | 'leads' | 'grps' | 'reach' | 'frequency' | 'engagements' | 'follows' | 'saves' | 'profile_visits' | 'engagement_rate' | 'cost_per_click';
4262
4010
  /**
4263
- * Request parameters for retrieving media buy status, creative approval state, and optional delivery snapshots
4011
+ * Request parameters for retrieving comprehensive delivery metrics
4264
4012
  */
4265
- export interface GetMediaBuysRequest {
4013
+ export interface GetMediaBuyDeliveryRequest {
4266
4014
  account?: AccountReference;
4267
4015
  /**
4268
- * Array of publisher media buy IDs to retrieve. When omitted along with buyer_refs, returns a paginated set of accessible media buys matching status_filter.
4016
+ * Array of publisher media buy IDs to get delivery data for
4269
4017
  */
4270
4018
  media_buy_ids?: string[];
4271
4019
  /**
4272
- * Array of buyer reference IDs to retrieve
4020
+ * Array of buyer reference IDs to get delivery data for
4273
4021
  */
4274
4022
  buyer_refs?: string[];
4275
4023
  /**
4276
- * Filter by status. Can be a single status or array of statuses. Defaults to ["active"] only when media_buy_ids and buyer_refs are both omitted. When media_buy_ids or buyer_refs are provided, no implicit status filter is applied.
4024
+ * Filter by status. Can be a single status or array of statuses
4277
4025
  */
4278
4026
  status_filter?: MediaBuyStatus | MediaBuyStatus[];
4279
4027
  /**
4280
- * When true, include a near-real-time delivery snapshot for each package. Snapshots reflect the latest available entity-level stats from the platform (e.g., updated every ~15 minutes on GAM, ~1 hour on batch-only platforms). The staleness_seconds field on each snapshot indicates data freshness. If a snapshot cannot be returned, package.snapshot_unavailable_reason explains why. Defaults to false.
4028
+ * Start date for reporting period (YYYY-MM-DD). When omitted along with end_date, returns campaign lifetime data. Only accepted when the product's reporting_capabilities.date_range_support is 'date_range'.
4281
4029
  */
4282
- include_snapshot?: boolean;
4283
- pagination?: PaginationRequest;
4284
- context?: ContextObject;
4285
- ext?: ExtensionObject;
4286
- }
4287
- /**
4288
- * Approval state of a creative on a specific package
4289
- */
4290
- export type CreativeApprovalStatus = 'pending_review' | 'approved' | 'rejected';
4291
- /**
4292
- * Response payload for get_media_buys task. Returns media buy configuration, creative approval state, and optional delivery snapshots.
4293
- */
4294
- export interface GetMediaBuysResponse {
4030
+ start_date?: string;
4295
4031
  /**
4296
- * Array of media buys with status, creative approval state, and optional delivery snapshots
4032
+ * End date for reporting period (YYYY-MM-DD). When omitted along with start_date, returns campaign lifetime data. Only accepted when the product's reporting_capabilities.date_range_support is 'date_range'.
4297
4033
  */
4298
- media_buys: {
4034
+ end_date?: string;
4035
+ /**
4036
+ * When true, include daily_breakdown arrays within each package in by_package. Useful for per-package pacing analysis and line-item monitoring. Omit or set false to reduce response size — package daily data can be large for multi-package buys over long flights.
4037
+ */
4038
+ include_package_daily_breakdown?: boolean;
4039
+ /**
4040
+ * Attribution window to apply for conversion metrics. When provided, the seller returns conversion data using the requested lookback windows instead of their platform default. The seller echoes the applied window in the response. Sellers that do not support configurable windows ignore this field and return their default. Check get_adcp_capabilities conversion_tracking.attribution_windows for available options.
4041
+ */
4042
+ attribution_window?: {
4299
4043
  /**
4300
- * Publisher's unique identifier for the media buy
4044
+ * Post-click attribution window to apply.
4301
4045
  */
4302
- media_buy_id: string;
4046
+ post_click?: Duration;
4303
4047
  /**
4304
- * Buyer's reference identifier for this media buy
4048
+ * Post-view attribution window to apply.
4305
4049
  */
4306
- buyer_ref?: string;
4050
+ post_view?: Duration;
4051
+ model?: AttributionModel;
4052
+ };
4053
+ /**
4054
+ * Request dimensional breakdowns in delivery reporting. Each key enables a specific breakdown dimension within by_package — include as an empty object (e.g., "device_type": {}) to activate with defaults. Omit entirely for no breakdowns (backward compatible). Unsupported dimensions are silently omitted from the response. Note: keyword, catalog_item, and creative breakdowns are returned automatically when the seller supports them and are not controlled by this object.
4055
+ */
4056
+ reporting_dimensions?: {
4307
4057
  /**
4308
- * Buyer campaign reference label sourced from create_media_buy.buyer_campaign_ref. Groups related operations under a single campaign; may be absent when not provided at creation time.
4058
+ * Request geographic breakdown. Check reporting_capabilities.supports_geo_breakdown for available levels and systems.
4309
4059
  */
4310
- buyer_campaign_ref?: string;
4311
- account?: Account;
4312
- status: MediaBuyStatus;
4060
+ geo?: {
4061
+ geo_level: GeographicTargetingLevel;
4062
+ /**
4063
+ * Classification system for metro or postal_area levels (e.g., 'nielsen_dma', 'us_zip'). Required when geo_level is 'metro' or 'postal_area'.
4064
+ */
4065
+ system?: MetroAreaSystem | PostalCodeSystem;
4066
+ /**
4067
+ * Maximum number of geo entries to return. Defaults to 25. When truncated, by_geo_truncated is true in the response.
4068
+ */
4069
+ limit?: number;
4070
+ sort_by?: SortMetric;
4071
+ };
4313
4072
  /**
4314
- * ISO 4217 currency code (e.g., USD, EUR, GBP) for monetary values at this media buy level. total_budget is always denominated in this currency. Package-level fields may override with package.currency.
4073
+ * Request device type breakdown.
4315
4074
  */
4316
- currency: string;
4075
+ device_type?: {
4076
+ /**
4077
+ * Maximum number of entries to return. When omitted, all entries are returned (the enum is small and bounded).
4078
+ */
4079
+ limit?: number;
4080
+ sort_by?: SortMetric;
4081
+ };
4317
4082
  /**
4318
- * Total budget amount across all packages, denominated in media_buy.currency
4319
- */
4320
- total_budget?: number;
4321
- /**
4322
- * ISO 8601 flight start time for this media buy (earliest package start_time). Avoids requiring buyers to compute min(packages[].start_time).
4323
- */
4324
- start_time?: string;
4325
- /**
4326
- * ISO 8601 flight end time for this media buy (latest package end_time). Avoids requiring buyers to compute max(packages[].end_time).
4327
- */
4328
- end_time?: string;
4329
- /**
4330
- * ISO 8601 timestamp for creative upload deadline
4331
- */
4332
- creative_deadline?: string;
4333
- /**
4334
- * Creation timestamp
4335
- */
4336
- created_at?: string;
4337
- /**
4338
- * Last update timestamp
4339
- */
4340
- updated_at?: string;
4341
- /**
4342
- * Packages within this media buy, augmented with creative approval status and optional delivery snapshots
4343
- */
4344
- packages: PackageStatus[];
4345
- ext?: ExtensionObject;
4346
- }[];
4347
- /**
4348
- * Task-specific errors (e.g., media buy not found)
4349
- */
4350
- errors?: Error[];
4351
- pagination?: PaginationResponse;
4352
- /**
4353
- * When true, this response contains simulated data from sandbox mode.
4354
- */
4355
- sandbox?: boolean;
4356
- context?: ContextObject;
4357
- ext?: ExtensionObject;
4358
- }
4359
- /**
4360
- * Current status of a package within a media buy — includes creative approval state and optional delivery snapshot. For the creation input shape, see PackageRequest. For the creation output shape, see Package.
4361
- */
4362
- export interface PackageStatus {
4363
- /**
4364
- * Publisher's package identifier
4365
- */
4366
- package_id: string;
4367
- /**
4368
- * Buyer's reference identifier for this package
4369
- */
4370
- buyer_ref?: string;
4371
- /**
4372
- * Product identifier this package is purchased from
4373
- */
4374
- product_id?: string;
4375
- /**
4376
- * Package budget amount, denominated in package.currency when present, otherwise media_buy.currency
4377
- */
4378
- budget?: number;
4379
- /**
4380
- * ISO 4217 currency code for monetary values at this package level (budget, bid_price, snapshot.spend). When absent, inherit media_buy.currency.
4381
- */
4382
- currency?: string;
4383
- /**
4384
- * Current bid price for auction-based packages. Denominated in package.currency when present, otherwise media_buy.currency. Relevant for automated price optimization loops.
4385
- */
4386
- bid_price?: number;
4387
- /**
4388
- * Goal impression count for impression-based packages
4389
- */
4390
- impressions?: number;
4391
- /**
4392
- * ISO 8601 flight start time for this package. Use to determine whether the package is within its scheduled flight before interpreting delivery status.
4393
- */
4394
- start_time?: string;
4395
- /**
4396
- * ISO 8601 flight end time for this package
4397
- */
4398
- end_time?: string;
4399
- /**
4400
- * Whether this package is currently paused by the buyer
4401
- */
4402
- paused?: boolean;
4403
- /**
4404
- * Approval status for each creative assigned to this package. Absent when no creatives have been assigned.
4405
- */
4406
- creative_approvals?: {
4407
- /**
4408
- * Creative identifier
4409
- */
4410
- creative_id: string;
4411
- approval_status?: CreativeApprovalStatus;
4412
- /**
4413
- * Human-readable explanation of why the creative was rejected. Present only when approval_status is 'rejected'.
4414
- */
4415
- rejection_reason?: string;
4416
- }[];
4417
- /**
4418
- * Format IDs from the original create_media_buy format_ids_to_provide that have not yet been uploaded via sync_creatives. When empty or absent, all required formats have been provided.
4419
- */
4420
- format_ids_pending?: FormatID[];
4421
- /**
4422
- * Machine-readable reason the snapshot is omitted. Present only when include_snapshot was true and snapshot is unavailable for this package.
4423
- */
4424
- snapshot_unavailable_reason?: 'SNAPSHOT_UNSUPPORTED' | 'SNAPSHOT_TEMPORARILY_UNAVAILABLE' | 'SNAPSHOT_PERMISSION_DENIED';
4425
- /**
4426
- * Near-real-time delivery snapshot for this package. Only present when include_snapshot was true in the request. Represents the latest available entity-level stats from the platform — not billing-grade data.
4427
- */
4428
- snapshot?: {
4429
- /**
4430
- * ISO 8601 timestamp when this snapshot was captured by the platform
4431
- */
4432
- as_of: string;
4433
- /**
4434
- * Maximum age of this data in seconds. For example, 900 means the data may be up to 15 minutes old. Use this to interpret zero delivery: a value of 900 means zero impressions is likely real; a value of 14400 means reporting may still be catching up.
4435
- */
4436
- staleness_seconds: number;
4437
- /**
4438
- * Total impressions delivered since package start
4439
- */
4440
- impressions: number;
4441
- /**
4442
- * Total spend since package start, denominated in snapshot.currency when present, otherwise package.currency or media_buy.currency
4443
- */
4444
- spend: number;
4445
- /**
4446
- * ISO 4217 currency code for spend in this snapshot. Optional when unchanged from package.currency or media_buy.currency.
4447
- */
4448
- currency?: string;
4449
- /**
4450
- * Total clicks since package start (when available)
4451
- */
4452
- clicks?: number;
4453
- /**
4454
- * Current delivery pace relative to expected (1.0 = on track, <1.0 = behind, >1.0 = ahead). Absent when pacing cannot be determined.
4455
- */
4456
- pacing_index?: number;
4457
- /**
4458
- * Operational delivery state of this package. 'not_delivering' means the package is within its scheduled flight but has delivered zero impressions for at least one full staleness cycle — the signal for automated price adjustments or buyer alerts. Implementers must not return 'not_delivering' until at least staleness_seconds have elapsed since package activation.
4459
- */
4460
- delivery_status?: 'delivering' | 'not_delivering' | 'completed' | 'budget_exhausted' | 'flight_ended' | 'goal_met';
4461
- ext?: ExtensionObject;
4462
- };
4463
- ext?: ExtensionObject;
4464
- }
4465
- /**
4466
- * Attribution model to use. When omitted, the seller applies their default model.
4467
- */
4468
- export type AttributionModel = 'last_touch' | 'first_touch' | 'linear' | 'time_decay' | 'data_driven';
4469
- /**
4470
- * Metric to sort breakdown rows by (descending). Falls back to 'spend' if the seller does not report the requested metric.
4471
- */
4472
- export type SortMetric = 'impressions' | 'spend' | 'clicks' | 'ctr' | 'views' | 'completed_views' | 'completion_rate' | 'conversions' | 'conversion_value' | 'roas' | 'cost_per_acquisition' | 'new_to_brand_rate' | 'leads' | 'grps' | 'reach' | 'frequency' | 'engagements' | 'follows' | 'saves' | 'profile_visits' | 'engagement_rate' | 'cost_per_click';
4473
- /**
4474
- * Request parameters for retrieving comprehensive delivery metrics
4475
- */
4476
- export interface GetMediaBuyDeliveryRequest {
4477
- account?: AccountReference;
4478
- /**
4479
- * Array of publisher media buy IDs to get delivery data for
4480
- */
4481
- media_buy_ids?: string[];
4482
- /**
4483
- * Array of buyer reference IDs to get delivery data for
4484
- */
4485
- buyer_refs?: string[];
4486
- /**
4487
- * Filter by status. Can be a single status or array of statuses
4488
- */
4489
- status_filter?: MediaBuyStatus | MediaBuyStatus[];
4490
- /**
4491
- * Start date for reporting period (YYYY-MM-DD). When omitted along with end_date, returns campaign lifetime data. Only accepted when the product's reporting_capabilities.date_range_support is 'date_range'.
4492
- */
4493
- start_date?: string;
4494
- /**
4495
- * End date for reporting period (YYYY-MM-DD). When omitted along with start_date, returns campaign lifetime data. Only accepted when the product's reporting_capabilities.date_range_support is 'date_range'.
4496
- */
4497
- end_date?: string;
4498
- /**
4499
- * When true, include daily_breakdown arrays within each package in by_package. Useful for per-package pacing analysis and line-item monitoring. Omit or set false to reduce response size — package daily data can be large for multi-package buys over long flights.
4500
- */
4501
- include_package_daily_breakdown?: boolean;
4502
- /**
4503
- * Attribution window to apply for conversion metrics. When provided, the seller returns conversion data using the requested lookback windows instead of their platform default. The seller echoes the applied window in the response. Sellers that do not support configurable windows ignore this field and return their default. Check get_adcp_capabilities conversion_tracking.attribution_windows for available options.
4504
- */
4505
- attribution_window?: {
4506
- /**
4507
- * Post-click attribution window to apply.
4508
- */
4509
- post_click?: Duration;
4510
- /**
4511
- * Post-view attribution window to apply.
4512
- */
4513
- post_view?: Duration;
4514
- model?: AttributionModel;
4515
- };
4516
- /**
4517
- * Request dimensional breakdowns in delivery reporting. Each key enables a specific breakdown dimension within by_package — include as an empty object (e.g., "device_type": {}) to activate with defaults. Omit entirely for no breakdowns (backward compatible). Unsupported dimensions are silently omitted from the response. Note: keyword, catalog_item, and creative breakdowns are returned automatically when the seller supports them and are not controlled by this object.
4518
- */
4519
- reporting_dimensions?: {
4520
- /**
4521
- * Request geographic breakdown. Check reporting_capabilities.supports_geo_breakdown for available levels and systems.
4522
- */
4523
- geo?: {
4524
- geo_level: GeographicTargetingLevel;
4525
- /**
4526
- * Classification system for metro or postal_area levels (e.g., 'nielsen_dma', 'us_zip'). Required when geo_level is 'metro' or 'postal_area'.
4527
- */
4528
- system?: MetroAreaSystem | PostalCodeSystem;
4529
- /**
4530
- * Maximum number of geo entries to return. Defaults to 25. When truncated, by_geo_truncated is true in the response.
4531
- */
4532
- limit?: number;
4533
- sort_by?: SortMetric;
4534
- };
4535
- /**
4536
- * Request device type breakdown.
4537
- */
4538
- device_type?: {
4539
- /**
4540
- * Maximum number of entries to return. When omitted, all entries are returned (the enum is small and bounded).
4541
- */
4542
- limit?: number;
4543
- sort_by?: SortMetric;
4544
- };
4545
- /**
4546
- * Request device platform breakdown.
4083
+ * Request device platform breakdown.
4547
4084
  */
4548
4085
  device_platform?: {
4549
4086
  /**
@@ -5737,6 +5274,10 @@ export interface SyncAudiencesError {
5737
5274
  context?: ContextObject;
5738
5275
  ext?: ExtensionObject;
5739
5276
  }
5277
+ /**
5278
+ * Validation strictness. 'strict' fails entire sync on any validation error. 'lenient' processes valid catalogs and reports errors.
5279
+ */
5280
+ export type ValidationMode = 'strict' | 'lenient';
5740
5281
  /**
5741
5282
  * Request parameters for syncing catalog feeds with upsert semantics. Supports bulk operations across multiple catalog types (products, inventory, stores, promotions, offerings). Existing catalogs matched by catalog_id are updated, new ones are created. When catalogs is omitted, the call is discovery-only: returns all catalogs on the account without modification.
5742
5283
  */
@@ -5831,672 +5372,1213 @@ export interface SyncCatalogsSuccess {
5831
5372
  reasons?: string[];
5832
5373
  }[];
5833
5374
  /**
5834
- * ISO 8601 timestamp of when the most recent sync was accepted by the platform
5375
+ * ISO 8601 timestamp of when the most recent sync was accepted by the platform
5376
+ */
5377
+ last_synced_at?: string;
5378
+ /**
5379
+ * ISO 8601 timestamp of when the platform will next fetch the feed URL. Only present for URL-based catalogs with update_frequency.
5380
+ */
5381
+ next_fetch_at?: string;
5382
+ /**
5383
+ * Field names that were modified (only present when action='updated')
5384
+ */
5385
+ changes?: string[];
5386
+ /**
5387
+ * Validation or processing errors (only present when action='failed')
5388
+ */
5389
+ errors?: string[];
5390
+ /**
5391
+ * Non-fatal warnings about this catalog
5392
+ */
5393
+ warnings?: string[];
5394
+ }[];
5395
+ /**
5396
+ * When true, this response contains simulated data from sandbox mode.
5397
+ */
5398
+ sandbox?: boolean;
5399
+ context?: ContextObject;
5400
+ ext?: ExtensionObject;
5401
+ }
5402
+ /**
5403
+ * Error response - operation failed completely, no catalogs were processed
5404
+ */
5405
+ export interface SyncCatalogsError {
5406
+ /**
5407
+ * Operation-level errors that prevented processing any catalogs (e.g., authentication failure, service unavailable, invalid request format)
5408
+ */
5409
+ errors: Error[];
5410
+ context?: ContextObject;
5411
+ ext?: ExtensionObject;
5412
+ }
5413
+ /**
5414
+ * Request to transform, generate, or retrieve a creative manifest. Supports three modes: (1) generation from a brief or seed assets, (2) transformation of an existing manifest, (3) retrieval from a creative library by creative_id. Produces target manifest(s) in the specified format(s). Provide either target_format_id for a single format or target_format_ids for multiple formats.
5415
+ */
5416
+ export type BuildCreativeRequest = {
5417
+ /**
5418
+ * Natural language instructions for the transformation or generation. For pure generation, this is the creative brief. For transformation, this provides guidance on how to adapt the creative. For refinement, this describes the desired changes.
5419
+ */
5420
+ message?: string;
5421
+ creative_manifest?: CreativeManifest;
5422
+ /**
5423
+ * Reference to a creative in the agent's library. The creative agent resolves this to a manifest from its library. Use this instead of creative_manifest when retrieving an existing creative for tag generation or format adaptation.
5424
+ */
5425
+ creative_id?: string;
5426
+ /**
5427
+ * Creative concept containing the creative. Creative agents SHOULD assign globally unique creative_id values; when they cannot guarantee uniqueness, concept_id is REQUIRED to disambiguate.
5428
+ */
5429
+ concept_id?: string;
5430
+ /**
5431
+ * Buyer's media buy reference for tag generation context. When the creative agent is also the ad server, this provides the trafficking context needed to generate placement-specific tags (e.g., CM360 placement ID). Not needed when tags are generated at the creative level (most creative platforms). This is the buyer's reference — the same value used as buyer_ref in create_media_buy.
5432
+ */
5433
+ media_buy_id?: string;
5434
+ /**
5435
+ * Buyer's package or line item reference within the media buy. Used with media_buy_id when the creative agent needs line-item-level context for tag generation. Omit to get a tag not scoped to a specific package.
5436
+ */
5437
+ package_id?: string;
5438
+ target_format_id?: FormatID;
5439
+ /**
5440
+ * Array of format IDs to generate in a single call. Mutually exclusive with target_format_id. The creative agent produces one manifest per format. Each format definition specifies its own required input assets and output structure.
5441
+ */
5442
+ target_format_ids?: FormatID[];
5443
+ brand?: BrandReference;
5444
+ quality?: CreativeQuality;
5445
+ /**
5446
+ * Maximum number of catalog items to use when generating. When a catalog asset contains more items than this limit, the creative agent selects the top items based on relevance or catalog ordering. When item_limit exceeds the format's max_items, the creative agent SHOULD use the lesser of the two. Ignored when the manifest contains no catalog assets.
5447
+ */
5448
+ item_limit?: number;
5449
+ /**
5450
+ * Macro values to pre-substitute into the output manifest's assets. Keys are universal macro names (e.g., CLICK_URL, CACHEBUSTER); values are the substitution strings. The creative agent translates universal macros to its platform's native syntax. Substitution is literal — all occurrences of each macro in output assets are replaced with the provided value. The caller is responsible for URL-encoding values if the output context requires it. Macros not provided here remain as {MACRO} placeholders for the sales agent to resolve at serve time. Creative agents MUST ignore keys they do not recognize — unknown macro names are not an error.
5451
+ */
5452
+ macro_values?: {
5453
+ [k: string]: string | undefined;
5454
+ };
5455
+ context?: ContextObject;
5456
+ ext?: ExtensionObject;
5457
+ } & ({
5458
+ target_format_ids?: never;
5459
+ } | {
5460
+ target_format_id?: never;
5461
+ });
5462
+ /**
5463
+ * Quality tier for generation. 'draft' produces fast, lower-fidelity output for iteration and review. 'production' produces full-quality output for final delivery. If omitted, the creative agent uses its own default. For non-generative transforms (e.g., format resizing), creative agents MAY ignore this field.
5464
+ */
5465
+ export type CreativeQuality = 'draft' | 'production';
5466
+ /**
5467
+ * Creative manifest to transform or generate from. For pure generation, this should include the target format_id and any required input assets. For transformation (e.g., resizing, reformatting), this is the complete creative to adapt. When creative_id is provided, the agent resolves the creative from its library and this field is ignored.
5468
+ */
5469
+ export interface CreativeManifest {
5470
+ format_id: FormatID;
5471
+ /**
5472
+ * Map of asset IDs to actual asset content. Each key MUST match an asset_id from the format's assets array (e.g., 'banner_image', 'clickthrough_url', 'video_file', 'vast_tag'). The asset_id is the technical identifier used to match assets to format requirements.
5473
+ *
5474
+ * IMPORTANT: Full validation requires format context. The format defines what type each asset_id should be. Standalone schema validation only checks structural conformance — each asset must match at least one valid asset type schema.
5475
+ */
5476
+ assets: {
5477
+ /**
5478
+ * This interface was referenced by `undefined`'s JSON-Schema definition
5479
+ * via the `patternProperty` "^[a-z0-9_]+$".
5480
+ */
5481
+ [k: string]: ImageAsset | VideoAsset | AudioAsset | VASTAsset | TextAsset | URLAsset | HTMLAsset | JavaScriptAsset | WebhookAsset | CSSAsset | DAASTAsset | MarkdownAsset | BriefAsset | CatalogAsset;
5482
+ };
5483
+ provenance?: Provenance;
5484
+ ext?: ExtensionObject;
5485
+ }
5486
+ /**
5487
+ * Response containing the transformed or generated creative manifest(s), ready for use with preview_creative or sync_creatives. Returns either a single creative_manifest, an array of creative_manifests (for multi-format requests), or error information.
5488
+ */
5489
+ export type BuildCreativeResponse = BuildCreativeSuccess | BuildCreativeMultiSuccess | BuildCreativeError;
5490
+ /**
5491
+ * Single-format success response. Returned when the request used target_format_id.
5492
+ */
5493
+ export interface BuildCreativeSuccess {
5494
+ creative_manifest: CreativeManifest;
5495
+ /**
5496
+ * When true, this response contains simulated data from sandbox mode.
5497
+ */
5498
+ sandbox?: boolean;
5499
+ /**
5500
+ * ISO 8601 timestamp when generated asset URLs in the manifest expire. Set to the earliest expiration across all generated assets. Re-build the creative after this time to get fresh URLs.
5501
+ */
5502
+ expires_at?: string;
5503
+ context?: ContextObject;
5504
+ ext?: ExtensionObject;
5505
+ }
5506
+ /**
5507
+ * Multi-format success response. Returned when the request used target_format_ids. Contains one manifest per requested format. Multi-format requests are atomic — all formats must succeed or the entire request fails with an error response. Array order corresponds to the target_format_ids request order.
5508
+ */
5509
+ export interface BuildCreativeMultiSuccess {
5510
+ /**
5511
+ * Array of generated creative manifests, one per requested format. Each manifest contains its own format_id identifying which format it was generated for.
5512
+ */
5513
+ creative_manifests: CreativeManifest[];
5514
+ /**
5515
+ * When true, this response contains simulated data from sandbox mode.
5516
+ */
5517
+ sandbox?: boolean;
5518
+ /**
5519
+ * ISO 8601 timestamp when the earliest generated asset URL expires across all manifests. Re-build after this time to get fresh URLs.
5520
+ */
5521
+ expires_at?: string;
5522
+ context?: ContextObject;
5523
+ ext?: ExtensionObject;
5524
+ }
5525
+ /**
5526
+ * Error response - creative generation failed
5527
+ */
5528
+ export interface BuildCreativeError {
5529
+ /**
5530
+ * Array of errors explaining why creative generation failed
5531
+ */
5532
+ errors: Error[];
5533
+ context?: ContextObject;
5534
+ ext?: ExtensionObject;
5535
+ }
5536
+ /**
5537
+ * Request to generate previews of one or more creative manifests. Accepts either a single creative request or an array of requests for batch processing.
5538
+ */
5539
+ export type PreviewCreativeRequest = {
5540
+ /**
5541
+ * Discriminator indicating this is a single preview request
5542
+ */
5543
+ request_type: 'single';
5544
+ format_id?: FormatID;
5545
+ creative_manifest: CreativeManifest;
5546
+ /**
5547
+ * Array of input sets for generating multiple preview variants. Each input set defines macros and context values for one preview rendering. If not provided, creative agent will generate default previews.
5548
+ */
5549
+ inputs?: {
5550
+ /**
5551
+ * Human-readable name for this input set (e.g., 'Sunny morning on mobile', 'Evening podcast ad', 'Desktop dark mode')
5552
+ */
5553
+ name: string;
5554
+ /**
5555
+ * Macro values to use for this preview. Supports all universal macros from the format's supported_macros list. See docs/creative/universal-macros.md for available macros.
5556
+ */
5557
+ macros?: {
5558
+ [k: string]: string | undefined;
5559
+ };
5560
+ /**
5561
+ * Natural language description of the context for AI-generated content (e.g., 'User just searched for running shoes', 'Podcast discussing weather patterns', 'Article about electric vehicles')
5562
+ */
5563
+ context_description?: string;
5564
+ }[];
5565
+ /**
5566
+ * Specific template ID for custom format rendering
5567
+ */
5568
+ template_id?: string;
5569
+ output_format?: PreviewOutputFormat;
5570
+ /**
5571
+ * Maximum number of catalog items to render in the preview. For catalog-driven generative formats, caps how many items are rendered per preview variant. When item_limit exceeds the format's max_items, the creative agent SHOULD use the lesser of the two. Ignored when the manifest contains no catalog assets. Creative agents SHOULD default to a reasonable sample when omitted and the catalog is large.
5572
+ */
5573
+ item_limit?: number;
5574
+ context?: ContextObject;
5575
+ ext?: ExtensionObject;
5576
+ } | {
5577
+ /**
5578
+ * Discriminator indicating this is a batch preview request
5579
+ */
5580
+ request_type: 'batch';
5581
+ /**
5582
+ * Array of preview requests (1-50 items). Each follows the single request structure.
5583
+ *
5584
+ * @maxItems 50
5585
+ */
5586
+ requests: {
5587
+ format_id?: FormatID;
5588
+ creative_manifest: CreativeManifest;
5589
+ /**
5590
+ * Array of input sets for generating multiple preview variants
5591
+ */
5592
+ inputs?: {
5593
+ /**
5594
+ * Human-readable name for this input set
5595
+ */
5596
+ name: string;
5597
+ /**
5598
+ * Macro values to use for this preview
5599
+ */
5600
+ macros?: {
5601
+ [k: string]: string | undefined;
5602
+ };
5603
+ /**
5604
+ * Natural language description of the context for AI-generated content
5605
+ */
5606
+ context_description?: string;
5607
+ }[];
5608
+ /**
5609
+ * Specific template ID for custom format rendering
5610
+ */
5611
+ template_id?: string;
5612
+ output_format?: PreviewOutputFormat;
5613
+ /**
5614
+ * Maximum number of catalog items to render in this preview.
5615
+ */
5616
+ item_limit?: number;
5617
+ }[];
5618
+ output_format?: PreviewOutputFormat;
5619
+ context?: ContextObject;
5620
+ ext?: ExtensionObject;
5621
+ } | {
5622
+ /**
5623
+ * Discriminator indicating this is a variant preview request
5624
+ */
5625
+ request_type: 'variant';
5626
+ /**
5627
+ * Platform-assigned variant identifier from get_creative_delivery response
5628
+ */
5629
+ variant_id: string;
5630
+ /**
5631
+ * Creative identifier for context
5632
+ */
5633
+ creative_id?: string;
5634
+ output_format?: PreviewOutputFormat;
5635
+ context?: ContextObject;
5636
+ ext?: ExtensionObject;
5637
+ };
5638
+ /**
5639
+ * Output format for previews. 'url' returns preview_url (iframe-embeddable URL), 'html' returns preview_html (raw HTML for direct embedding). Default: 'url' for backward compatibility.
5640
+ */
5641
+ export type PreviewOutputFormat = 'url' | 'html';
5642
+ /**
5643
+ * Response containing preview links for one or more creatives. Format matches the request: single preview response for single requests, batch results for batch requests.
5644
+ */
5645
+ export type PreviewCreativeResponse = PreviewCreativeSingleResponse | PreviewCreativeBatchResponse | PreviewCreativeVariantResponse;
5646
+ /**
5647
+ * A single rendered piece of a creative preview with discriminated output format
5648
+ */
5649
+ export type PreviewRender = {
5650
+ /**
5651
+ * Unique identifier for this rendered piece within the variant
5652
+ */
5653
+ render_id: string;
5654
+ /**
5655
+ * Discriminator indicating preview_url is provided
5656
+ */
5657
+ output_format: 'url';
5658
+ /**
5659
+ * URL to an HTML page that renders this piece. Can be embedded in an iframe.
5660
+ */
5661
+ preview_url: string;
5662
+ /**
5663
+ * Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.
5664
+ */
5665
+ role: string;
5666
+ /**
5667
+ * Dimensions for this rendered piece
5668
+ */
5669
+ dimensions?: {
5670
+ width: number;
5671
+ height: number;
5672
+ };
5673
+ /**
5674
+ * Optional security and embedding metadata for safe iframe integration
5675
+ */
5676
+ embedding?: {
5677
+ /**
5678
+ * Recommended iframe sandbox attribute value (e.g., 'allow-scripts allow-same-origin')
5679
+ */
5680
+ recommended_sandbox?: string;
5681
+ /**
5682
+ * Whether this output requires HTTPS for secure embedding
5683
+ */
5684
+ requires_https?: boolean;
5685
+ /**
5686
+ * Whether this output supports fullscreen mode
5687
+ */
5688
+ supports_fullscreen?: boolean;
5689
+ /**
5690
+ * Content Security Policy requirements for embedding
5691
+ */
5692
+ csp_policy?: string;
5693
+ };
5694
+ } | {
5695
+ /**
5696
+ * Unique identifier for this rendered piece within the variant
5697
+ */
5698
+ render_id: string;
5699
+ /**
5700
+ * Discriminator indicating preview_html is provided
5701
+ */
5702
+ output_format: 'html';
5703
+ /**
5704
+ * Raw HTML for this rendered piece. Can be embedded directly in the page without iframe. Security warning: Only use with trusted creative agents as this bypasses iframe sandboxing.
5705
+ */
5706
+ preview_html: string;
5707
+ /**
5708
+ * Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.
5709
+ */
5710
+ role: string;
5711
+ /**
5712
+ * Dimensions for this rendered piece
5713
+ */
5714
+ dimensions?: {
5715
+ width: number;
5716
+ height: number;
5717
+ };
5718
+ /**
5719
+ * Optional security and embedding metadata
5720
+ */
5721
+ embedding?: {
5722
+ /**
5723
+ * Recommended iframe sandbox attribute value (e.g., 'allow-scripts allow-same-origin')
5724
+ */
5725
+ recommended_sandbox?: string;
5726
+ /**
5727
+ * Whether this output requires HTTPS for secure embedding
5728
+ */
5729
+ requires_https?: boolean;
5730
+ /**
5731
+ * Whether this output supports fullscreen mode
5732
+ */
5733
+ supports_fullscreen?: boolean;
5734
+ /**
5735
+ * Content Security Policy requirements for embedding
5736
+ */
5737
+ csp_policy?: string;
5738
+ };
5739
+ } | {
5740
+ /**
5741
+ * Unique identifier for this rendered piece within the variant
5742
+ */
5743
+ render_id: string;
5744
+ /**
5745
+ * Discriminator indicating both preview_url and preview_html are provided
5746
+ */
5747
+ output_format: 'both';
5748
+ /**
5749
+ * URL to an HTML page that renders this piece. Can be embedded in an iframe.
5750
+ */
5751
+ preview_url: string;
5752
+ /**
5753
+ * Raw HTML for this rendered piece. Can be embedded directly in the page without iframe. Security warning: Only use with trusted creative agents as this bypasses iframe sandboxing.
5754
+ */
5755
+ preview_html: string;
5756
+ /**
5757
+ * Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.
5758
+ */
5759
+ role: string;
5760
+ /**
5761
+ * Dimensions for this rendered piece
5762
+ */
5763
+ dimensions?: {
5764
+ width: number;
5765
+ height: number;
5766
+ };
5767
+ /**
5768
+ * Optional security and embedding metadata for safe iframe integration
5769
+ */
5770
+ embedding?: {
5771
+ /**
5772
+ * Recommended iframe sandbox attribute value (e.g., 'allow-scripts allow-same-origin')
5773
+ */
5774
+ recommended_sandbox?: string;
5775
+ /**
5776
+ * Whether this output requires HTTPS for secure embedding
5777
+ */
5778
+ requires_https?: boolean;
5779
+ /**
5780
+ * Whether this output supports fullscreen mode
5781
+ */
5782
+ supports_fullscreen?: boolean;
5783
+ /**
5784
+ * Content Security Policy requirements for embedding
5785
+ */
5786
+ csp_policy?: string;
5787
+ };
5788
+ };
5789
+ /**
5790
+ * Single preview response - each preview URL returns an HTML page that can be embedded in an iframe
5791
+ */
5792
+ export interface PreviewCreativeSingleResponse {
5793
+ /**
5794
+ * Discriminator indicating this is a single preview response
5795
+ */
5796
+ response_type: 'single';
5797
+ /**
5798
+ * Array of preview variants. Each preview corresponds to an input set from the request. If no inputs were provided, returns a single default preview.
5799
+ */
5800
+ previews: {
5801
+ /**
5802
+ * Unique identifier for this preview variant
5803
+ */
5804
+ preview_id: string;
5805
+ /**
5806
+ * Array of rendered pieces for this preview variant. Most formats render as a single piece. Companion ad formats (video + banner), multi-placement formats, and adaptive formats render as multiple pieces.
5807
+ */
5808
+ renders: PreviewRender[];
5809
+ /**
5810
+ * The input parameters that generated this preview variant. Echoes back the request input or shows defaults used.
5811
+ */
5812
+ input: {
5813
+ /**
5814
+ * Human-readable name for this variant
5815
+ */
5816
+ name: string;
5817
+ /**
5818
+ * Macro values applied to this variant
5819
+ */
5820
+ macros?: {
5821
+ [k: string]: string | undefined;
5822
+ };
5823
+ /**
5824
+ * Context description applied to this variant
5825
+ */
5826
+ context_description?: string;
5827
+ };
5828
+ }[];
5829
+ /**
5830
+ * Optional URL to an interactive testing page that shows all preview variants with controls to switch between them, modify macro values, and test different scenarios.
5831
+ */
5832
+ interactive_url?: string;
5833
+ /**
5834
+ * ISO 8601 timestamp when preview links expire
5835
+ */
5836
+ expires_at: string;
5837
+ context?: ContextObject;
5838
+ ext?: ExtensionObject;
5839
+ }
5840
+ /**
5841
+ * Batch preview response - contains results for multiple creative requests
5842
+ */
5843
+ export interface PreviewCreativeBatchResponse {
5844
+ /**
5845
+ * Discriminator indicating this is a batch preview response
5846
+ */
5847
+ response_type: 'batch';
5848
+ /**
5849
+ * Array of preview results corresponding to each request in the same order. results[0] is the result for requests[0], results[1] for requests[1], etc. Order is guaranteed even when some requests fail. Each result contains either a successful preview response or an error.
5850
+ */
5851
+ results: (PreviewBatchResultSuccess | PreviewBatchResultError)[];
5852
+ context?: ContextObject;
5853
+ ext?: ExtensionObject;
5854
+ }
5855
+ export interface PreviewBatchResultSuccess {
5856
+ /**
5857
+ * Indicates this preview request succeeded
5858
+ */
5859
+ success?: true;
5860
+ }
5861
+ export interface PreviewBatchResultError {
5862
+ /**
5863
+ * Indicates this preview request failed
5864
+ */
5865
+ success?: false;
5866
+ }
5867
+ /**
5868
+ * Variant preview response - shows what a specific creative variant looked like when served during delivery
5869
+ */
5870
+ export interface PreviewCreativeVariantResponse {
5871
+ /**
5872
+ * Discriminator indicating this is a variant preview response
5873
+ */
5874
+ response_type: 'variant';
5875
+ /**
5876
+ * Platform-assigned variant identifier
5877
+ */
5878
+ variant_id: string;
5879
+ /**
5880
+ * Creative identifier this variant belongs to
5881
+ */
5882
+ creative_id?: string;
5883
+ /**
5884
+ * Array of rendered pieces for this variant. Most formats render as a single piece.
5885
+ */
5886
+ previews: {
5887
+ /**
5888
+ * Unique identifier for this preview
5889
+ */
5890
+ preview_id: string;
5891
+ /**
5892
+ * Rendered pieces for this variant
5893
+ */
5894
+ renders: PreviewRender[];
5895
+ }[];
5896
+ manifest?: CreativeManifest;
5897
+ /**
5898
+ * ISO 8601 timestamp when preview links expire
5899
+ */
5900
+ expires_at?: string;
5901
+ context?: ContextObject;
5902
+ ext?: ExtensionObject;
5903
+ }
5904
+ /**
5905
+ * Request parameters for retrieving creative delivery data including variant-level metrics from a creative agent. At least one scoping filter (media_buy_ids, media_buy_buyer_refs, or creative_ids) is required.
5906
+ */
5907
+ export type GetCreativeDeliveryRequest = {
5908
+ [k: string]: unknown | undefined;
5909
+ } & {
5910
+ account?: AccountReference;
5911
+ /**
5912
+ * Filter to specific media buys by publisher ID. If omitted, returns creative delivery across all matching media buys.
5913
+ */
5914
+ media_buy_ids?: string[];
5915
+ /**
5916
+ * Filter to specific media buys by buyer reference ID. Alternative to media_buy_ids when the buyer doesn't have the publisher's identifiers.
5917
+ */
5918
+ media_buy_buyer_refs?: string[];
5919
+ /**
5920
+ * Filter to specific creatives by ID. If omitted, returns delivery for all creatives matching the other filters.
5921
+ */
5922
+ creative_ids?: string[];
5923
+ /**
5924
+ * Start date for delivery period (YYYY-MM-DD). Interpreted in the platform's reporting timezone.
5925
+ */
5926
+ start_date?: string;
5927
+ /**
5928
+ * End date for delivery period (YYYY-MM-DD). Interpreted in the platform's reporting timezone.
5929
+ */
5930
+ end_date?: string;
5931
+ /**
5932
+ * Maximum number of variants to return per creative. When omitted, the agent returns all variants. Use this to limit response size for generative creatives that may produce large numbers of variants.
5933
+ */
5934
+ max_variants?: number;
5935
+ pagination?: PaginationRequest;
5936
+ context?: ContextObject;
5937
+ ext?: ExtensionObject;
5938
+ };
5939
+ /**
5940
+ * A specific execution variant of a creative with delivery metrics. For catalog-driven packages, each catalog item rendered as a distinct ad execution is a variant — the variant's manifest includes the catalog reference with the specific item rendered. For asset group optimization, represents one combination of assets the platform selected. For generative creative, represents a platform-generated variant. For standard creatives, maps 1:1 with the creative itself.
5941
+ */
5942
+ export type CreativeVariant = DeliveryMetrics & {
5943
+ /**
5944
+ * Platform-assigned identifier for this variant
5945
+ */
5946
+ variant_id: string;
5947
+ manifest?: CreativeManifest;
5948
+ /**
5949
+ * Input signals that triggered generation of this variant (Tier 3). Describes why the platform created this specific variant. Platforms should provide summarized or anonymized signals rather than raw user input. For web contexts, may include page topic or URL. For conversational contexts, an anonymized content signal. For search, query category or intent. When the content context is managed through AdCP content standards, reference the artifact directly via the artifact field.
5950
+ */
5951
+ generation_context?: {
5952
+ /**
5953
+ * Type of context that triggered generation (e.g., 'web_page', 'conversational', 'search', 'app', 'dooh')
5954
+ */
5955
+ context_type?: string;
5956
+ /**
5957
+ * Reference to the content-standards artifact that provided the generation context. Links this variant to the specific piece of content (article, video, podcast segment, etc.) where the ad was placed.
5958
+ */
5959
+ artifact?: {
5960
+ property_id: Identifier;
5961
+ /**
5962
+ * Artifact identifier within the property
5963
+ */
5964
+ artifact_id: string;
5965
+ };
5966
+ ext?: ExtensionObject;
5967
+ };
5968
+ };
5969
+ /**
5970
+ * Type of identifier
5971
+ */
5972
+ export type PropertyIdentifierTypes = 'domain' | 'subdomain' | 'network_id' | 'ios_bundle' | 'android_package' | 'apple_app_store_id' | 'google_play_id' | 'roku_store_id' | 'fire_tv_asin' | 'samsung_app_id' | 'apple_tv_bundle' | 'bundle_id' | 'venue_id' | 'screen_id' | 'openooh_venue_type' | 'rss_url' | 'apple_podcast_id' | 'spotify_show_id' | 'podcast_guid';
5973
+ /**
5974
+ * Response payload for get_creative_delivery task. Returns creative delivery data with variant-level breakdowns including manifests and metrics.
5975
+ */
5976
+ export interface GetCreativeDeliveryResponse {
5977
+ /**
5978
+ * Account identifier. Present when the response spans or is scoped to a specific account.
5979
+ */
5980
+ account_id?: string;
5981
+ /**
5982
+ * Publisher's media buy identifier. Present when the request was scoped to a single media buy.
5983
+ */
5984
+ media_buy_id?: string;
5985
+ /**
5986
+ * Buyer's reference identifier for the media buy. Echoed back so the buyer can correlate without mapping publisher IDs.
5987
+ */
5988
+ media_buy_buyer_ref?: string;
5989
+ /**
5990
+ * ISO 4217 currency code for monetary values in this response (e.g., 'USD', 'EUR')
5991
+ */
5992
+ currency: string;
5993
+ /**
5994
+ * Date range for the report.
5995
+ */
5996
+ reporting_period: {
5997
+ /**
5998
+ * ISO 8601 start timestamp
5999
+ */
6000
+ start: string;
6001
+ /**
6002
+ * ISO 8601 end timestamp
6003
+ */
6004
+ end: string;
6005
+ /**
6006
+ * IANA timezone identifier for the reporting period (e.g., 'America/New_York', 'UTC'). Platforms report in their native timezone.
6007
+ */
6008
+ timezone?: string;
6009
+ };
6010
+ /**
6011
+ * Creative delivery data with variant breakdowns
6012
+ */
6013
+ creatives: {
6014
+ /**
6015
+ * Creative identifier
6016
+ */
6017
+ creative_id: string;
6018
+ /**
6019
+ * Publisher's media buy identifier for this creative. Present when the request spanned multiple media buys, so the buyer can correlate each creative to its media buy.
6020
+ */
6021
+ media_buy_id?: string;
6022
+ format_id?: FormatID;
6023
+ totals?: DeliveryMetrics;
6024
+ /**
6025
+ * Total number of variants for this creative. When max_variants was specified in the request, this may exceed the number of items in the variants array.
5835
6026
  */
5836
- last_synced_at?: string;
6027
+ variant_count?: number;
5837
6028
  /**
5838
- * ISO 8601 timestamp of when the platform will next fetch the feed URL. Only present for URL-based catalogs with update_frequency.
6029
+ * Variant-level delivery breakdown. Each variant includes the rendered manifest and delivery metrics. For standard creatives, contains a single variant. For asset group optimization, one per combination. For generative creative, one per generated execution. Empty when a creative has no variants yet.
5839
6030
  */
5840
- next_fetch_at?: string;
6031
+ variants: CreativeVariant[];
6032
+ }[];
6033
+ /**
6034
+ * Pagination information. Present when the request included pagination parameters.
6035
+ */
6036
+ pagination?: {
5841
6037
  /**
5842
- * Field names that were modified (only present when action='updated')
6038
+ * Maximum number of creatives requested
5843
6039
  */
5844
- changes?: string[];
6040
+ limit: number;
5845
6041
  /**
5846
- * Validation or processing errors (only present when action='failed')
6042
+ * Number of creatives skipped
5847
6043
  */
5848
- errors?: string[];
6044
+ offset: number;
5849
6045
  /**
5850
- * Non-fatal warnings about this catalog
6046
+ * Whether more creatives are available beyond this page
5851
6047
  */
5852
- warnings?: string[];
5853
- }[];
6048
+ has_more: boolean;
6049
+ /**
6050
+ * Total number of creatives matching the request filters
6051
+ */
6052
+ total?: number;
6053
+ };
5854
6054
  /**
5855
- * When true, this response contains simulated data from sandbox mode.
6055
+ * Task-specific errors and warnings
5856
6056
  */
5857
- sandbox?: boolean;
6057
+ errors?: Error[];
5858
6058
  context?: ContextObject;
5859
6059
  ext?: ExtensionObject;
5860
6060
  }
5861
6061
  /**
5862
- * Error response - operation failed completely, no catalogs were processed
6062
+ * Property where the artifact appears
5863
6063
  */
5864
- export interface SyncCatalogsError {
6064
+ export interface Identifier {
6065
+ type: PropertyIdentifierTypes;
5865
6066
  /**
5866
- * Operation-level errors that prevented processing any catalogs (e.g., authentication failure, service unavailable, invalid request format)
6067
+ * The identifier value. For domain type: 'example.com' matches base domain plus www and m subdomains; 'edition.example.com' matches that specific subdomain; '*.example.com' matches ALL subdomains but NOT base domain
5867
6068
  */
5868
- errors: Error[];
5869
- context?: ContextObject;
5870
- ext?: ExtensionObject;
6069
+ value: string;
5871
6070
  }
5872
6071
  /**
5873
- * Quality tier for generation. 'draft' produces fast, lower-fidelity output for iteration and review. 'production' produces full-quality output for final delivery. If omitted, the creative agent uses its own default. For non-generative transforms (e.g., format resizing), creative agents MAY ignore this field.
6072
+ * Field to sort by
5874
6073
  */
5875
- export type CreativeQuality = 'draft' | 'production';
6074
+ export type CreativeSortField = 'created_date' | 'updated_date' | 'name' | 'status' | 'assignment_count';
6075
+ /**
6076
+ * Sort direction
6077
+ */
6078
+ export type SortDirection = 'asc' | 'desc';
5876
6079
  /**
5877
- * Request to transform or generate a creative manifest. Takes a source manifest (which may be minimal for pure generation) and produces a target manifest in the specified format.
6080
+ * Request parameters for querying creative assets from a creative library with filtering, sorting, and pagination. Implemented by any agent that hosts a creative library creative agents (ad servers, creative platforms) and sales agents that manage creatives.
5878
6081
  */
5879
- export interface BuildCreativeRequest {
6082
+ export interface ListCreativesRequest {
6083
+ filters?: CreativeFilters;
5880
6084
  /**
5881
- * Natural language instructions for the transformation or generation. For pure generation, this is the creative brief. For transformation, this provides guidance on how to adapt the creative. For refinement, this describes the desired changes.
6085
+ * Sorting parameters
5882
6086
  */
5883
- message?: string;
5884
- creative_manifest?: CreativeManifest;
5885
- target_format_id: FormatID;
5886
- brand?: BrandReference;
5887
- quality?: CreativeQuality;
6087
+ sort?: {
6088
+ field?: CreativeSortField;
6089
+ direction?: SortDirection;
6090
+ };
6091
+ pagination?: PaginationRequest;
5888
6092
  /**
5889
- * Maximum number of catalog items to use when generating. When a catalog asset contains more items than this limit, the creative agent selects the top items based on relevance or catalog ordering. When item_limit exceeds the format's max_items, the creative agent SHOULD use the lesser of the two. Ignored when the manifest contains no catalog assets.
6093
+ * Include package assignment information in response
5890
6094
  */
5891
- item_limit?: number;
5892
- context?: ContextObject;
5893
- ext?: ExtensionObject;
5894
- }
5895
- /**
5896
- * Creative manifest to transform or generate from. For pure generation, this should include the target format_id and any required input assets. For transformation (e.g., resizing, reformatting), this is the complete creative to adapt.
5897
- */
5898
- export interface CreativeManifest {
5899
- format_id: FormatID;
6095
+ include_assignments?: boolean;
5900
6096
  /**
5901
- * Map of asset IDs to actual asset content. Each key MUST match an asset_id from the format's assets array (e.g., 'banner_image', 'clickthrough_url', 'video_file', 'vast_tag'). The asset_id is the technical identifier used to match assets to format requirements.
5902
- *
5903
- * IMPORTANT: Full validation requires format context. The format defines what type each asset_id should be. Standalone schema validation only checks structural conformance — each asset must match at least one valid asset type schema.
6097
+ * Include a lightweight delivery snapshot per creative (lifetime impressions and last-served date). For detailed performance analytics, use get_creative_delivery.
5904
6098
  */
5905
- assets: {
5906
- /**
5907
- * This interface was referenced by `undefined`'s JSON-Schema definition
5908
- * via the `patternProperty` "^[a-z0-9_]+$".
5909
- */
5910
- [k: string]: ImageAsset | VideoAsset | AudioAsset | VASTAsset | TextAsset | URLAsset | HTMLAsset | JavaScriptAsset | WebhookAsset | CSSAsset | DAASTAsset | MarkdownAsset | BriefAsset | CatalogAsset;
5911
- };
5912
- provenance?: Provenance;
5913
- ext?: ExtensionObject;
5914
- }
5915
- /**
5916
- * Response containing the transformed or generated creative manifest, ready for use with preview_creative or sync_creatives. Returns either the complete creative manifest OR error information, never both.
5917
- */
5918
- export type BuildCreativeResponse = BuildCreativeSuccess | BuildCreativeError;
5919
- /**
5920
- * Success response - creative manifest generated successfully
5921
- */
5922
- export interface BuildCreativeSuccess {
5923
- creative_manifest: CreativeManifest;
6099
+ include_snapshot?: boolean;
5924
6100
  /**
5925
- * When true, this response contains simulated data from sandbox mode.
6101
+ * Include items for multi-asset formats like carousels and native ads
5926
6102
  */
5927
- sandbox?: boolean;
6103
+ include_items?: boolean;
5928
6104
  /**
5929
- * ISO 8601 timestamp when generated asset URLs in the manifest expire. Set to the earliest expiration across all generated assets. Re-build the creative after this time to get fresh URLs.
6105
+ * Include dynamic content variable definitions (DCO slots) for each creative
5930
6106
  */
5931
- expires_at?: string;
5932
- context?: ContextObject;
5933
- ext?: ExtensionObject;
5934
- }
5935
- /**
5936
- * Error response - creative generation failed
5937
- */
5938
- export interface BuildCreativeError {
6107
+ include_variables?: boolean;
5939
6108
  /**
5940
- * Array of errors explaining why creative generation failed
6109
+ * Specific fields to include in response (omit for all fields). The 'concept' value returns both concept_id and concept_name.
5941
6110
  */
5942
- errors: Error[];
6111
+ fields?: ('creative_id' | 'name' | 'format_id' | 'status' | 'created_date' | 'updated_date' | 'tags' | 'assignments' | 'snapshot' | 'items' | 'variables' | 'concept')[];
5943
6112
  context?: ContextObject;
5944
6113
  ext?: ExtensionObject;
5945
6114
  }
5946
6115
  /**
5947
- * Request to generate previews of one or more creative manifests. Accepts either a single creative request or an array of requests for batch processing.
6116
+ * Filter criteria for querying creatives from a creative library. By default, archived creatives are excluded from results. To include archived creatives, explicitly filter by status='archived' or include 'archived' in the statuses array.
5948
6117
  */
5949
- export type PreviewCreativeRequest = {
5950
- /**
5951
- * Discriminator indicating this is a single preview request
5952
- */
5953
- request_type: 'single';
5954
- format_id?: FormatID;
5955
- creative_manifest: CreativeManifest;
6118
+ export interface CreativeFilters {
5956
6119
  /**
5957
- * Array of input sets for generating multiple preview variants. Each input set defines macros and context values for one preview rendering. If not provided, creative agent will generate default previews.
6120
+ * Filter creatives by owning accounts. Useful for agencies managing multiple client accounts.
5958
6121
  */
5959
- inputs?: {
5960
- /**
5961
- * Human-readable name for this input set (e.g., 'Sunny morning on mobile', 'Evening podcast ad', 'Desktop dark mode')
5962
- */
5963
- name: string;
5964
- /**
5965
- * Macro values to use for this preview. Supports all universal macros from the format's supported_macros list. See docs/creative/universal-macros.md for available macros.
5966
- */
5967
- macros?: {
5968
- [k: string]: string | undefined;
5969
- };
5970
- /**
5971
- * Natural language description of the context for AI-generated content (e.g., 'User just searched for running shoes', 'Podcast discussing weather patterns', 'Article about electric vehicles')
5972
- */
5973
- context_description?: string;
5974
- }[];
6122
+ accounts?: AccountReference[];
5975
6123
  /**
5976
- * Specific template ID for custom format rendering
6124
+ * Filter by high-level format types (e.g., 'video', 'audio', 'display'). For specific format matching, use format_ids instead.
5977
6125
  */
5978
- template_id?: string;
5979
- output_format?: PreviewOutputFormat;
6126
+ format_types?: string[];
5980
6127
  /**
5981
- * Maximum number of catalog items to render in the preview. For catalog-driven generative formats, caps how many items are rendered per preview variant. When item_limit exceeds the format's max_items, the creative agent SHOULD use the lesser of the two. Ignored when the manifest contains no catalog assets. Creative agents SHOULD default to a reasonable sample when omitted and the catalog is large.
6128
+ * Filter by creative approval statuses
5982
6129
  */
5983
- item_limit?: number;
5984
- context?: ContextObject;
5985
- ext?: ExtensionObject;
5986
- } | {
6130
+ statuses?: CreativeStatus[];
5987
6131
  /**
5988
- * Discriminator indicating this is a batch preview request
6132
+ * Filter by creative tags (all tags must match)
5989
6133
  */
5990
- request_type: 'batch';
6134
+ tags?: string[];
5991
6135
  /**
5992
- * Array of preview requests (1-50 items). Each follows the single request structure.
5993
- *
5994
- * @maxItems 50
6136
+ * Filter by creative tags (any tag must match)
5995
6137
  */
5996
- requests: {
5997
- format_id?: FormatID;
5998
- creative_manifest: CreativeManifest1;
5999
- /**
6000
- * Array of input sets for generating multiple preview variants
6001
- */
6002
- inputs?: {
6003
- /**
6004
- * Human-readable name for this input set
6005
- */
6006
- name: string;
6007
- /**
6008
- * Macro values to use for this preview
6009
- */
6010
- macros?: {
6011
- [k: string]: string | undefined;
6012
- };
6013
- /**
6014
- * Natural language description of the context for AI-generated content
6015
- */
6016
- context_description?: string;
6017
- }[];
6018
- /**
6019
- * Specific template ID for custom format rendering
6020
- */
6021
- template_id?: string;
6022
- output_format?: PreviewOutputFormat;
6023
- /**
6024
- * Maximum number of catalog items to render in this preview.
6025
- */
6026
- item_limit?: number;
6027
- }[];
6028
- output_format?: PreviewOutputFormat;
6029
- context?: ContextObject;
6030
- ext?: ExtensionObject;
6031
- } | {
6138
+ tags_any?: string[];
6032
6139
  /**
6033
- * Discriminator indicating this is a variant preview request
6140
+ * Filter by creative names containing this text (case-insensitive)
6034
6141
  */
6035
- request_type: 'variant';
6142
+ name_contains?: string;
6036
6143
  /**
6037
- * Platform-assigned variant identifier from get_creative_delivery response
6144
+ * Filter by specific creative IDs
6145
+ *
6146
+ * @maxItems 100
6038
6147
  */
6039
- variant_id: string;
6148
+ creative_ids?: string[];
6040
6149
  /**
6041
- * Creative identifier for context
6150
+ * Filter creatives created after this date (ISO 8601)
6042
6151
  */
6043
- creative_id?: string;
6044
- output_format?: PreviewOutputFormat;
6045
- context?: ContextObject;
6046
- ext?: ExtensionObject;
6047
- };
6048
- /**
6049
- * Output format for previews. 'url' returns preview_url (iframe-embeddable URL), 'html' returns preview_html (raw HTML for direct embedding). Default: 'url' for backward compatibility.
6050
- */
6051
- export type PreviewOutputFormat = 'url' | 'html';
6052
- /**
6053
- * Complete creative manifest with all required assets.
6054
- */
6055
- export interface CreativeManifest1 {
6056
- format_id: FormatID;
6152
+ created_after?: string;
6057
6153
  /**
6058
- * Map of asset IDs to actual asset content. Each key MUST match an asset_id from the format's assets array (e.g., 'banner_image', 'clickthrough_url', 'video_file', 'vast_tag'). The asset_id is the technical identifier used to match assets to format requirements.
6059
- *
6060
- * IMPORTANT: Full validation requires format context. The format defines what type each asset_id should be. Standalone schema validation only checks structural conformance — each asset must match at least one valid asset type schema.
6154
+ * Filter creatives created before this date (ISO 8601)
6061
6155
  */
6062
- assets: {
6063
- /**
6064
- * This interface was referenced by `undefined`'s JSON-Schema definition
6065
- * via the `patternProperty` "^[a-z0-9_]+$".
6066
- */
6067
- [k: string]: ImageAsset | VideoAsset | AudioAsset | VASTAsset | TextAsset | URLAsset | HTMLAsset | JavaScriptAsset | WebhookAsset | CSSAsset | DAASTAsset | MarkdownAsset | BriefAsset | CatalogAsset;
6068
- };
6069
- provenance?: Provenance;
6070
- ext?: ExtensionObject;
6071
- }
6072
- /**
6073
- * Response containing preview links for one or more creatives. Format matches the request: single preview response for single requests, batch results for batch requests.
6074
- */
6075
- export type PreviewCreativeResponse = PreviewCreativeSingleResponse | PreviewCreativeBatchResponse | PreviewCreativeVariantResponse;
6076
- /**
6077
- * A single rendered piece of a creative preview with discriminated output format
6078
- */
6079
- export type PreviewRender = {
6156
+ created_before?: string;
6080
6157
  /**
6081
- * Unique identifier for this rendered piece within the variant
6158
+ * Filter creatives last updated after this date (ISO 8601)
6082
6159
  */
6083
- render_id: string;
6160
+ updated_after?: string;
6084
6161
  /**
6085
- * Discriminator indicating preview_url is provided
6162
+ * Filter creatives last updated before this date (ISO 8601)
6086
6163
  */
6087
- output_format: 'url';
6164
+ updated_before?: string;
6088
6165
  /**
6089
- * URL to an HTML page that renders this piece. Can be embedded in an iframe.
6166
+ * Filter creatives assigned to any of these packages. Sales-agent-specific standalone creative agents SHOULD ignore this filter.
6090
6167
  */
6091
- preview_url: string;
6168
+ assigned_to_packages?: string[];
6092
6169
  /**
6093
- * Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.
6170
+ * Filter creatives assigned to any of these media buys. Sales-agent-specific standalone creative agents SHOULD ignore this filter.
6094
6171
  */
6095
- role: string;
6172
+ media_buy_ids?: string[];
6096
6173
  /**
6097
- * Dimensions for this rendered piece
6174
+ * Filter creatives assigned to media buys with any of these buyer references. Sales-agent-specific — standalone creative agents SHOULD ignore this filter.
6098
6175
  */
6099
- dimensions?: {
6100
- width: number;
6101
- height: number;
6102
- };
6176
+ buyer_refs?: string[];
6103
6177
  /**
6104
- * Optional security and embedding metadata for safe iframe integration
6178
+ * Filter for unassigned creatives when true, assigned creatives when false. Sales-agent-specific — standalone creative agents SHOULD ignore this filter.
6105
6179
  */
6106
- embedding?: {
6107
- /**
6108
- * Recommended iframe sandbox attribute value (e.g., 'allow-scripts allow-same-origin')
6109
- */
6110
- recommended_sandbox?: string;
6111
- /**
6112
- * Whether this output requires HTTPS for secure embedding
6113
- */
6114
- requires_https?: boolean;
6115
- /**
6116
- * Whether this output supports fullscreen mode
6117
- */
6118
- supports_fullscreen?: boolean;
6119
- /**
6120
- * Content Security Policy requirements for embedding
6121
- */
6122
- csp_policy?: string;
6123
- };
6124
- } | {
6180
+ unassigned?: boolean;
6125
6181
  /**
6126
- * Unique identifier for this rendered piece within the variant
6182
+ * When true, return only creatives that have served at least one impression. When false, return only creatives that have never served.
6127
6183
  */
6128
- render_id: string;
6184
+ has_served?: boolean;
6129
6185
  /**
6130
- * Discriminator indicating preview_html is provided
6186
+ * Filter by creative concept IDs. Concepts group related creatives across sizes and formats (e.g., Flashtalking concepts, Celtra campaign folders, CM360 creative groups).
6131
6187
  */
6132
- output_format: 'html';
6188
+ concept_ids?: string[];
6133
6189
  /**
6134
- * Raw HTML for this rendered piece. Can be embedded directly in the page without iframe. Security warning: Only use with trusted creative agents as this bypasses iframe sandboxing.
6190
+ * Filter by structured format IDs. Returns creatives that match any of these formats.
6135
6191
  */
6136
- preview_html: string;
6192
+ format_ids?: FormatID[];
6137
6193
  /**
6138
- * Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.
6194
+ * When true, return only creatives with dynamic variables (DCO). When false, return only static creatives.
6139
6195
  */
6140
- role: string;
6196
+ has_variables?: boolean;
6197
+ }
6198
+ /**
6199
+ * Item within a multi-asset creative format. Used for carousel products, native ad components, and other formats composed of multiple distinct elements.
6200
+ */
6201
+ export type CreativeItem = {
6141
6202
  /**
6142
- * Dimensions for this rendered piece
6203
+ * Discriminator indicating this is a media asset with content_uri
6143
6204
  */
6144
- dimensions?: {
6145
- width: number;
6146
- height: number;
6147
- };
6205
+ asset_kind: 'media';
6148
6206
  /**
6149
- * Optional security and embedding metadata
6207
+ * Type of asset. Common types: thumbnail_image, product_image, featured_image, logo
6150
6208
  */
6151
- embedding?: {
6152
- /**
6153
- * Recommended iframe sandbox attribute value (e.g., 'allow-scripts allow-same-origin')
6154
- */
6155
- recommended_sandbox?: string;
6156
- /**
6157
- * Whether this output requires HTTPS for secure embedding
6158
- */
6159
- requires_https?: boolean;
6160
- /**
6161
- * Whether this output supports fullscreen mode
6162
- */
6163
- supports_fullscreen?: boolean;
6164
- /**
6165
- * Content Security Policy requirements for embedding
6166
- */
6167
- csp_policy?: string;
6168
- };
6169
- } | {
6209
+ asset_type: string;
6170
6210
  /**
6171
- * Unique identifier for this rendered piece within the variant
6211
+ * Unique identifier for the asset within the creative
6172
6212
  */
6173
- render_id: string;
6213
+ asset_id: string;
6174
6214
  /**
6175
- * Discriminator indicating both preview_url and preview_html are provided
6215
+ * URL for media assets (images, videos, etc.)
6176
6216
  */
6177
- output_format: 'both';
6217
+ content_uri: string;
6218
+ } | {
6178
6219
  /**
6179
- * URL to an HTML page that renders this piece. Can be embedded in an iframe.
6220
+ * Discriminator indicating this is a text asset with content
6180
6221
  */
6181
- preview_url: string;
6222
+ asset_kind: 'text';
6182
6223
  /**
6183
- * Raw HTML for this rendered piece. Can be embedded directly in the page without iframe. Security warning: Only use with trusted creative agents as this bypasses iframe sandboxing.
6224
+ * Type of asset. Common types: headline, body_text, cta_text, price_text, sponsor_name, author_name, click_url
6184
6225
  */
6185
- preview_html: string;
6226
+ asset_type: string;
6186
6227
  /**
6187
- * Semantic role of this rendered piece. Use 'primary' for main content, 'companion' for associated banners, descriptive strings for device variants or custom roles.
6228
+ * Unique identifier for the asset within the creative
6188
6229
  */
6189
- role: string;
6230
+ asset_id: string;
6190
6231
  /**
6191
- * Dimensions for this rendered piece
6232
+ * Text content for text-based assets like headlines, body text, CTA text, etc.
6192
6233
  */
6193
- dimensions?: {
6194
- width: number;
6195
- height: number;
6196
- };
6234
+ content: string | string[];
6235
+ };
6236
+ /**
6237
+ * Response from creative library query with filtered results, metadata, and optional enriched data
6238
+ */
6239
+ export interface ListCreativesResponse {
6197
6240
  /**
6198
- * Optional security and embedding metadata for safe iframe integration
6241
+ * Summary of the query that was executed
6199
6242
  */
6200
- embedding?: {
6243
+ query_summary: {
6201
6244
  /**
6202
- * Recommended iframe sandbox attribute value (e.g., 'allow-scripts allow-same-origin')
6245
+ * Total number of creatives matching filters (across all pages)
6203
6246
  */
6204
- recommended_sandbox?: string;
6247
+ total_matching: number;
6205
6248
  /**
6206
- * Whether this output requires HTTPS for secure embedding
6249
+ * Number of creatives returned in this response
6207
6250
  */
6208
- requires_https?: boolean;
6251
+ returned: number;
6209
6252
  /**
6210
- * Whether this output supports fullscreen mode
6253
+ * List of filters that were applied to the query
6211
6254
  */
6212
- supports_fullscreen?: boolean;
6255
+ filters_applied?: string[];
6213
6256
  /**
6214
- * Content Security Policy requirements for embedding
6257
+ * Sort order that was applied
6215
6258
  */
6216
- csp_policy?: string;
6259
+ sort_applied?: {
6260
+ field?: string;
6261
+ direction?: SortDirection;
6262
+ };
6217
6263
  };
6218
- };
6219
- /**
6220
- * Single preview response - each preview URL returns an HTML page that can be embedded in an iframe
6221
- */
6222
- export interface PreviewCreativeSingleResponse {
6223
- /**
6224
- * Discriminator indicating this is a single preview response
6225
- */
6226
- response_type: 'single';
6264
+ pagination: PaginationResponse;
6227
6265
  /**
6228
- * Array of preview variants. Each preview corresponds to an input set from the request. If no inputs were provided, returns a single default preview.
6266
+ * Array of creative assets matching the query
6229
6267
  */
6230
- previews: {
6268
+ creatives: {
6231
6269
  /**
6232
- * Unique identifier for this preview variant
6270
+ * Unique identifier for the creative
6233
6271
  */
6234
- preview_id: string;
6272
+ creative_id: string;
6273
+ account?: Account;
6235
6274
  /**
6236
- * Array of rendered pieces for this preview variant. Most formats render as a single piece. Companion ad formats (video + banner), multi-placement formats, and adaptive formats render as multiple pieces.
6275
+ * Human-readable creative name
6237
6276
  */
6238
- renders: PreviewRender[];
6277
+ name: string;
6278
+ format_id: FormatID;
6279
+ status: CreativeStatus;
6239
6280
  /**
6240
- * The input parameters that generated this preview variant. Echoes back the request input or shows defaults used.
6281
+ * When the creative was created
6241
6282
  */
6242
- input: {
6283
+ created_date: string;
6284
+ /**
6285
+ * When the creative was last modified
6286
+ */
6287
+ updated_date: string;
6288
+ /**
6289
+ * Assets for this creative, keyed by asset_id
6290
+ */
6291
+ assets?: {
6243
6292
  /**
6244
- * Human-readable name for this variant
6293
+ * This interface was referenced by `undefined`'s JSON-Schema definition
6294
+ * via the `patternProperty` "^[a-z0-9_]+$".
6245
6295
  */
6246
- name: string;
6296
+ [k: string]: ImageAsset | VideoAsset | AudioAsset | VASTAsset | TextAsset | URLAsset | HTMLAsset | JavaScriptAsset | WebhookAsset | CSSAsset | DAASTAsset | MarkdownAsset | BriefAsset | CatalogAsset;
6297
+ };
6298
+ /**
6299
+ * User-defined tags for organization and searchability
6300
+ */
6301
+ tags?: string[];
6302
+ /**
6303
+ * Creative concept this creative belongs to. Concepts group related creatives across sizes and formats.
6304
+ */
6305
+ concept_id?: string;
6306
+ /**
6307
+ * Human-readable concept name
6308
+ */
6309
+ concept_name?: string;
6310
+ /**
6311
+ * Dynamic content variables (DCO slots) for this creative. Included when include_variables=true.
6312
+ */
6313
+ variables?: CreativeVariable[];
6314
+ /**
6315
+ * Current package assignments (included when include_assignments=true)
6316
+ */
6317
+ assignments?: {
6247
6318
  /**
6248
- * Macro values applied to this variant
6319
+ * Total number of active package assignments
6249
6320
  */
6250
- macros?: {
6251
- [k: string]: string | undefined;
6252
- };
6321
+ assignment_count: number;
6253
6322
  /**
6254
- * Context description applied to this variant
6323
+ * List of packages this creative is assigned to
6255
6324
  */
6256
- context_description?: string;
6325
+ assigned_packages?: {
6326
+ /**
6327
+ * Package identifier
6328
+ */
6329
+ package_id: string;
6330
+ /**
6331
+ * Buyer's reference identifier for this package
6332
+ */
6333
+ buyer_ref?: string;
6334
+ /**
6335
+ * When this assignment was created
6336
+ */
6337
+ assigned_date: string;
6338
+ }[];
6339
+ };
6340
+ /**
6341
+ * Lightweight delivery snapshot (included when include_snapshot=true). For detailed performance analytics, use get_creative_delivery.
6342
+ */
6343
+ snapshot?: {
6344
+ /**
6345
+ * When this snapshot was captured by the platform
6346
+ */
6347
+ as_of: string;
6348
+ /**
6349
+ * Maximum age of this data in seconds. For example, 3600 means the data may be up to 1 hour old.
6350
+ */
6351
+ staleness_seconds: number;
6352
+ /**
6353
+ * Lifetime impressions across all assignments. Not scoped to any date range.
6354
+ */
6355
+ impressions: number;
6356
+ /**
6357
+ * Last time this creative served an impression. Absent when the creative has never served.
6358
+ */
6359
+ last_served?: string;
6257
6360
  };
6361
+ /**
6362
+ * Machine-readable reason the snapshot is omitted. Present only when include_snapshot was true and snapshot data is unavailable for this creative.
6363
+ */
6364
+ snapshot_unavailable_reason?: 'SNAPSHOT_UNSUPPORTED' | 'SNAPSHOT_TEMPORARILY_UNAVAILABLE' | 'SNAPSHOT_PERMISSION_DENIED';
6365
+ /**
6366
+ * Items for multi-asset formats like carousels and native ads (included when include_items=true)
6367
+ */
6368
+ items?: CreativeItem[];
6258
6369
  }[];
6259
6370
  /**
6260
- * Optional URL to an interactive testing page that shows all preview variants with controls to switch between them, modify macro values, and test different scenarios.
6371
+ * Breakdown of creatives by format. Keys are agent-defined format identifiers, optionally including dimensions (e.g., 'display_static_300x250', 'video_30s_vast'). Key construction is platform-specific there is no required format.
6372
+ */
6373
+ format_summary?: {
6374
+ /**
6375
+ * Number of creatives with this format
6376
+ *
6377
+ * This interface was referenced by `undefined`'s JSON-Schema definition
6378
+ * via the `patternProperty` "^[a-zA-Z0-9_-]+$".
6379
+ */
6380
+ [k: string]: number | undefined;
6381
+ };
6382
+ /**
6383
+ * Breakdown of creatives by status
6384
+ */
6385
+ status_summary?: {
6386
+ /**
6387
+ * Number of creatives being processed
6388
+ */
6389
+ processing?: number;
6390
+ /**
6391
+ * Number of approved creatives
6392
+ */
6393
+ approved?: number;
6394
+ /**
6395
+ * Number of creatives pending review
6396
+ */
6397
+ pending_review?: number;
6398
+ /**
6399
+ * Number of rejected creatives
6400
+ */
6401
+ rejected?: number;
6402
+ /**
6403
+ * Number of archived creatives
6404
+ */
6405
+ archived?: number;
6406
+ };
6407
+ /**
6408
+ * Task-specific errors (e.g., invalid filters, account not found)
6261
6409
  */
6262
- interactive_url?: string;
6410
+ errors?: Error[];
6263
6411
  /**
6264
- * ISO 8601 timestamp when preview links expire
6412
+ * When true, this response contains simulated data from sandbox mode.
6265
6413
  */
6266
- expires_at: string;
6414
+ sandbox?: boolean;
6267
6415
  context?: ContextObject;
6268
6416
  ext?: ExtensionObject;
6269
6417
  }
6270
6418
  /**
6271
- * Batch preview response - contains results for multiple creative requests
6419
+ * A dynamic content variable (DCO slot) on a creative. Variables represent content that can change at serve time — headlines, images, product data, etc.
6272
6420
  */
6273
- export interface PreviewCreativeBatchResponse {
6421
+ export interface CreativeVariable {
6274
6422
  /**
6275
- * Discriminator indicating this is a batch preview response
6423
+ * Variable identifier on the creative platform
6276
6424
  */
6277
- response_type: 'batch';
6425
+ variable_id: string;
6278
6426
  /**
6279
- * Array of preview results corresponding to each request in the same order. results[0] is the result for requests[0], results[1] for requests[1], etc. Order is guaranteed even when some requests fail. Each result contains either a successful preview response or an error.
6427
+ * Human-readable variable name
6280
6428
  */
6281
- results: (PreviewBatchResultSuccess | PreviewBatchResultError)[];
6282
- context?: ContextObject;
6283
- ext?: ExtensionObject;
6284
- }
6285
- export interface PreviewBatchResultSuccess {
6429
+ name: string;
6286
6430
  /**
6287
- * Indicates this preview request succeeded
6431
+ * Data type of the variable. Each type represents a semantic content slot: text (headlines, body copy), image/video/audio (media URLs), url (clickthrough or tracking URLs), number (prices, counts), boolean (conditional flags like show_discount or is_raining), color (hex color values), date (ISO 8601 date-time for countdowns and offer expirations).
6288
6432
  */
6289
- success?: true;
6290
- }
6291
- export interface PreviewBatchResultError {
6433
+ variable_type: 'text' | 'image' | 'video' | 'audio' | 'url' | 'number' | 'boolean' | 'color' | 'date';
6292
6434
  /**
6293
- * Indicates this preview request failed
6435
+ * Default value used when no dynamic value is provided at serve time. All types are string-encoded: text/image/video/audio/url as literal strings, number as decimal (e.g., "42.99"), boolean as "true"/"false", color as "#RRGGBB", date as ISO 8601 (e.g., "2026-12-25T00:00:00Z").
6294
6436
  */
6295
- success?: false;
6437
+ default_value?: string;
6438
+ /**
6439
+ * Whether this variable must have a value for the creative to serve
6440
+ */
6441
+ required?: boolean;
6296
6442
  }
6297
6443
  /**
6298
- * Variant preview response - shows what a specific creative variant looked like when served during delivery
6444
+ * Request parameters for syncing creative assets with upsert semantics - supports bulk operations, scoped updates, and assignment management
6299
6445
  */
6300
- export interface PreviewCreativeVariantResponse {
6301
- /**
6302
- * Discriminator indicating this is a variant preview response
6303
- */
6304
- response_type: 'variant';
6446
+ export interface SyncCreativesRequest {
6447
+ account: AccountReference;
6305
6448
  /**
6306
- * Platform-assigned variant identifier
6449
+ * Array of creative assets to sync (create or update)
6450
+ *
6451
+ * @maxItems 100
6307
6452
  */
6308
- variant_id: string;
6453
+ creatives: CreativeAsset[];
6309
6454
  /**
6310
- * Creative identifier this variant belongs to
6455
+ * Optional filter to limit sync scope to specific creative IDs. When provided, only these creatives will be created/updated. Other creatives in the library are unaffected. Useful for partial updates and error recovery.
6456
+ *
6457
+ * @maxItems 100
6311
6458
  */
6312
- creative_id?: string;
6459
+ creative_ids?: string[];
6313
6460
  /**
6314
- * Array of rendered pieces for this variant. Most formats render as a single piece.
6461
+ * Optional bulk assignment of creatives to packages. Each entry maps one creative to one package with optional weight and placement targeting. Standalone creative agents that do not manage media buys ignore this field.
6315
6462
  */
6316
- previews: {
6463
+ assignments?: {
6317
6464
  /**
6318
- * Unique identifier for this preview
6465
+ * ID of the creative to assign
6319
6466
  */
6320
- preview_id: string;
6467
+ creative_id: string;
6321
6468
  /**
6322
- * Rendered pieces for this variant
6469
+ * ID of the package to assign the creative to
6323
6470
  */
6324
- renders: PreviewRender[];
6471
+ package_id: string;
6472
+ /**
6473
+ * Relative delivery weight (0-100). When multiple creatives are assigned to the same package, weights determine impression distribution proportionally. When omitted, the creative receives equal rotation with other unweighted creatives. A weight of 0 means the creative is assigned but paused (receives no delivery).
6474
+ */
6475
+ weight?: number;
6476
+ /**
6477
+ * Restrict this creative to specific placements within the package. When omitted, the creative is eligible for all placements.
6478
+ */
6479
+ placement_ids?: string[];
6325
6480
  }[];
6326
- manifest?: CreativeManifest;
6327
- /**
6328
- * ISO 8601 timestamp when preview links expire
6329
- */
6330
- expires_at?: string;
6331
- context?: ContextObject;
6332
- ext?: ExtensionObject;
6333
- }
6334
- /**
6335
- * Request parameters for retrieving creative delivery data including variant-level metrics from a creative agent. At least one scoping filter (media_buy_ids, media_buy_buyer_refs, or creative_ids) is required.
6336
- */
6337
- export type GetCreativeDeliveryRequest = {
6338
- [k: string]: unknown | undefined;
6339
- } & {
6340
- account?: AccountReference;
6341
- /**
6342
- * Filter to specific media buys by publisher ID. If omitted, returns creative delivery across all matching media buys.
6343
- */
6344
- media_buy_ids?: string[];
6345
- /**
6346
- * Filter to specific media buys by buyer reference ID. Alternative to media_buy_ids when the buyer doesn't have the publisher's identifiers.
6347
- */
6348
- media_buy_buyer_refs?: string[];
6349
- /**
6350
- * Filter to specific creatives by ID. If omitted, returns delivery for all creatives matching the other filters.
6351
- */
6352
- creative_ids?: string[];
6353
6481
  /**
6354
- * Start date for delivery period (YYYY-MM-DD). Interpreted in the platform's reporting timezone.
6482
+ * Client-generated idempotency key for safe retries. If a sync fails without a response, resending with the same idempotency_key guarantees at-most-once execution.
6355
6483
  */
6356
- start_date?: string;
6484
+ idempotency_key?: string;
6357
6485
  /**
6358
- * End date for delivery period (YYYY-MM-DD). Interpreted in the platform's reporting timezone.
6486
+ * When true, creatives not included in this sync will be archived. Use with caution for full library replacement. Invalid when creative_ids is provided — delete_missing applies to the entire library scope, not a filtered subset.
6359
6487
  */
6360
- end_date?: string;
6488
+ delete_missing?: boolean;
6361
6489
  /**
6362
- * Maximum number of variants to return per creative. When omitted, the agent returns all variants. Use this to limit response size for generative creatives that may produce large numbers of variants.
6490
+ * When true, preview changes without applying them. Returns what would be created/updated/deleted.
6363
6491
  */
6364
- max_variants?: number;
6365
- pagination?: PaginationRequest;
6492
+ dry_run?: boolean;
6493
+ validation_mode?: ValidationMode;
6494
+ push_notification_config?: PushNotificationConfig;
6366
6495
  context?: ContextObject;
6367
6496
  ext?: ExtensionObject;
6368
- };
6497
+ }
6369
6498
  /**
6370
- * A specific execution variant of a creative with delivery metrics. For catalog-driven packages, each catalog item rendered as a distinct ad execution is a variant — the variant's manifest includes the catalog reference with the specific item rendered. For asset group optimization, represents one combination of assets the platform selected. For generative creative, represents a platform-generated variant. For standard creatives, maps 1:1 with the creative itself.
6499
+ * Response from creative sync operation. Returns either per-creative results (best-effort processing) OR operation-level errors (complete failure). This enforces atomic semantics at the operation level while allowing per-item failures within successful operations.
6371
6500
  */
6372
- export type CreativeVariant = DeliveryMetrics & {
6373
- /**
6374
- * Platform-assigned identifier for this variant
6375
- */
6376
- variant_id: string;
6377
- manifest?: CreativeManifest;
6378
- /**
6379
- * Input signals that triggered generation of this variant (Tier 3). Describes why the platform created this specific variant. Platforms should provide summarized or anonymized signals rather than raw user input. For web contexts, may include page topic or URL. For conversational contexts, an anonymized content signal. For search, query category or intent. When the content context is managed through AdCP content standards, reference the artifact directly via the artifact field.
6380
- */
6381
- generation_context?: {
6382
- /**
6383
- * Type of context that triggered generation (e.g., 'web_page', 'conversational', 'search', 'app', 'dooh')
6384
- */
6385
- context_type?: string;
6386
- /**
6387
- * Reference to the content-standards artifact that provided the generation context. Links this variant to the specific piece of content (article, video, podcast segment, etc.) where the ad was placed.
6388
- */
6389
- artifact?: {
6390
- property_id: Identifier;
6391
- /**
6392
- * Artifact identifier within the property
6393
- */
6394
- artifact_id: string;
6395
- };
6396
- ext?: ExtensionObject;
6397
- };
6398
- };
6501
+ export type SyncCreativesResponse = SyncCreativesSuccess | SyncCreativesError;
6399
6502
  /**
6400
- * Type of identifier
6503
+ * Action taken for this creative
6401
6504
  */
6402
- export type PropertyIdentifierTypes = 'domain' | 'subdomain' | 'network_id' | 'ios_bundle' | 'android_package' | 'apple_app_store_id' | 'google_play_id' | 'roku_store_id' | 'fire_tv_asin' | 'samsung_app_id' | 'apple_tv_bundle' | 'bundle_id' | 'venue_id' | 'screen_id' | 'openooh_venue_type' | 'rss_url' | 'apple_podcast_id' | 'spotify_show_id' | 'podcast_guid';
6505
+ export type CreativeAction = 'created' | 'updated' | 'unchanged' | 'failed' | 'deleted';
6403
6506
  /**
6404
- * Response payload for get_creative_delivery task. Returns creative delivery data with variant-level breakdowns including manifests and metrics.
6507
+ * Success response - sync operation processed creatives (may include per-item failures)
6405
6508
  */
6406
- export interface GetCreativeDeliveryResponse {
6407
- /**
6408
- * Account identifier. Present when the response spans or is scoped to a specific account.
6409
- */
6410
- account_id?: string;
6411
- /**
6412
- * Publisher's media buy identifier. Present when the request was scoped to a single media buy.
6413
- */
6414
- media_buy_id?: string;
6415
- /**
6416
- * Buyer's reference identifier for the media buy. Echoed back so the buyer can correlate without mapping publisher IDs.
6417
- */
6418
- media_buy_buyer_ref?: string;
6419
- /**
6420
- * ISO 4217 currency code for monetary values in this response (e.g., 'USD', 'EUR')
6421
- */
6422
- currency: string;
6509
+ export interface SyncCreativesSuccess {
6423
6510
  /**
6424
- * Date range for the report.
6511
+ * Whether this was a dry run (no actual changes made)
6425
6512
  */
6426
- reporting_period: {
6427
- /**
6428
- * ISO 8601 start timestamp
6429
- */
6430
- start: string;
6431
- /**
6432
- * ISO 8601 end timestamp
6433
- */
6434
- end: string;
6435
- /**
6436
- * IANA timezone identifier for the reporting period (e.g., 'America/New_York', 'UTC'). Platforms report in their native timezone.
6437
- */
6438
- timezone?: string;
6439
- };
6513
+ dry_run?: boolean;
6440
6514
  /**
6441
- * Creative delivery data with variant breakdowns
6515
+ * Results for each creative processed. Items with action='failed' indicate per-item validation/processing failures, not operation-level failures.
6442
6516
  */
6443
6517
  creatives: {
6444
6518
  /**
6445
- * Creative identifier
6519
+ * Creative ID from the request
6446
6520
  */
6447
6521
  creative_id: string;
6522
+ account?: Account;
6523
+ action: CreativeAction;
6448
6524
  /**
6449
- * Publisher's media buy identifier for this creative. Present when the request spanned multiple media buys, so the buyer can correlate each creative to its media buy.
6525
+ * Platform-specific ID assigned to the creative
6450
6526
  */
6451
- media_buy_id?: string;
6452
- format_id?: FormatID;
6453
- totals?: DeliveryMetrics;
6527
+ platform_id?: string;
6454
6528
  /**
6455
- * Total number of variants for this creative. When max_variants was specified in the request, this may exceed the number of items in the variants array.
6529
+ * Field names that were modified (only present when action='updated')
6456
6530
  */
6457
- variant_count?: number;
6531
+ changes?: string[];
6458
6532
  /**
6459
- * Variant-level delivery breakdown. Each variant includes the rendered manifest and delivery metrics. For standard creatives, contains a single variant. For asset group optimization, one per combination. For generative creative, one per generated execution. Empty when a creative has no variants yet.
6533
+ * Validation or processing errors (only present when action='failed')
6460
6534
  */
6461
- variants: CreativeVariant[];
6462
- }[];
6463
- /**
6464
- * Pagination information. Present when the request included pagination parameters.
6465
- */
6466
- pagination?: {
6535
+ errors?: string[];
6467
6536
  /**
6468
- * Maximum number of creatives requested
6537
+ * Non-fatal warnings about this creative
6469
6538
  */
6470
- limit: number;
6539
+ warnings?: string[];
6471
6540
  /**
6472
- * Number of creatives skipped
6541
+ * Preview URL for generative creatives (only present for generative formats)
6473
6542
  */
6474
- offset: number;
6543
+ preview_url?: string;
6475
6544
  /**
6476
- * Whether more creatives are available beyond this page
6545
+ * ISO 8601 timestamp when preview link expires (only present when preview_url exists)
6477
6546
  */
6478
- has_more: boolean;
6547
+ expires_at?: string;
6479
6548
  /**
6480
- * Total number of creatives matching the request filters
6549
+ * Package IDs this creative was successfully assigned to (only present when assignments were requested)
6481
6550
  */
6482
- total?: number;
6483
- };
6551
+ assigned_to?: string[];
6552
+ /**
6553
+ * Assignment errors by package ID (only present when assignment failures occurred)
6554
+ */
6555
+ assignment_errors?: {
6556
+ /**
6557
+ * Error message for this package assignment
6558
+ *
6559
+ * This interface was referenced by `undefined`'s JSON-Schema definition
6560
+ * via the `patternProperty` "^[a-zA-Z0-9_-]+$".
6561
+ */
6562
+ [k: string]: string | undefined;
6563
+ };
6564
+ }[];
6484
6565
  /**
6485
- * Task-specific errors and warnings
6566
+ * When true, this response contains simulated data from sandbox mode.
6486
6567
  */
6487
- errors?: Error[];
6568
+ sandbox?: boolean;
6488
6569
  context?: ContextObject;
6489
6570
  ext?: ExtensionObject;
6490
6571
  }
6491
6572
  /**
6492
- * Property where the artifact appears
6573
+ * Error response - operation failed completely, no creatives were processed
6493
6574
  */
6494
- export interface Identifier {
6495
- type: PropertyIdentifierTypes;
6575
+ export interface SyncCreativesError {
6496
6576
  /**
6497
- * The identifier value. For domain type: 'example.com' matches base domain plus www and m subdomains; 'edition.example.com' matches that specific subdomain; '*.example.com' matches ALL subdomains but NOT base domain
6577
+ * Operation-level errors that prevented processing any creatives (e.g., authentication failure, service unavailable, invalid request format)
6498
6578
  */
6499
- value: string;
6579
+ errors: Error[];
6580
+ context?: ContextObject;
6581
+ ext?: ExtensionObject;
6500
6582
  }
6501
6583
  /**
6502
6584
  * Request parameters for discovering and refining signals. Use signal_spec for natural language discovery, signal_ids for exact lookups, or both to refine previous results (signal_ids anchor the starting set, signal_spec guides adjustments).
@@ -9150,6 +9232,18 @@ export interface GetAdCPCapabilitiesResponse {
9150
9232
  * When true, this creative agent can process briefs with compliance requirements (required_disclosures, prohibited_claims) and will validate that disclosures can be satisfied by the target format.
9151
9233
  */
9152
9234
  supports_compliance?: boolean;
9235
+ /**
9236
+ * When true, this agent hosts a creative library and supports list_creatives and creative_id references in build_creative. Creative agents with a library should also implement the accounts protocol (sync_accounts / list_accounts) so buyers can establish access.
9237
+ */
9238
+ has_creative_library?: boolean;
9239
+ /**
9240
+ * When true, this agent can generate creatives from natural language briefs via build_creative. The buyer provides a message with creative direction, and the agent produces a manifest with generated assets. When false, build_creative only supports transformation or library retrieval.
9241
+ */
9242
+ supports_generation?: boolean;
9243
+ /**
9244
+ * When true, this agent can transform or resize existing manifests via build_creative. The buyer provides a creative_manifest and a target_format_id, and the agent adapts the creative to the new format.
9245
+ */
9246
+ supports_transformation?: boolean;
9153
9247
  };
9154
9248
  /**
9155
9249
  * Extension namespaces this agent supports. Buyers can expect meaningful data in ext.{namespace} fields on responses from this agent. Extension schemas are published in the AdCP extension registry.
@@ -9217,6 +9311,10 @@ export interface SyncAccountsRequest {
9217
9311
  * Who should be invoiced. operator: seller invoices the operator (agency or brand buying direct). agent: agent consolidates billing across brands. The seller must either accept this billing model or reject the request.
9218
9312
  */
9219
9313
  billing: 'operator' | 'agent';
9314
+ /**
9315
+ * Payment terms for this account. The seller must either accept these terms or reject the account — terms are never silently remapped. When omitted, the seller applies its default terms.
9316
+ */
9317
+ payment_terms?: 'net_15' | 'net_30' | 'net_45' | 'net_60' | 'net_90' | 'prepay';
9220
9318
  /**
9221
9319
  * When true, provision this as a sandbox account with no real platform calls or billing. Only applicable to implicit accounts (require_operator_auth: false). For explicit accounts, sandbox accounts are pre-existing test accounts discovered via list_accounts.
9222
9320
  */
@@ -9297,9 +9395,9 @@ export interface SyncAccountsSuccess {
9297
9395
  */
9298
9396
  rate_card?: string;
9299
9397
  /**
9300
- * Payment terms (e.g., 'net_30', 'prepay')
9398
+ * Payment terms agreed for this account. When the account is active, these are the binding terms for all invoices on this account.
9301
9399
  */
9302
- payment_terms?: string;
9400
+ payment_terms?: 'net_15' | 'net_30' | 'net_45' | 'net_60' | 'net_90' | 'prepay';
9303
9401
  credit_limit?: {
9304
9402
  amount: number;
9305
9403
  currency: string;
@@ -9497,9 +9595,9 @@ export interface GetAccountFinancialsSuccess {
9497
9595
  */
9498
9596
  payment_status?: 'current' | 'past_due' | 'suspended';
9499
9597
  /**
9500
- * Payment terms in effect (e.g., 'net_30', 'prepay')
9598
+ * Payment terms in effect for this account
9501
9599
  */
9502
- payment_terms?: string;
9600
+ payment_terms?: 'net_15' | 'net_30' | 'net_45' | 'net_60' | 'net_90' | 'prepay';
9503
9601
  /**
9504
9602
  * Recent invoices. Sellers may limit the number returned.
9505
9603
  */