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

# Replace Ad Schedule

> Replace all ad schedule entries on a campaign.



## OpenAPI

````yaml https://dev-api.cattix.com/openapi.json put /api/v1/google-ads/ad-schedule
openapi: 3.1.0
info:
  title: CATTIX API
  description: CATTIX Backend API
  version: 0.107.0
servers:
  - url: http://localhost:8000
    description: Local
  - url: https://dev-api.cattix.com
    description: Development
  - url: https://staging-api.cattix.com
    description: Staging
  - url: https://api.cattix.com
    description: Production
security: []
paths:
  /api/v1/google-ads/ad-schedule:
    put:
      tags:
        - Google Ads Management
      summary: Replace Ad Schedule
      description: Replace all ad schedule entries on a campaign.
      operationId: replace_ad_schedule_api_v1_google_ads_ad_schedule_put
      parameters:
        - name: customer_id
          in: query
          required: true
          schema:
            type: integer
            title: Customer Id
        - name: token_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Optional specific Token ID
            title: Token Id
          description: Optional specific Token ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceAdScheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CriteriaMutationResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    ReplaceAdScheduleRequest:
      properties:
        campaign_id:
          type: integer
          title: Campaign Id
          description: Campaign to replace schedule on
        entries:
          items:
            $ref: '#/components/schemas/AdScheduleEntryInput'
          type: array
          minItems: 1
          title: Entries
          description: New schedule entries (replaces all existing)
      type: object
      required:
        - campaign_id
        - entries
      title: ReplaceAdScheduleRequest
      description: Request to replace all ad schedule entries on a campaign.
    CriteriaMutationResult:
      properties:
        success:
          type: boolean
          title: Success
        successful_count:
          type: integer
          title: Successful Count
          default: 0
        failed_count:
          type: integer
          title: Failed Count
          default: 0
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Errors
      type: object
      required:
        - success
      title: CriteriaMutationResult
      description: Result of a campaign criteria mutation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AdScheduleEntryInput:
      properties:
        day_of_week:
          $ref: '#/components/schemas/DayOfWeek'
          description: Day of week (MONDAY, TUESDAY, ...)
        start_hour:
          type: integer
          maximum: 23
          minimum: 0
          title: Start Hour
          description: Start hour (0-23)
        start_minute:
          type: integer
          enum:
            - 0
            - 15
            - 30
            - 45
          title: Start Minute
          description: Start minute (0, 15, 30, 45)
          default: 0
        end_hour:
          type: integer
          maximum: 24
          minimum: 0
          title: End Hour
          description: End hour (0-24)
        end_minute:
          type: integer
          enum:
            - 0
            - 15
            - 30
            - 45
          title: End Minute
          description: End minute (0, 15, 30, 45)
          default: 0
      type: object
      required:
        - day_of_week
        - start_hour
        - end_hour
      title: AdScheduleEntryInput
      description: A single ad schedule time slot.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DayOfWeek:
      type: string
      enum:
        - MONDAY
        - TUESDAY
        - WEDNESDAY
        - THURSDAY
        - FRIDAY
        - SATURDAY
        - SUNDAY
      title: DayOfWeek
      description: Days of the week for ad scheduling.
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: api/v1/users/authorization/token

````