> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiderx.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch update line items (max 100). Partial failure allowed.



## OpenAPI

````yaml /openapi/adm.openapi.en-dev.json post /api/manager/line-items/batch-patch
openapi: 3.1.0
info:
  description: >
    ## Introduction

    The Data Management APIs comprehensively oversees the **diverse data** used
    by advertising and recommendation systems, ensuring that the Decision API
    runs accurately and efficiently.


    From registering, updating, and deleting campaigns and placements to **log
    and statistics analysis**, it provides the insights necessary for effective
    system operation.


    The resulting data and metrics are used by the Decision API to **optimize ad
    and content decisions**, ultimately boosting the overall performance of the
    advertising and recommendation system.
  title: Data Management APIs
  version: dev
servers: []
security: []
tags:
  - description: >-
      Authentication endpoints. All roles (admin, operator, advertiser) use
      these to log in, refresh tokens, and manage their own credentials.
    name: Auth
  - description: >-
      Advertiser account management. Operators and admins onboard advertisers,
      manage their budgets, and deactivate accounts. Advertisers can only read
      their own profile and balance — they cannot create, delete, or modify
      another advertiser's account.
    name: Advertisers
  - description: >-
      Internal user (operator / admin) account management. Admin only. Covers
      creating operator accounts, changing roles, toggling activation status,
      and hard-deleting accounts. Operators have no access to this resource.
    name: Users
  - description: >-
      The AdUnit Management API provides comprehensive functionalities for
      managing ad units and related resources. AdUnits are organized in a
      hierarchical path structure derived from their code and parent path. Only
      admin and operator roles have access — advertisers cannot access raw
      inventory. References:
      [Placement](https://docs.aiderx.io/guides/about-a2/en/placement)
    name: AdUnit
  - description: >-
      Ad catalog management. CRUD for ad catalogs plus public shared-view access
      via a share link.
    name: Ad Catalogs
  - description: >-
      Ad source (demand partner) management. CRUD for external ad sources that
      supply demand to ad units.
    name: AdSource
  - description: >-
      Allocation management. An allocation binds a line item to a serving target
      such as an ad unit. Covers CRUD, status counts, and single-allocation
      lookup.
    name: Allocations
  - description: >-
      Associated items pool (admin). Bulk upsert/delete and lookup of
      associated-items pools used by the recommendation pipeline.
    name: AssociatedItemsPool
  - description: >-
      Custom targeting segment management. CRUD and bulk operations for custom
      targeting segments.
    name: Custom Targeting Segment
  - description: Audit log access. Read the system audit log of administrative actions.
    name: Audit Logs
  - description: >-
      Creative block list. List, block, and unblock creatives to exclude them
      from serving.
    name: Blocked Creative
  - description: Catalog item management. List and update catalog (product/data) items.
    name: Catalogs
  - description: >-
      Creative asset management. Operators and admins manage creatives;
      advertisers see only their own. Deletion is blocked while any line-item
      association (LICA) still exists.
    name: Creatives
  - description: >-
      Dashboard aggregates. Summary data, inventory, and line-item metric
      rollups for the console dashboard.
    name: Dashboard
  - description: Experiment management. CRUD for A/B and optimization experiments.
    name: Experiment
  - description: >-
      External creative inspection. Read-only access to creatives ingested from
      external demand sources.
    name: External Creative
  - description: >-
      Third-party integration management. Manage integration sources (external
      data/serving connectors), probe connectivity, and read public
      (sensitive-config-redacted) configs.
    name: Integration
  - description: >-
      Line Item–Creative Associations (LICA). Associates creatives with line
      items, including batch create and delete (max 100, partial failure
      allowed) and dashboard counts.
    name: LICAs
  - description: License information. Read available license features and usage metrics.
    name: License
  - description: >-
      Line item management within an order. Covers create, update, delete, batch
      operations (max 100, partial failure allowed), and status transitions. A
      line item defines budget, goal, schedule, and targeting under its parent
      order.
    name: LineItems
  - description: Media library. List, upload, and delete media files used by creatives.
    name: Media Library
  - description: >-
      Metric query endpoints. Retrieve aggregated metrics for ad units,
      creatives, line items, and related entities.
    name: Metric
  - description: >-
      Advertiser order management. Operators and admins create and manage orders
      that group line items under a single budget; advertisers can read their
      own. Includes batch operations (max 100) and draft-only deletion rules.
    name: Orders
  - description: >-
      Placement management. A placement maps ad units to a serving surface.
      Endpoints cover CRUD and replacing the ad units bound to a placement.
    name: Placements
  - description: >-
      System settings. Read and update system configuration, including site
      logo, public URL, TLS, and access-token regeneration.
    name: Settings
  - description: System resources. Public static resources such as the site logo.
    name: System
  - description: >-
      Operational/developer control endpoints. Low-level ext patches and health
      checks intended for internal operation, not general API consumers.
    name: developer
  - description: >-
      Operational allocation control. Update allocation ext or force-update
      status (admin only).
    name: developer/control/allocations
  - description: >-
      Ad-serving monitoring (operational). Read ad-serving status, ad-unit
      monitoring history, and alerts.
    name: developer/monitoring
  - description: Internal health and probe endpoints.
    name: internal
  - description: >-
      Manager-level utility endpoints (e.g. service health) not tied to a
      specific resource.
    name: manager
  - description: Manage mappings between ad units, native formats, and native styles.
    name: Ad Unit Native Style
  - description: Manage custom targeting keys, including lifecycle and bulk operations.
    name: Custom Targeting Key
  - description: >-
      Manage values belonging to custom targeting keys, including lifecycle and
      bulk operations.
    name: Custom Targeting Value
  - description: Manage native formats and the fields that define each format.
    name: Native Format
  - description: List templates available for native styles.
    name: Native Style Template
  - description: Manage native rendering styles.
    name: Native Style
paths:
  /api/manager/line-items/batch-patch:
    post:
      tags:
        - LineItems
      summary: Batch update line items (max 100). Partial failure allowed.
      operationId: handle_batch_patch_line_items_api_manager_line_items_batch_patch_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LineItemBatchPatch'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemBatchPatchResponse'
          description: Successful Response
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    LineItemBatchPatch:
      example:
        items:
          - budget: 800000
            id: <lineitem_id>
      properties:
        items:
          items:
            $ref: '#/components/schemas/LineItemUpdate'
          maxItems: 100
          title: Items
          type: array
      required:
        - items
      title: LineItemBatchPatch
      type: object
    LineItemBatchPatchResponse:
      properties:
        failed:
          items:
            $ref: '#/components/schemas/BatchFailedItem'
          title: Failed
          type: array
        succeeded:
          items:
            $ref: '#/components/schemas/LineItemResponse'
          title: Succeeded
          type: array
      required:
        - succeeded
        - failed
      title: LineItemBatchPatchResponse
      type: object
    HTTPExceptionResponse:
      properties:
        detail:
          description: Detailed explanation for the exception
          title: Detail
          type: string
      required:
        - detail
      title: HTTPExceptionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    LineItemUpdate:
      description: >-
        Patch payload for line items.


        All fields are optional except `id`. `order_id` is intentionally absent
        —

        line items cannot be reparented.
      example:
        budget: 800000
        id: <lineitem_id>
        name: 봄 시즌 캠페인 라인아이템 (수정)
      properties:
        ad_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Ad Type
        audience_segments:
          anyOf:
            - $ref: '#/components/schemas/LineItemAudienceSegment'
            - type: 'null'
        bid_strategy:
          anyOf:
            - type: string
            - type: 'null'
          title: Bid Strategy
        budget:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          title: Budget
        creative_rotation:
          anyOf:
            - $ref: '#/components/schemas/CreativeRotation'
            - type: 'null'
        custom_targeting:
          anyOf:
            - $ref: '#/components/schemas/CustomTargeting'
            - type: 'null'
        daily_budget:
          anyOf:
            - type: number
            - type: 'null'
          title: Daily Budget
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        end_date:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: End Date
        ext:
          anyOf:
            - {}
            - type: 'null'
          title: Ext
        goal:
          anyOf:
            - type: string
            - type: 'null'
          title: Goal
        id:
          format: uuid
          title: Id
          type: string
        max_bid:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Bid
        min_daily_imp:
          anyOf:
            - type: number
            - type: 'null'
          title: Min Daily Imp
        name:
          anyOf:
            - minLength: 1
              type: string
            - type: 'null'
          title: Name
        pace_method:
          anyOf:
            - type: string
            - type: 'null'
          title: Pace Method
        priority:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          title: Priority
        schedule:
          anyOf:
            - $ref: '#/components/schemas/LineItemSchedule'
            - type: 'null'
        start_date:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Start Date
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        sub_goal:
          anyOf:
            - type: string
            - type: 'null'
          title: Sub Goal
        target_cpa:
          anyOf:
            - type: number
            - type: 'null'
          title: Target Cpa
        target_cpm:
          anyOf:
            - type: number
            - type: 'null'
          title: Target Cpm
        target_volume:
          anyOf:
            - type: number
            - type: 'null'
          title: Target Volume
      required:
        - id
      title: LineItemUpdate
      type: object
    BatchFailedItem:
      properties:
        id:
          format: uuid
          title: Id
          type: string
        reason:
          title: Reason
          type: string
      required:
        - id
        - reason
      title: BatchFailedItem
      type: object
    LineItemResponse:
      properties:
        ad_type:
          default: standard
          description: Ad type for the line item (e.g., "standard", "decision")
          title: Ad Type
          type: string
        audience_segments:
          anyOf:
            - $ref: '#/components/schemas/LineItemAudienceSegment'
            - type: 'null'
          description: Optional audience segments associated with the line item
        bid_strategy:
          default: highest_volume
          description: 'Bid strategy for the line item (default: "highest_volume")'
          title: Bid Strategy
          type: string
        budget:
          description: Total budget of the line item
          title: Budget
          type: number
        created_at:
          format: date-time
          title: Created At
          type: string
        creative_rotation:
          $ref: '#/components/schemas/CreativeRotation'
          default:
            admission_confidence_penalty: 0
            posterior_temperature: 1
            prior_weight: 100
            temperature: 1
            type: optimized
            weights: []
          description: Creative rotation strategy for the line item
        custom_targeting:
          anyOf:
            - $ref: '#/components/schemas/CustomTargeting'
            - type: 'null'
          description: Optional custom targeting conditions for the line item
        daily_budget:
          anyOf:
            - type: number
            - type: 'null'
          description: Optional daily budget of the line item
          title: Daily Budget
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional description of the line item
          title: Description
        end_date:
          description: End date of the line item (UTC)
          format: date-time
          title: End Date
          type: string
        ext:
          anyOf:
            - {}
            - type: 'null'
          description: Optional extension for the line item
          title: Ext
        goal:
          description: Goal of the line item (click, reach, impression, conversion)
          title: Goal
          type: string
        id:
          description: ID of the line item (uuid7)
          format: uuid
          title: Id
          type: string
        max_bid:
          default: 0
          description: 'Maximum bid amount for the line item (default: 0.0)'
          title: Max Bid
          type: number
        min_daily_imp:
          default: 1000
          description: 'Minimum daily impressions for the line item (default: 1000.0)'
          title: Min Daily Imp
          type: number
        name:
          description: Name of the line item
          title: Name
          type: string
        'no':
          anyOf:
            - type: integer
            - type: 'null'
          title: 'No'
        oid:
          description: ID of the parent order
          format: uuid
          title: Oid
          type: string
        owner_id:
          description: Owner ID of the line item
          format: uuid
          title: Owner Id
          type: string
        pace_method:
          default: evenly
          description: Pacing method for the line item
          title: Pace Method
          type: string
        priority:
          default: 8
          description: Priority of the line item
          minimum: 0
          title: Priority
          type: integer
        schedule:
          anyOf:
            - $ref: '#/components/schemas/LineItemSchedule'
            - type: 'null'
          description: Optional schedule for the line item
        start_date:
          description: Start date of the line item (UTC)
          format: date-time
          title: Start Date
          type: string
        status:
          $ref: '#/components/schemas/LineItemStatus'
          description: >-
            Status of the line item (draft, ready, preparing, delivering,
            archived)
        sub_goal:
          default: maximize_volume
          description: 'Sub-goal of the line item (default: "maximize_volume")'
          title: Sub Goal
          type: string
        target_cpa:
          description: Target cost per acquisition (CPA) for the line item
          title: Target Cpa
          type: number
        target_cpm:
          default: 0
          description: >-
            Target cost per thousand impressions (CPM) for the line item
            (default: 0.0)
          title: Target Cpm
          type: number
        target_volume:
          default: 0
          description: 'Target volume for the line item (default: 0.0)'
          title: Target Volume
          type: number
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - created_at
        - updated_at
        - budget
        - end_date
        - goal
        - name
        - oid
        - owner_id
        - start_date
        - status
        - target_cpa
      title: LineItemResponse
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    LineItemAudienceSegment:
      properties:
        method:
          description: Matching method for audience segments (e.g., "auto", "manual").
          title: Method
          type: string
        segment_list:
          description: List of audience segment conditions for targeting.
          items:
            $ref: '#/components/schemas/AudienceSegmentInfo'
          title: Segment List
          type: array
      required:
        - method
        - segment_list
      title: LineItemAudienceSegment
      type: object
    CreativeRotation:
      properties:
        admission_confidence_penalty:
          default: 0
          title: Admission Confidence Penalty
          type: number
        creative_exposure_fatigue:
          anyOf:
            - $ref: '#/components/schemas/CreativeExposureFatigueConfig'
            - type: 'null'
        posterior_temperature:
          default: 1
          title: Posterior Temperature
          type: number
        prior_weight:
          default: 100
          title: Prior Weight
          type: number
        temperature:
          default: 1
          title: Temperature
          type: number
        type:
          $ref: '#/components/schemas/CreativeRotationType'
        user_signal:
          anyOf:
            - $ref: '#/components/schemas/CreativeRotationUserSignal'
            - type: 'null'
        weights:
          default: []
          items:
            $ref: '#/components/schemas/CreativeRotationWeight'
          title: Weights
          type: array
      required:
        - type
      title: CreativeRotation
      type: object
    CustomTargeting:
      properties:
        conditions:
          items:
            $ref: '#/components/schemas/CustomTargetingCondition'
          title: Conditions
          type: array
      required:
        - conditions
      title: CustomTargeting
      type: object
    LineItemSchedule:
      properties:
        days_of_week:
          description: >-
            Days of the week when the line item is active (1-7, where 1 =
            Monday)
          items:
            minimum: 0
            type: integer
          title: Days Of Week
          type: array
        time_ranges:
          description: >-
            Time ranges during which the line item is active (e.g., [{"start":
            "08:00", "end": "18:00"}])
          items:
            $ref: '#/components/schemas/TimeRange'
          title: Time Ranges
          type: array
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional timezone for the line item schedule (e.g., "Asia/Seoul")
          title: Timezone
      required:
        - days_of_week
        - time_ranges
      title: LineItemSchedule
      type: object
    LineItemStatus:
      enum:
        - draft
        - ready
        - preparing
        - delivering
        - archived
      title: LineItemStatus
      type: string
    AudienceSegmentInfo:
      properties:
        id:
          description: Unique identifier for the audience segment.
          title: Id
          type: string
        name:
          description: Human-readable name for the audience segment.
          title: Name
          type: string
      required:
        - id
        - name
      title: AudienceSegmentInfo
      type: object
    CreativeExposureFatigueConfig:
      properties:
        head:
          default:
            - 1.1799999475479126
            - 1.0800000429153442
            - 0.9800000190734863
            - 0.8999999761581421
            - 0.8199999928474426
          items:
            type: number
          title: Head
          type: array
        tail_floor:
          default: 0.6499999761581421
          title: Tail Floor
          type: number
        tail_step:
          default: 0.03999999910593033
          title: Tail Step
          type: number
      title: CreativeExposureFatigueConfig
      type: object
    CreativeRotationType:
      enum:
        - optimized
        - softmax
        - evenly
        - weighted
        - sequential
        - thompson_sampling
        - linucb_lite
      title: CreativeRotationType
      type: string
    CreativeRotationUserSignal:
      properties:
        enabled:
          default: false
          title: Enabled
          type: boolean
        prior_weight:
          default: 40
          title: Prior Weight
          type: number
        propensity_multipliers:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Propensity Multipliers
        targeting_key:
          default: signal
          title: Targeting Key
          type: string
        type:
          $ref: '#/components/schemas/CreativeRotationUserSignalType'
          default: fingerprint
      title: CreativeRotationUserSignal
      type: object
    CreativeRotationWeight:
      properties:
        crid:
          format: uuid
          title: Crid
          type: string
        weight:
          minimum: 0
          title: Weight
          type: integer
      required:
        - crid
        - weight
      title: CreativeRotationWeight
      type: object
    CustomTargetingCondition:
      properties:
        key:
          $ref: '#/components/schemas/CustomTargetingKeyRef'
        operator:
          $ref: '#/components/schemas/CustomTargetingOperator'
        values:
          items:
            $ref: '#/components/schemas/CustomTargetingValueRef'
          title: Values
          type: array
      required:
        - key
        - operator
        - values
      title: CustomTargetingCondition
      type: object
    TimeRange:
      properties:
        end:
          description: End time of the range (e.g., "18:00")
          title: End
          type: string
        start:
          description: Start time of the range (e.g., "08:00")
          title: Start
          type: string
      required:
        - end
        - start
      title: TimeRange
      type: object
    CreativeRotationUserSignalType:
      enum:
        - fingerprint
      title: CreativeRotationUserSignalType
      type: string
    CustomTargetingKeyRef:
      properties:
        code:
          title: Code
          type: string
        id:
          format: uuid
          title: Id
          type: string
      required:
        - code
        - id
      title: CustomTargetingKeyRef
      type: object
    CustomTargetingOperator:
      enum:
        - in
        - not_in
      title: CustomTargetingOperator
      type: string
    CustomTargetingValueRef:
      properties:
        id:
          format: uuid
          title: Id
          type: string
        match_type:
          $ref: '#/components/schemas/MatchType'
          default: exact
        value:
          title: Value
          type: string
      required:
        - id
        - value
      title: CustomTargetingValueRef
      type: object
    MatchType:
      enum:
        - exact
      title: MatchType
      type: string
  securitySchemes:
    HTTPBearer:
      description: >-
        Bearer authentication. Pass the access token in the `Authorization:
        Bearer <token>` header.
      scheme: bearer
      type: http

````