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

# Apply Migration

> Apply a recommended budget migration between campaigns.

Args:
    customer_id: The Google Ads customer ID
    migration: Migration details including donor and recipient campaigns
    oauth2_token: OAuth2 token for authentication
    current_user: Authenticated user

Returns:
    MigrationResultSchema: Results of the migration operation



## OpenAPI

````yaml https://dev-api.cattix.com/openapi.json post /api/v1/google-ads/migrations/apply
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/migrations/apply:
    post:
      tags:
        - Google Ads
      summary: Apply Migration
      description: |-
        Apply a recommended budget migration between campaigns.

        Args:
            customer_id: The Google Ads customer ID
            migration: Migration details including donor and recipient campaigns
            oauth2_token: OAuth2 token for authentication
            current_user: Authenticated user

        Returns:
            MigrationResultSchema: Results of the migration operation
      operationId: apply_migration_api_v1_google_ads_migrations_apply_post
      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/MigrationSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MigrationResultSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    MigrationSchema:
      properties:
        donor_campaign:
          type: string
          title: Donor Campaign
        recipient_campaign:
          type: string
          title: Recipient Campaign
        donor_cost_per_conv:
          type: number
          title: Donor Cost Per Conv
        recipient_cost_per_conv:
          type: number
          title: Recipient Cost Per Conv
        cost_per_conv_difference_percent:
          type: number
          title: Cost Per Conv Difference Percent
        z_score:
          type: number
          title: Z Score
        recommended_migration_amount:
          type: number
          title: Recommended Migration Amount
        donor_metrics:
          $ref: '#/components/schemas/MigrationMetricsSchema'
        recipient_metrics:
          $ref: '#/components/schemas/MigrationMetricsSchema'
      type: object
      required:
        - donor_campaign
        - recipient_campaign
        - donor_cost_per_conv
        - recipient_cost_per_conv
        - cost_per_conv_difference_percent
        - z_score
        - recommended_migration_amount
        - donor_metrics
        - recipient_metrics
      title: MigrationSchema
      description: The schema for a migration.
    MigrationResultSchema:
      properties:
        success:
          type: boolean
          title: Success
        donor_campaign:
          $ref: '#/components/schemas/CampaignBudgetChange'
        recipient_campaign:
          $ref: '#/components/schemas/CampaignBudgetChange'
        migration_amount:
          type: number
          title: Migration Amount
        message:
          type: string
          title: Message
      type: object
      required:
        - success
        - donor_campaign
        - recipient_campaign
        - migration_amount
        - message
      title: MigrationResultSchema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MigrationMetricsSchema:
      properties:
        conversions:
          type: number
          title: Conversions
        current_budget:
          type: number
          title: Current Budget
        impression_share:
          anyOf:
            - type: number
            - type: 'null'
          title: Impression Share
        abs_top_page_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Abs Top Page Rate
        visibility_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Visibility Score
      type: object
      required:
        - conversions
        - current_budget
      title: MigrationMetricsSchema
      description: The schema for migration metrics.
    CampaignBudgetChange:
      properties:
        name:
          type: string
          title: Name
        old_budget:
          type: number
          title: Old Budget
        new_budget:
          type: number
          title: New Budget
      type: object
      required:
        - name
        - old_budget
        - new_budget
      title: CampaignBudgetChange
    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
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: api/v1/users/authorization/token

````