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

# Assign Customer To Company

> Assign a Google Ads customer to a company.

The user must be a member of the target company to perform this operation.

Args:
    customer_id: The Google Ads customer ID to assign
    assign_customer_to_company_data: Request body containing the `company_id` to which the customer will be assigned
    oauth2_token: The `OAuth2Token` used to verify that the user has the ownership of the `GoogleAdsCustomer`
    current_user: The currently authenticated User


Returns:
    GoogleAdsCustomerSchema: The updated Google Ads customer with new company assigned.

Raises:
    HTTPException: 404 if customer or company not found, 403 if user is not a member of target company



## OpenAPI

````yaml https://dev-api.cattix.com/openapi.json patch /api/v1/google-ads-database-data/customers/{customer_id}/company
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-database-data/customers/{customer_id}/company:
    patch:
      tags:
        - Google Ads Database
      summary: Assign Customer To Company
      description: >-
        Assign a Google Ads customer to a company.


        The user must be a member of the target company to perform this
        operation.


        Args:
            customer_id: The Google Ads customer ID to assign
            assign_customer_to_company_data: Request body containing the `company_id` to which the customer will be assigned
            oauth2_token: The `OAuth2Token` used to verify that the user has the ownership of the `GoogleAdsCustomer`
            current_user: The currently authenticated User


        Returns:
            GoogleAdsCustomerSchema: The updated Google Ads customer with new company assigned.

        Raises:
            HTTPException: 404 if customer or company not found, 403 if user is not a member of target company
      operationId: >-
        assign_customer_to_company_api_v1_google_ads_database_data_customers__customer_id__company_patch
      parameters:
        - name: customer_id
          in: path
          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/AssignCustomerToCompanyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api__google_ads__database_data__schemas__GoogleAdsCustomerSchema
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    AssignCustomerToCompanyRequest:
      properties:
        company_id:
          type: integer
          title: Company Id
          description: The company ID to assign the customer to
      type: object
      required:
        - company_id
      title: AssignCustomerToCompanyRequest
      description: Request schema for assigning a Google Ads customer to a company.
    api__google_ads__database_data__schemas__GoogleAdsCustomerSchema:
      properties:
        id:
          type: integer
          title: Id
          description: The customer ID
        date_added:
          type: string
          format: date-time
          title: Date Added
        date_updated:
          type: string
          format: date-time
          title: Date Updated
        is_active:
          type: boolean
          title: Is Active
          default: true
        is_deleted:
          type: boolean
          title: Is Deleted
          default: false
        descriptive_name:
          type: string
          title: Descriptive Name
          description: The descriptive name of the customer
        currency_code:
          type: string
          title: Currency Code
          description: The currency code
        time_zone:
          type: string
          title: Time Zone
          description: The time zone
        status:
          type: string
          title: Status
          description: The status of the customer
        manager:
          type: boolean
          title: Manager
          description: Whether the customer is a manager account
      type: object
      required:
        - id
        - date_added
        - date_updated
        - descriptive_name
        - currency_code
        - time_zone
        - status
        - manager
      title: GoogleAdsCustomerSchema
      description: Schema for GoogleAdsCustomer model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````