> ## 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.

# Update Allocations

> 
Stores allocation information between ad_units and line_items.
Used to determine eligible line_items during mediation.




## OpenAPI

````yaml /openapi/decision.api.en-dev.json post /app/api/cache/allocations
openapi: 3.1.0
info:
  contact:
    email: a2support@aiderx.io
    name: A2 Support
    url: https://aiderx.io
  description: >+

    ### Introduction

    The Decision API is responsible for selecting and distributing ads or
    content based on user requests or contextual information, all in real time.

    Its rapid response and dynamic capabilities enable the **optimal** ad or
    recommendation to be served, ensuring users receive the highest possible
    value.


    A variety of algorithms, machine learning models, and rule-based logic can
    be applied, allowing the system to **adapt flexibly** to constantly changing
    conditions.

  title: Decision APIs
  version: dev
  x-logo:
    altText: A2 Logo
    url: >-
      https://cdn.prod.website-files.com/668de9e1f25ab5675d87758d/6690cf1bdce95af5e3522c25_a2_logo_800_250.png
servers: []
security: []
tags:
  - description: >

      Ad Serving APIs for requesting ads and configuring cache settings and
      other parameters of the ad serving modules.
    name: Ad Serving
  - description: |

      Recommendation Serving APIs for requesting recommendations.
    name: Recommendation Serving
  - description: >-

      APIs for manipulating caches of the serving server.


      ### **Important**

      If you directly manipulate the cached data related to advertising or
      recommendations on the Serving server,

      we **strongly advise** against also modifying the advertising or
      recommendation data through the Ad Manager.


      Alternatively, we **recommend** handling any advertising or recommendation
      data modifications via the Ad Manager APIs.

      Any changes made on the Serving server will **not** be reflected in the Ad
      Manager,

      which can compromise **data integrity**.
    name: Cache Management
  - description: |-

      APIs for manipulating configurations of the serving server
    name: Configuration
  - description: >

      APIs for receiving conversion, impression, and click logs related to ads
      or recommendations.
    name: Ad Log
paths:
  /app/api/cache/allocations:
    post:
      tags:
        - Cache Management
      summary: Update Allocations
      description: |

        Stores allocation information between ad_units and line_items.
        Used to determine eligible line_items during mediation.
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/Allocation'
              type: array
        required: true
      responses:
        '204':
          description: Success
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Failed to parse the request body as JSON
        '415':
          content:
            text/plain:
              schema:
                type: string
          description: 'Expected request with `Content-Type: application/json`'
        '422':
          content:
            text/plain:
              schema:
                type: string
          description: Failed to deserialize the JSON body into the target type
        '500':
          description: Internal Server Error.
      security:
        - '': []
