> ## 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 a placement

> Updates an existing placement with new information
    and returns the updated placement details.



## OpenAPI

````yaml /openapi/adm.openapi.en-0.2.2.json patch /placements
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: 0.1.3
servers: []
security: []
tags:
  - name: Audience Targeting
  - description: >

      The Audience Management APIs to seamlessly integrate Audience-related
      data.  


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Audience
  - description: >
      APIs for collecting user activity data to enhance ad targeting and
      performance optimization.


      Activity Data captures actual user behavior data like product views,
      searches, cart additions, and purchases across all users, regardless of ad
      interactions.


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Activity Log
  - description: >

      The Audience Attribute API provides access to audience attribute data.


      References:

      - [Audience
      Targeting](https://docs.aiderx.io/guides/about-a2/en/audience-targeting)
    name: Audience Attribute
  - description: >

      The Audience Segment API provides access to audience segment data.


      References:

      - [Audience
      Targeting](https://docs.aiderx.io/guides/about-a2/en/audience-targeting)
    name: Audience Segment
  - description: The Analytic API provides access to dashboard and A2 metric data.
    name: Analytic
  - description: >

      The Billing API manages billing information.

      A2 is configured to work with the payment systems used by your retail
      platform.


      To integrate payments, first you need to register an external channel.

      For more information about integrating A2 with external channels, check
      out [the External channels
      page](https://docs.aiderx.io/guides/about-a2/en/external-channel).
    name: Billing
  - description: |

      The Campaign API allows you to manage data related to campaigns.

      References:
      - [Campaign](https://docs.aiderx.io/guides/about-a2/en/campaign)
    name: Campaign
  - description: >

      The Creative API provides comprehensive functionalities for managing
      creative assets and related resources.


      References:

      - [Creative](https://docs.aiderx.io/guides/about-a2/en/creative)
    name: Creative
  - description: >

      The Allocation API provides comprehensive functionalities for managing
      allocation and related resources.


      References:

      - [Allocation](https://docs.aiderx.io/guides/about-a2/en/allocation)
    name: Allocation
  - description: >

      The Media Library API provides comprehensive functionalities for managing
      media library and related resources.


      References:

      - [Media Library](https://docs.aiderx.io/guides/about-a2/en/media-library)
    name: Media Library
  - description: >

      The Catalog Management API provides functionalities for managing catalogs
      and related resources.


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Catalog
  - description: >

      The Placement Management API provides comprehensive functionalities for
      managing placements and related resources.


      References:

      - [Placement](https://docs.aiderx.io/guides/about-a2/en/placement)
    name: Placement
  - description: >

      Placement Catalog transforms the placement information into a structured
      “advertising product” that can be easily showcased to advertisers.


      References:

      - To be updated
    name: Placement Catalog
  - description: >

      The System APIs allow you to access and manage system-level settings and
      assets, such as logos and configuration values.


      References:

      - [Yield Optimization
      Settings](https://docs.aiderx.io/guides/about-a2/en/yield-optimization)
    name: System
  - description: >

      The Auth and User API provides authentication and user management
      functionalities.


      References:

      - [Account and
      Budget](https://docs.aiderx.io/guides/about-a2/en/account-and-budget)
    name: Auth and User
  - description: |

      The License API provides license management functionalities.
    name: License
paths:
  /placements:
    patch:
      tags:
        - Placement
      summary: Update a placement
      description: |-
        Updates an existing placement with new information
            and returns the updated placement details.
      operationId: handle_update_placement_placements_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlacementUpdateSchema'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlacementSchema'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Bad Request
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionResponse'
          description: Internal Server Error
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    PlacementUpdateSchema:
      description: Schema for updating placement entity.
      properties:
        campaign_permission:
          $ref: '#/components/schemas/Permission'
          default:
            black: []
            white: []
          deprecated: true
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: The date and time the entity was created.
          title: Created At
        created_by:
          description: The ID of the user who created the placement
          format: uuid
          title: Created By
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The description in JSON Quill Delta format - a JSON format that
            represents rich text content
                    
            Links:
            [https://quilljs.com/docs/delta](https://quilljs.com/docs/delta)
          title: Description
        display:
          $ref: '#/components/schemas/Display'
          default:
            clktype: 1
            displayfmt:
              ext: {}
              h: 250
              w: 300
            h: 250
            mime: []
            nativefmt:
              ext: {}
            w: 300
        ext:
          $ref: '#/components/schemas/PlacementExt'
          default:
            approval_method: admin
            display:
              enabled: 0
            native:
              enabled: 0
            payout: rates
            responsive: fixed
            target_ecpm: 0
            video:
              enabled: 0
        id:
          description: The ID of the placement
          format: uuid
          title: Id
          type: string
        is_active:
          default: false
          title: Is Active
          type: boolean
        name:
          description: The name of the placement
          title: Name
          type: string
        partial_safe_update_only:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          description: >-
            Updates fields that can be modified even when the placement is in
            use:

            1. Name

            2. Description

            3. Target eCPM
          title: Partial Safe Update Only
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: The date and time the entity was last updated.
          title: Updated At
        video:
          $ref: '#/components/schemas/a2_adm__db__models__placement__Video'
          default:
            clktype: 1
            ctype:
              - 2
            delay: 0
            h: 300
            linear: 0
            maxdur: 0
            mime: []
            mindur: 0
            playmethod: []
            ptype: 1
            skip: 0
            skipafter: 0
            skipmin: 0
            w: 480
      required:
        - name
        - created_by
        - id
      title: PlacementUpdateSchema
      type: object
    PlacementSchema:
      description: Schema for placement entity.
      properties:
        campaign_permission:
          $ref: '#/components/schemas/Permission'
          default:
            black: []
            white: []
          deprecated: true
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: The date and time the entity was created.
          title: Created At
        created_by:
          description: The ID of the user who created the placement
          format: uuid
          title: Created By
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The description in JSON Quill Delta format - a JSON format that
            represents rich text content
                    
            Links:
            [https://quilljs.com/docs/delta](https://quilljs.com/docs/delta)
          title: Description
        display:
          $ref: '#/components/schemas/Display'
          default:
            clktype: 1
            displayfmt:
              ext: {}
              h: 250
              w: 300
            h: 250
            mime: []
            nativefmt:
              ext: {}
            w: 300
        ext:
          $ref: '#/components/schemas/PlacementExt'
          default:
            approval_method: admin
            display:
              enabled: 0
            native:
              enabled: 0
            payout: rates
            responsive: fixed
            target_ecpm: 0
            video:
              enabled: 0
        id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Id
        is_active:
          default: false
          title: Is Active
          type: boolean
        name:
          description: The name of the placement
          title: Name
          type: string
        'no':
          title: 'No'
          type: integer
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: The date and time the entity was last updated.
          title: Updated At
        video:
          $ref: '#/components/schemas/a2_adm__db__models__placement__Video'
          default:
            clktype: 1
            ctype:
              - 2
            delay: 0
            h: 300
            linear: 0
            maxdur: 0
            mime: []
            mindur: 0
            playmethod: []
            ptype: 1
            skip: 0
            skipafter: 0
            skipmin: 0
            w: 480
      required:
        - name
        - created_by
        - 'no'
      title: PlacementSchema
      type: object
    HTTPExceptionResponse:
      description: HTTPException response model.
      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
    Permission:
      description: Permission
      properties:
        black:
          default: []
          items:
            type: string
          title: Black
          type: array
        white:
          default: []
          items:
            type: string
          title: White
          type: array
      title: Permission
      type: object
    Display:
      description: |-
        Schema for display placement.
        It contains specifications for banner display formats, native formats,
        and other display-related properties.
      properties:
        clktype:
          default: 1
          enum:
            - 0
            - 1
            - 2
            - 3
          title: Clktype
          type: integer
        displayfmt:
          $ref: '#/components/schemas/DisplayFormat'
          default:
            ext: {}
            h: 250
            w: 300
        h:
          default: 250
          title: H
          type: integer
        mime:
          items:
            type: string
          title: Mime
          type: array
        nativefmt:
          $ref: '#/components/schemas/NativeFormat'
          default:
            ext: {}
        w:
          default: 300
          title: W
          type: integer
      title: Display
      type: object
    PlacementExt:
      description: Schema for placement default extra configuration.
      properties:
        approval_method:
          $ref: '#/components/schemas/PlacementApproval'
          default: admin
        display:
          default:
            enabled: 0
          title: Display
          type: object
        native:
          default:
            enabled: 0
          title: Native
          type: object
        payout:
          $ref: '#/components/schemas/PlacementPayout'
          default: rates
        responsive:
          $ref: '#/components/schemas/PlacementResponsiveness'
          default: fixed
        target_ecpm:
          default: 0
          title: Target Ecpm
          type: number
        video:
          default:
            enabled: 0
          title: Video
          type: object
      title: PlacementExt
      type: object
    a2_adm__db__models__placement__Video:
      description: >-
        Schema for video placement. It contains specifications for video
        placement formats,

        and other video-related properties.
      properties:
        clktype:
          default: 1
          enum:
            - 0
            - 1
            - 2
            - 3
          title: Clktype
          type: integer
        ctype:
          default:
            - 2
          items:
            type: integer
          title: Ctype
          type: array
        delay:
          default: 0
          title: Delay
          type: integer
        h:
          default: 300
          title: H
          type: integer
        linear:
          default: 0
          enum:
            - 0
            - 1
            - 2
          title: Linear
          type: integer
        maxdur:
          default: 0
          title: Maxdur
          type: integer
        mime:
          default: []
          items:
            type: string
          title: Mime
          type: array
        mindur:
          default: 0
          title: Mindur
          type: integer
        playmethod:
          default: []
          items:
            enum:
              - 1
              - 2
              - 3
              - 4
              - 5
              - 6
              - 7
            type: integer
          title: Playmethod
          type: array
        ptype:
          default: 1
          enum:
            - 1
            - 2
            - 3
            - 4
          title: Ptype
          type: integer
        skip:
          default: 0
          enum:
            - 0
            - 1
          title: Skip
          type: integer
        skipafter:
          default: 0
          title: Skipafter
          type: integer
        skipmin:
          default: 0
          title: Skipmin
          type: integer
        w:
          default: 480
          title: W
          type: integer
      title: Video
      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
    DisplayFormat:
      description: >-
        Array of objects that govern the attributes (e.g., sizes) of a banner
        display

        placement.

        Refer to Object: DisplayFormat.
      properties:
        ext:
          title: Ext
          type: object
        h:
          default: 250
          title: H
          type: integer
        w:
          default: 300
          title: W
          type: integer
      title: DisplayFormat
      type: object
    NativeFormat:
      description: >-
        Schema for native placement. It contains specifications for native
        placement formats,

        and other native-related properties.
      properties:
        ext:
          title: Ext
          type: object
      title: NativeFormat
      type: object
    PlacementApproval:
      description: >-
        Approval process method for placement publication requests. 


        `delegate`: Advertisers with placement publication rights can decide on
        campaign exposure without the placement manager's approval  

        `admin`: Placement manager must approve the campaign exposure request
      enum:
        - admin
        - delegate
      title: PlacementApproval
      type: string
    PlacementPayout:
      description: >-
        Default billing is optimized CPC, CPM, or CPA amount determined by the
        algorithm.


        `none`: No payout is calculated for the placement  

        `rates`: Optimized CPC, CPM, or CPA amount determined by the algorithm
      enum:
        - none
        - rates
      title: PlacementPayout
      type: string
    PlacementResponsiveness:
      description: |-
        Defines how ad creative is displayed in placement area

        `fixed`: Display ad creative in its original size without modification
        `resized`: Adjust ad creative size to fit the placement area dimensions
      enum:
        - fixed
        - resized
      title: PlacementResponsiveness
      type: string
  securitySchemes:
    OAuth2PasswordBearer:
      flows:
        password:
          scopes: {}
          tokenUrl: auth/jwt/login
      type: oauth2

````