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

# 할당 등록

> ad_unit과 line_item 간의 할당 정보를 저장합니다.
중재 중 적격한 line_item을 결정하는 데 사용합니다.



## OpenAPI

````yaml /openapi/decision.api.ko-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: |-
    ### 소개
    Decision API는 사용자 요청 또는 컨텍스트 정보를 바탕으로 광고나 콘텐츠를 실시간으로 선택하고 배포합니다.
    빠른 응답과 동적 기능을 통해 최적의 광고 또는 추천을 제공하여 사용자가 가능한 가장 높은 가치를 얻도록 합니다.

    다양한 알고리즘, 머신러닝 모델 및 규칙 기반 로직을 적용할 수 있어 시스템이 끊임없이 변하는 조건에 유연하게 적응할 수 있습니다.
  title: Decision API
  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: 광고 요청, 캐시 설정 및 광고 제공 모듈의 기타 매개변수를 구성하기 위한 API입니다.
    name: Ad Serving
  - description: 추천 요청을 위한 API
    name: Recommendation Serving
  - description: >-
      광고 제공 서버의 캐시를 조작하기 위한 API입니다.


      ### **중요**

      Serving 서버의 광고 또는 추천 관련 캐시 데이터를 직접 조작하는 경우 Ad Manager에서 광고 또는 추천 데이터를 함께
      수정하지 않는 것을 **강력히 권장합니다.**


      대신 모든 광고 또는 추천 데이터 변경은 Ad Manager API를 통해 처리하는 것을 **권장합니다.**

      Serving 서버에서 변경한 내용은 Ad Manager에 반영되지 않으므로 **데이터 무결성**이 손상될 수 있습니다.
    name: Cache Management
  - description: 광고 서빙 서버 설정 API
    name: Configuration
  - description: 광고 또는 추천과 관련된 전환, 노출 및 클릭 로그를 수신하는 API입니다.
    name: Ad Log
paths:
  /app/api/cache/allocations:
    post:
      tags:
        - Cache Management
      summary: 할당 등록
      description: |-
        ad_unit과 line_item 간의 할당 정보를 저장합니다.
        중재 중 적격한 line_item을 결정하는 데 사용합니다.
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/Allocation'
              type: array
        required: true
      responses:
        '204':
          description: 성공
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: 요청 본문을 JSON으로 파싱하지 못했습니다.
        '415':
          content:
            text/plain:
              schema:
                type: string
          description: '`Content-Type: application/json`인 요청이 필요합니다.'
        '422':
          content:
            text/plain:
              schema:
                type: string
          description: JSON 본문을 대상 형식으로 역직렬화하지 못했습니다.
        '500':
          description: 내부 서버 오류.
      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: 다양한 설정을 위한 확장 정보입니다.
        last_comment:
          default: ''
          description: 마지막 코멘트
          type: string
        'no':
          default: 0
          description: 할당의 ID입니다.
          format: int64
          type: integer
        owner_id:
          description: 소유자 ID입니다.
          format: uuid
          type: string
        rid:
          description: 리소스 ID입니다(line_items.id 또는 recommendation_policies.id).
          format: uuid
          type: string
        rtype:
          allOf:
            - $ref: '#/components/schemas/AllocationResourceType'
          description: 대상에 할당된 리소스 유형입니다(line_item / recommendation_policy).
        status:
          allOf:
            - $ref: '#/components/schemas/AllocationStatus'
          default: pending
          description: '할당의 현재 상태입니다(예: pending, published, rejected).'
        tid:
          description: 대상 ID입니다(ad_units.id 또는 placements.id).
          format: uuid
          type: string
        ttype:
          allOf:
            - $ref: '#/components/schemas/TargetType'
          description: 대상 유형입니다(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: >-
            광고 로그 추적 모드입니다. OnAdResponse는 응답 시 송출 로그를 생성하고, OnEventTracker는 실제
            노출 시 이벤트 엔드포인트를 호출합니다.
        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 재정의입니다. 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`: 클라이언트에서 실제 노출 시 이벤트 엔드포인트를 호출합니다.
      enum:
        - on_ad_response
        - on_event_tracker
      type: string
    AdSource:
      properties:
        endpoint:
          description: 광고 소스의 엔드포인트입니다.
          type: string
        header_params:
          description: 광고 소스의 헤더 매개변수입니다.
        id:
          description: >-
            광고 소스의 고유 식별자입니다.


            일부 a2 코드 경로가 임의의 이름을 할당하므로 내부적으로 `String`을 사용하지만, 내보낸 스키마에서는 `UUID`로
            선언합니다.
          format: uuid
          type: string
        name:
          description: 광고 소스의 이름입니다.
          type: string
        query_params:
          description: 광고 소스의 쿼리 매개변수입니다.
        seller_id:
          description: 광고 소스의 판매자 ID입니다.
          type:
            - string
            - 'null'
        settings:
          allOf:
            - $ref: '#/components/schemas/AdSourceSettings'
          default:
            required_registration: false
          description: 광고 소스의 설정입니다.
        type:
          description: 광고 소스의 설명입니다.
          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를 선택적으로 재정의합니다.
          format: float
          minimum: 0
          type:
            - number
            - 'null'
        bidfloorcur:
          type:
            - string
            - 'null'
        clickbrowser:
          anyOf:
            - $ref: '#/components/schemas/Clickbrowser'
            - type: 'null'
          description: OpenRTB clickbrowser 브라우저 정보입니다.
        imp:
          anyOf:
            - $ref: '#/components/schemas/ImpOverride'
            - type: 'null'
          description: OpenRTB imp 수준의 재정의입니다.
        implicit_app_inference:
          anyOf:
            - $ref: '#/components/schemas/ImplicitAppInference'
            - type: 'null'
        source:
          anyOf:
            - $ref: '#/components/schemas/Source'
            - type: 'null'
          description: OpenRTB source 수준의 재정의입니다.
      type: object
    FrequencyCapping:
      properties:
        enabled:
          description: |-
            빈도 제한을 활성화합니다(1: 활성화, 0: 비활성화).
            활성화하면 사용자 단위 광고 제공 제한을 적용합니다.
          format: int32
          type: integer
        limit_multiple_click:
          description: 동일 사용자가 같은 광고를 여러 번 클릭하지 못하게 합니다. 1은 활성화, 0은 비활성화입니다.
          format: int32
          type: integer
        limit_user_impression:
          default:
            - limit_count: 0
              num_time_units: 0
              time_unit: day
          description: 시간 구간을 기준으로 사용자별 노출 제한을 정의합니다.
          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 브라우저 정보입니다.
      enum:
        - 0
        - 1
      type: integer
      x-enum-varnames:
        - Embedded
        - Native
    ImpOverride:
      properties:
        ext:
          allOf:
            - $ref: '#/components/schemas/ImpExtOverride'
          default: {}
          description: 외부로 전달되는 OpenRTB 재정의입니다.
        tagid:
          description: 외부로 전달되는 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: 지정된 시간 구간 내에서 허용되는 최대 노출 수입니다.
          format: uint32
          minimum: 0
          type: integer
        num_time_units:
          description: '빈도 제한에 사용할 시간 단위 수입니다(예: 1일, 2시간).'
          format: uint32
          minimum: 0
          type: integer
        time_unit:
          allOf:
            - $ref: '#/components/schemas/TimeUnit'
          description: 시간 단위입니다.
      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 설정입니다.
        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

````