@adcp/sdk API Reference - v14.3.0
    Preparing search index...

    Interface LegacyPackageUpdate

    Package update configuration for update_media_buy. Identifies package by package_id and specifies fields to modify. Fields not present are left unchanged. Fully-immutable fields (product_id, format_ids, format_option_refs, format_kind, params, pricing_option_id) cannot appear in update payloads — schema-enforced via the not constraint at the root of this object. Pre-GA capability_ids is also rejected rather than accepted as an extension. The reporting contract field committed_metrics is append-only (sellers MUST accept new entries on update but reject attempts to modify or remove existing entries with validation_error per its own description).

    interface LegacyPackageUpdate {
        package_id: string;
        budget?: number | null;
        min_spend_target?: number | null;
        pacing?: Pacing;
        bid_price?: number;
        bidding?:
            | {
                automatic?: true;
                bid_amount?: number;
                max_bid?: number;
                cost_per?: { amount: number; strength: "cap"
                | "target" };
                roas?: { value: number; strength: "target" | "floor" };
            }
            | null;
        impressions?: number;
        daily_budget_cap?: number
        | null;
        start_time?: string;
        end_time?: string;
        paused?: boolean;
        canceled?: true;
        cancellation_reason?: string;
        catalogs?: Catalog[];
        optimization_goals?: OptimizationGoal[];
        targeting_overlay?: TargetingOverlayInput;
        keyword_targets_add?: {
            keyword: string;
            match_type: MatchType;
            bid_price?: number;
        }[];
        keyword_targets_remove?: { keyword: string; match_type: MatchType }[];
        negative_keywords_add?: { keyword: string; match_type: MatchType }[];
        negative_keywords_remove?: { keyword: string; match_type: MatchType }[];
        creative_assignments?: {
            creative_id: string;
            weight?: number;
            rotation_mode?: "random" | "even" | "weighted" | "sequential";
            group_id?: string;
            sequence_position?: number;
            placement_refs?: [PlacementReference, ...PlacementReference[]];
            placement_ids?: [string, ...string[]];
        }[];
        creatives?: LegacyCompatibleCreativeAsset[];
        context?: ContextObject;
        ext?: ExtensionObject;
    }
    Index
    package_id: string

    Seller's ID of package to update

    budget?: number | null

    Updated hard spend cap for this package in the media-buy currency. Every selected pricing option in an AdCP-authored media buy MUST declare that same currency. In seller-optimized mode a number changes the package ceiling and null removes it so only the shared total and other constraints bound the package. null is invalid when the resulting allocation mode is fixed. A number in a resulting seller-optimized buy requires advertised media_buy.features.seller_optimized_package_budgets; otherwise rejected with UNSUPPORTED_FEATURE before any over-subscription validation.

    0

    min_spend_target?: number | null

    Updated soft lifetime spend target for this package. A number is valid only for seller-optimized allocation, requires advertised media_buy.features.seller_optimized_min_spend_targets (otherwise UNSUPPORTED_FEATURE, before any over-subscription validation), and must not exceed the resulting package budget when one exists. null removes the target. Sellers MUST validate the complete post-update state atomically.

    0

    pacing?: Pacing
    bid_price?: number

    DEPRECATED in 3.2 and removed in the next major. Use bidding. A package update MUST NOT supply both a non-null bidding object and bid_price. During migration, bidding:null MAY accompany bid_price to clear the canonical block and set the legacy representation atomically.

    0

    bidding?:
        | {
            automatic?: true;
            bid_amount?: number;
            max_bid?: number;
            cost_per?: { amount: number; strength: "cap"
            | "target" };
            roas?: { value: number; strength: "target" | "floor" };
        }
        | null

    Replace the complete package-authored bidding policy. An object replaces any prior package block and remains a complete override of the media-buy default. {automatic:true} explicitly selects provider automatic bidding at package scope. null clears the package-authored block so the package inherits media-buy bidding; if the media-buy block is also absent, provider automatic delivery applies. Monetary fields use the media-buy currency and require the package pricing option to declare that currency. During legacy migration, null MAY accompany bid_price or monetary optimization-goal targets; only a non-null canonical bidding object conflicts with those representations.

    Type Declaration

    • {
          automatic?: true;
          bid_amount?: number;
          max_bid?: number;
          cost_per?: { amount: number; strength: "cap" | "target" };
          roas?: { value: number; strength: "target" | "floor" };
      }
      • Optionalautomatic?: true

        Explicitly use seller/provider automatic bidding at this authored scope. At package scope this is a complete override of a media-buy policy, not inheritance. It MUST be the only field in the block and MUST be preserved on readback.

      • Optionalbid_amount?: number

        Manual auction bid denominated in the media-buy currency and expressed per the selected pricing option's auction unit. For example, a CPM option interprets the amount per thousand impressions. This is the amount submitted to the auction, not a promise that the clearing price equals it. Requires an auction-priced pricing option whose currency equals the media-buy currency.

      • Optionalmax_bid?: number

        Hard per-auction ceiling denominated in the media-buy currency and expressed per the selected pricing option's auction unit. This is the only canonical hard auction ceiling and MUST NOT be translated into an average outcome-cost control. Requires an auction-priced pricing option whose currency equals the media-buy currency. May stand alone or supplement cost_per/roas only when the relevant scope capability advertises that combination.

      • Optionalcost_per?: { amount: number; strength: "cap" | "target" }

        Average cost control per result of the scope-bound primary optimization goal. At seller-optimized media-buy scope it binds to budget_allocation.optimization_goals; at package scope it binds to that package's optimization_goals; at fixed media-buy scope it binds independently to each inheriting package and is valid only when their primary-goal result units are compatible. Metric goals are compatible only when metric and every result-defining qualifier match; vendor_metric goals only when vendor and metric_id match; event goals only when the event_type/custom_event_name set and resolved attribution_window match. Primary is the earliest array entry among goals tied for the lowest explicit numeric priority; unprioritized goals follow explicitly prioritized goals; when all priorities are absent, the first entry is primary.

        • amount: number

          Average cost amount per scope-bound primary-goal result, denominated in the media-buy currency.

        • strength: "cap" | "target"

          cap optimizes for an average at or below the amount and accepts underdelivery when necessary; target optimizes around the amount while balancing volume and spend. Neither is a per-result or per-auction guarantee.

      • Optionalroas?: { value: number; strength: "target" | "floor" }

        Dimensionless return-on-ad-spend control bound to the same scope-specific primary goal rules as cost_per. The bound goal must be value-bearing; a fixed media-buy default requires a value-bearing primary goal on every inheriting package. Every referenced value-bearing event source MUST declare value_currencies containing the media-buy currency. The seller validates this at buy creation; each buy consumes only exact-currency records, while other declared currencies remain available to other buys. Sellers MUST NOT perform currency conversion.

        • value: number

          Return per unit of ad spend; 4 means 4 units of value per 1 unit spent.

        • strength: "target" | "floor"

          floor prefers underdelivery to knowingly optimizing below the requested return; target optimizes around the requested return. Neither guarantees realized return.

    • null
    impressions?: number

    Updated impression goal for this package

    0

    daily_budget_cap?: number | null

    Replace this package's hard daily cap; null removes it. Numeric changes apply immediately with current-day package spend counted. A cap below that spend pauses the package for the day; the aggregate cap remains independently binding.

    0

    start_time?: string

    Updated flight start date/time for this package in ISO 8601 format. Must fall within the media buy's date range.

    date-time

    end_time?: string

    Updated flight end date/time for this package in ISO 8601 format. Must fall within the media buy's date range.

    date-time

    paused?: boolean

    Pause/resume specific package (true = paused, false = active)

    canceled?: true

    Cancel this specific package. Cancellation is irreversible — canceled packages stop delivery and cannot be reactivated. When true, package cancellation takes precedence over sibling fields on this package: the seller applies only canceled and cancellation_reason for this package and SHOULD return a structured warning naming ignored sibling fields. Root fields and other package updates still participate in the same atomic update when root canceled is absent. Sellers MAY reject with NOT_CANCELLABLE.

    cancellation_reason?: string

    Reason for canceling this package.

    500

    catalogs?: Catalog[]

    Replace the catalogs this package promotes. Uses replacement semantics — the provided array replaces the current list. Omit to leave catalogs unchanged.

    optimization_goals?: OptimizationGoal[]

    Replace all optimization goals for this package. Uses replacement semantics — omit to leave goals unchanged.

    targeting_overlay?: TargetingOverlayInput
    keyword_targets_add?: {
        keyword: string;
        match_type: MatchType;
        bid_price?: number;
    }[]

    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.

    Type Declaration

    • keyword: string

      The keyword to target

      1

    • match_type: MatchType
    • Optionalbid_price?: number

      Per-keyword bid price. Inherits currency and max_bid interpretation from the package's pricing option.

      0

    keyword_targets_remove?: { keyword: string; match_type: MatchType }[]

    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.

    Type Declaration

    • keyword: string

      The keyword to stop targeting

      1

    • match_type: MatchType
    negative_keywords_add?: { keyword: string; match_type: MatchType }[]

    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.

    Type Declaration

    • keyword: string

      The keyword to exclude

      1

    • match_type: MatchType
    negative_keywords_remove?: { keyword: string; match_type: MatchType }[]

    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.

    Type Declaration

    • keyword: string

      The keyword to stop excluding

      1

    • match_type: MatchType
    creative_assignments?: {
        creative_id: string;
        weight?: number;
        rotation_mode?: "random" | "even" | "weighted" | "sequential";
        group_id?: string;
        sequence_position?: number;
        placement_refs?: [PlacementReference, ...PlacementReference[]];
        placement_ids?: [string, ...string[]];
    }[]

    Replace creative assignments for this package with optional rotation, grouping, weights, and placement routing. Uses replacement semantics - omit to leave assignments unchanged. rotation_mode is package-scoped: omission resolves to weighted, and every assignment MUST resolve to the same effective mode. In sequential mode, sequence_position MUST be unique within each package-local group. Sellers reject conflicts with VALIDATION_ERROR before mutation. When the same mutation narrows or clears targeting_overlay.placement_selection, this complete replacement MUST remove or reroute every assignment reference that would otherwise be orphaned; the seller validates both changes atomically.

    Type Declaration

    • creative_id: string

      Unique identifier for the creative

    • Optionalweight?: number

      Relative delivery weight for this creative (0–100). Valid when the package's effective rotation_mode is weighted, including the backward-compatible default when rotation_mode is omitted. Weights determine impression distribution proportionally — a creative with weight 2 gets twice the delivery of weight 1. When omitted, the creative receives equal weight with other unweighted creatives. A weight of 0 means the creative is assigned but paused (receives no delivery).

    • Optionalrotation_mode?: "random" | "even" | "weighted" | "sequential"

      Package-scoped rotation policy repeated on assignment rows for wire compatibility. Omission means weighted, preserving existing weight behavior. Every assignment in a package MUST resolve to the same effective mode: weighted uses relative weights; even balances delivery across eligible assignments; sequential cycles through sequence_position in ascending order within each group; random makes an independent uniform selection from eligible assignments. Sellers MUST reject conflicting effective modes rather than choose one by array order.

    • Optionalgroup_id?: string

      Package-local creative pool identifier. The identifier has no meaning outside this package. Assignments that omit group_id belong to the package's default group; one eligible creative is selected from each applicable group per serving opportunity.

    • Optionalsequence_position?: number

      One-based order within the assignment's package-local group. Required only for sequential rotation and unique within that group.

    • Optionalplacement_refs?: [PlacementReference, ...PlacementReference[]]

      Optional structured product-context refs routing this creative within already-purchased package inventory. These items always use placement-ref product-context semantics, even when tolerated additional members make an item resemble placement-identity. Receivers match only against the package's committed placement set; kind and seller_agent are non-authoritative for routing and MUST NOT expand or reinterpret that set. A receiver MUST reject a ref when the enclosing product and committed set do not yield one unambiguous match. This field never narrows purchased inventory; use targeting_overlay.placement_selection for that. Every ref MUST fall within the package's committed placement selection. New senders SHOULD include publisher_domain for publisher-catalog placements. When omitted, the creative runs across the purchased placements compatible with its format. If both placement_refs and legacy placement_ids are present, placement_refs wins.

      1

    • Optionalplacement_ids?: [string, ...string[]]

      Legacy shorthand routing IDs within already-purchased inventory. This field never narrows purchased inventory; use targeting_overlay.placement_selection. New senders SHOULD use placement_refs because IDs are publisher-scoped. If placement_refs is also present, receivers MUST ignore this field.

      1

    Replace this package's inline creative assets. Native localization is not accepted on this path; use sync_creatives before assigning the library creative. When the seller also advertises creative.has_creative_library: true, new inline creatives enter the seller's creative library and can be reused by creative_id while retained; inline-only sellers may store them as package-scoped assets. Use creative_assignments instead for existing library creatives.

    100

    context?: ContextObject