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

> 
Stores campaign information in the cache.
Used during ad selection and mediation logic.




## OpenAPI

````yaml /openapi/decision.api.en-0.2.2.json post /api/cache/campaigns
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: v0.2.2
  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: >-

      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 ad conversion, impression, and click logs — essential
      for tracking and optimizing advertisement performance.
    name: Ad Serving
paths:
  /api/cache/campaigns:
    post:
      tags:
        - Cache Management
      summary: Update Campaigns
      description: |

        Stores campaign information in the cache.
        Used during ad selection and mediation logic.
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/Campaign'
              type: array
        required: true
      responses:
        '204':
          description: Success
        '404':
          description: Campaign not found.
        '500':
          description: Internal Server Error.
      security:
        - '': []
components:
  schemas:
    Campaign:
      properties:
        audience_segments:
          anyOf:
            - $ref: '#/components/schemas/CampaignAudienceSegment'
            - type: 'null'
          description: Optional audience segments associated with the campaign
        bid_strategy:
          default: highest_volume
          description: 'Bid strategy for the campaign (default: "highest_volume")'
          type: string
        budget:
          description: Total budget of the campaign
          format: double
          type: number
        crid:
          description: Optional creative ID associated with the campaign
          type:
            - string
            - 'null'
        daily_budget:
          description: Optional daily budget of the campaign
          format: double
          type:
            - number
            - 'null'
        end_date:
          description: End date of the campaign (UTC)
          format: date-time
          type: string
        goal:
          description: Goal of the campaign
          type: string
        id:
          description: ID of the campaign (uuid4)
          type: string
        max_bid:
          default: 0
          description: 'Maximum bid amount for the campaign (default: 0.0)'
          format: double
          type: number
        min_daily_imp:
          default: 1000
          description: 'Minimum daily impressions for the campaign (default: 1000.0)'
          format: double
          type: number
        start_date:
          description: Start date of the campaign (UTC)
          format: date-time
          type: string
        status:
          description: Status of the campaign
          type: string
        sub_goal:
          default: maximize_volume
          description: 'Sub-goal of the campaign (default: "maximize_volume")'
          type: string
        tagid:
          description: Optional tag ID associated with the campaign
          type:
            - string
            - 'null'
        target_cpa:
          description: Target cost per acquisition (CPA) for the campaign
          format: double
          type: number
        target_cpm:
          default: 0
          description: >-
            Target cost per thousand impressions (CPM) for the campaign
            (default: 0.0)
          format: double
          type: number
        target_volume:
          default: 0
          description: 'Target volume for the campaign (default: 0.0)'
          format: double
          type: number
      required:
        - budget
        - end_date
        - goal
        - id
        - start_date
        - status
        - target_cpa
      type: object
    CampaignAudienceSegment:
      properties:
        method:
          description: >-
            Matching method for audience segments (e.g., "OR", "AND").
            Determines how multiple segments in the list are evaluated.
          type: string
        segment_list:
          description: List of audience segment conditions for targeting.
          items:
            $ref: '#/components/schemas/AudienceSegmentInfo'
          type: array
      required:
        - method
        - segment_list
      type: object
    AudienceSegmentInfo:
      properties:
        id:
          description: Unique identifier for the audience segment.
          type: string
        name:
          description: Human-readable name for the audience segment.
          type: string
      required:
        - id
        - name
      type: object

````