components:
  schemas:
    Allocation:
      properties:
        ext:
          allOf:
            - $ref: '#/components/schemas/AllocationExt'
          default:
            ad_log_tracking_mode: on_ad_response
            deferred_native_rendering: false
            deferred_native_template: ''
            frequency_capping:
              enabled: 0
              limit_multiple_click: 0
              limit_user_impression:
                - limit_count: 0
                  num_time_units: 0
                  time_unit: day
            supported_environments:
              - web
              - app
          description: for various configuration
        last_comment:
          default: ''
          description: Last comment
          type: string
        'no':
          default: 0
          description: ID of the allocation
          format: int64
          type: integer
        owner_id:
          description: Owner ID
          format: uuid
          type: string
        rid:
          description: Resource ID (line_items.id or recommendation_policies.id)
          format: uuid
          type: string
        rtype:
          allOf:
            - $ref: '#/components/schemas/AllocationResourceType'
          description: >-
            Resource type allocated to the target (line_item /
            recommendation_policy)
        status:
          allOf:
            - $ref: '#/components/schemas/AllocationStatus'
          default: pending
          description: >-
            The current status of the allocation (e.g. pending, published,
            rejected)
        tid:
          description: Target ID (ad_units.id or placements.id)
          format: uuid
          type: string
        ttype:
          allOf:
            - $ref: '#/components/schemas/TargetType'
          description: Target type (ad_unit / placement)
      required:
        - ttype
        - tid
        - rtype
        - rid
        - owner_id
      type: object
    AllocationExt:
      properties:
        ad_log_tracking_mode:
          allOf:
            - $ref: '#/components/schemas/AdLogTrackingMode'
          default: on_ad_response
          description: 광고 로그 추적 모드 (송출로그 vs 이벤트 트래커)
        ad_source:
          anyOf:
            - $ref: '#/components/schemas/AdSource'
            - type: 'null'
        allowed_native_aspect_ratios:
          items:
            $ref: '#/components/schemas/NativeAspectRatioRange'
          type: array
        deferred_native_rendering:
          default: false
          type: boolean
        deferred_native_template:
          default: ''
          type: string
        demand_override:
          anyOf:
            - $ref: '#/components/schemas/DemandOverride'
            - type: 'null'
          description: ad_source에 대한 OpenRTB override. ad_source와 1:1이다.
        frequency_capping:
          allOf:
            - $ref: '#/components/schemas/FrequencyCapping'
          default:
            enabled: 0
            limit_multiple_click: 0
            limit_user_impression:
              - limit_count: 0
                num_time_units: 0
                time_unit: day
        native_assets:
          items:
            $ref: '#/components/schemas/AssetRequest'
          type:
            - array
            - 'null'
        supported_environments:
          default:
            - web
            - app
          description: 해당 애드네트워크가 받아들일 수 있는 환경
          items:
            $ref: '#/components/schemas/EnvironmentType'
          type: array
      type: object
    AllocationResourceType:
      enum:
        - line_item
        - recommendation_policy
      type: string
    AllocationStatus:
      enum:
        - pending
        - requested
        - published
        - rejected
        - canceled
        - finished
      type: string
    TargetType:
      enum:
        - ad_unit
        - placement
      type: string
    AdLogTrackingMode:
      description: |-
        광고 로그 추적 모드
        - `OnAdResponse`: 송출로그 — ad_request 응답 시 즉시 ad_log/imp 발생 (기존 동작)
        - `OnEventTracker`: 클라이언트에서 실제 노출 시 event endpoint 호출
      enum:
        - on_ad_response
        - on_event_tracker
      type: string
    AdSource:
      properties:
        endpoint:
          description: Endpoint for the ad source
          type: string
        header_params:
          description: Header Parameters for the ad source
        id:
          description: >-
            Unique identifier for the ad source


            Uses `String` internally because some a2 code paths assign arbitrary
            names,

            while the exported schema declares it as `UUID`.
          format: uuid
          type: string
        name:
          description: Name of the ad source
          type: string
        query_params:
          description: Query Parameters for the ad source
        seller_id:
          description: Seller ID for the ad source
          type:
            - string
            - 'null'
        settings:
          allOf:
            - $ref: '#/components/schemas/AdSourceSettings'
          default:
            required_registration: false
          description: Settings for the ad source
        type:
          description: Description of the ad source
          type: string
      required:
        - id
        - name
        - type
        - endpoint
      type: object
    NativeAspectRatioRange:
      properties:
        max:
          format: float
          type: number
        min:
          format: float
          type: number
      required:
        - min
        - max
      type: object
    DemandOverride:
      properties:
        bidfloor:
          description: 필요하면 bidder별 floor/currency도 여기서 override (선택)
          format: float
          minimum: 0
          type:
            - number
            - 'null'
        bidfloorcur:
          type:
            - string
            - 'null'
        clickbrowser:
          anyOf:
            - $ref: '#/components/schemas/Clickbrowser'
            - type: 'null'
          description: 'OpenRTB clickbrowser: browser used when clicking on ad (선택).'
        imp:
          anyOf:
            - $ref: '#/components/schemas/ImpOverride'
            - type: 'null'
          description: OpenRTB imp-level override (tagid/ext 등)
        implicit_app_inference:
          anyOf:
            - $ref: '#/components/schemas/ImplicitAppInference'
            - type: 'null'
        source:
          anyOf:
            - $ref: '#/components/schemas/Source'
            - type: 'null'
          description: OpenRTB source-level override (tagid/ext 등)
      type: object
    FrequencyCapping:
      properties:
        enabled:
          description: |-
            Enables frequency capping (1: enabled, 0: disabled).
            When enabled, user-level ad delivery limits are enforced.
          format: int32
          type: integer
        limit_multiple_click:
          description: |-
            Prevents multiple clicks from the same user on the same ad.
            1 to enable, 0 to disable.
          format: int32
          type: integer
        limit_user_impression:
          default:
            - limit_count: 0
              num_time_units: 0
              time_unit: day
          description: Defines user-level impression limits based on time windows.
          items:
            $ref: '#/components/schemas/FrequencyCapRule'
          type: array
      required:
        - enabled
        - limit_multiple_click
      type: object
    AssetRequest:
      anyOf:
        - required:
            - title
        - required:
            - img
        - required:
            - video
        - required:
            - data
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/DataAssetRequest'
            - type: 'null'
        ext: true
        id:
          format: int32
          type: integer
        img:
          anyOf:
            - $ref: '#/components/schemas/ImageAssetRequest'
            - type: 'null'
        required:
          anyOf:
            - $ref: '#/components/schemas/IsRequired2'
            - type: 'null'
        title:
          anyOf:
            - $ref: '#/components/schemas/TitleAssetRequest'
            - type: 'null'
        video:
          anyOf:
            - $ref: '#/components/schemas/VideoAssetRequest'
            - type: 'null'
      required:
        - id
      type: object
    EnvironmentType:
      enum:
        - web
        - app
      type: string
    AdSourceSettings:
      properties:
        required_registration:
          default: false
          type: boolean
        timeout_ms:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
      type: object
    Clickbrowser:
      description: 'OpenRTB clickbrowser: browser used when clicking on ad.'
      enum:
        - 0
        - 1
      type: integer
      x-enum-varnames:
        - Embedded
        - Native
    ImpOverride:
      properties:
        ext:
          allOf:
            - $ref: '#/components/schemas/ImpExtOverride'
          default: {}
          description: outgoing OpenRTB imp.ext override
        tagid:
          description: outgoing OpenRTB imp.tagid (내부 Allocation.tagid와 분리)
          type:
            - string
            - 'null'
      type: object
    ImplicitAppInference:
      properties:
        android_bundle:
          type:
            - string
            - 'null'
        app_name:
          type:
            - string
            - 'null'
        cat:
          items:
            type: string
          type:
            - array
            - 'null'
        ios_bundle:
          type:
            - string
            - 'null'
        ua_keywords:
          default: []
          items:
            type: string
          type: array
      type: object
    Source:
      properties:
        ext: true
        fd:
          anyOf:
            - $ref: '#/components/schemas/FinalDecision'
            - type: 'null'
        pchain:
          type:
            - string
            - 'null'
        schain:
          anyOf:
            - $ref: '#/components/schemas/SupplyChain'
            - type: 'null'
        tid:
          type:
            - string
            - 'null'
      type: object
    FrequencyCapRule:
      properties:
        limit_count:
          description: >-
            Maximum number of impressions allowed within the specified time
            window.
          format: uint32
          minimum: 0
          type: integer
        num_time_units:
          description: Number of time units for the frequency cap (e.g. 1 day, 2 hours).
          format: uint32
          minimum: 0
          type: integer
        time_unit:
          allOf:
            - $ref: '#/components/schemas/TimeUnit'
          description: Time unit for the frequency cap (e.g. day, hour).
      required:
        - time_unit
        - num_time_units
        - limit_count
      type: object
    DataAssetRequest:
      properties:
        ext: true
        len:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        type:
          format: uint16
          maximum: 65535
          minimum: 0
          type: integer
      required:
        - type
      type: object
    ImageAssetRequest:
      properties:
        ext: true
        h:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        hmin:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        mimes:
          items:
            type: string
          type:
            - array
            - 'null'
        type:
          format: uint16
          maximum: 65535
          minimum: 0
          type:
            - integer
            - 'null'
        w:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
        wmin:
          format: uint32
          minimum: 0
          type:
            - integer
            - 'null'
      type: object
    IsRequired2:
      enum:
        - 0
        - 1
      type: integer
      x-enum-varnames:
        - 'No'
        - 'Yes'
    TitleAssetRequest:
      properties:
        ext: true
        len:
          format: uint32
          minimum: 0
          type: integer
      required:
        - len
      type: object
    VideoAssetRequest:
      properties:
        ext: true
        linearity:
          anyOf:
            - $ref: '#/components/schemas/LinearityMode'
            - type: 'null'
        maxduration:
          format: uint32
          minimum: 0
          type: integer
        mimes:
          items:
            type: string
          type: array
        minduration:
          format: uint32
          minimum: 0
          type: integer
        protocols:
          items:
            format: uint16
            maximum: 65535
            minimum: 0
            type: integer
          type: array
      required:
        - mimes
        - minduration
        - maxduration
        - protocols
      type: object
    ImpExtOverride:
      properties:
        bidder:
          description: 'imp.ext.bidder (Criteo의 경우 {"uid": "..."} 형태)'
        other:
          additionalProperties: true
          description: 그 외 ext 필드 확장용
          type: object
      type: object
    FinalDecision:
      enum:
        - 1
        - 2
      type: integer
      x-enum-varnames:
        - Exchange
        - UpstreamSource
    SupplyChain:
      properties:
        complete:
          $ref: '#/components/schemas/IsComplete'
        ext: true
        nodes:
          items:
            $ref: '#/components/schemas/SupplyChainNode'
          type: array
        ver:
          type: string
      required:
        - complete
        - nodes
        - ver
      type: object
    TimeUnit:
      enum:
        - minute
        - hour
        - day
        - week
        - month
      type: string
    LinearityMode:
      enum:
        - 1
        - 2
      type: integer
      x-enum-varnames:
        - Linear
        - NonLinear
    IsComplete:
      enum:
        - 'No'
        - 'Yes'
      type: string
    SupplyChainNode:
      properties:
        asi:
          type: string
        domain:
          type:
            - string
            - 'null'
        ext: true
        hp:
          anyOf:
            - $ref: '#/components/schemas/IsPayment'
            - type: 'null'
        name:
          type:
            - string
            - 'null'
        rid:
          type:
            - string
            - 'null'
        sid:
          type: string
      required:
        - asi
        - sid
      type: object
    IsPayment:
      enum:
        - 'No'
        - 'Yes'
      type: string

````