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

# Assign Resources to Client Account Configuration

> Replaces all resource assignments for a client account configuration with the provided set.

## Authentication
All requests require an `Authorization` header using Bearer token authentication:
`Authorization: Bearer <api_key>`



## OpenAPI

````yaml POST /api/v2/client-account-configurations/{client_account_configuration_id}/resources/assign
openapi: 3.1.0
info:
  title: VoiceAIWrapper API
  description: >-
    REST API for managing campaigns, leads, clients, web widgets, and voice
    providers on VoiceAIWrapper.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.voiceaiwrapper.app
security:
  - bearerAuth: []
paths:
  /api/v2/client-account-configurations/{client_account_configuration_id}/resources/assign:
    post:
      tags:
        - Client Account Configurations
      summary: Assign Resources to Client Account Configuration
      description: >-
        Replaces all resource assignments for a client account configuration
        with the provided set.


        ## Authentication

        All requests require an `Authorization` header using Bearer token
        authentication:

        `Authorization: Bearer <api_key>`
      operationId: assignResourcesToAssetGroup
      parameters:
        - name: client_account_configuration_id
          in: path
          required: true
          description: Global ID of the client account configuration. Required.
          schema:
            type: string
            example: Q2xpZW50QXNzZXRHcm91cDoxMjM=
      requestBody:
        required: true
        description: Resource assignments to apply
        content:
          application/json:
            schema:
              type: object
              required:
                - assigned_resources
              properties:
                assigned_resources:
                  $ref: '#/components/schemas/AssignedResources'
                  description: >-
                    Map of resource types to lists of global IDs. Required. At
                    least one resource type with a non-empty list must be
                    provided.
      responses:
        '200':
          description: >-
            Resources assigned to client account configuration successfully.
            Returns the Client Account Configuration ID and validated resource
            assignments.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                    example: >-
                      Resources assigned to client account configuration
                      successfully
                  data:
                    type: object
                    properties:
                      asset_group_id:
                        type: string
                      assigned_resources:
                        $ref: '#/components/schemas/AssignedResources'
        '400':
          description: >-
            Invalid request data. Common causes: missing or empty
            assigned_resources, invalid resource IDs, or resource type
            validation failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithList'
              example:
                message: Invalid data
                errors:
                  - Assigned resources cannot be empty
        '401':
          description: Authentication failed. Ensure the Bearer token is present and valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: >-
            Resource not found. The client account configuration does not exist
            or does not belong to your tenant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithList'
              example:
                message: >-
                  Client Account Configuration not found or does not belong to
                  this tenant
                errors:
                  - Invalid client_account_configuration_id
        '500':
          description: Internal server error. Contact support if this persists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    AssignedResources:
      type: object
      properties:
        assistant:
          type: array
          items:
            type: string
          example:
            - asst_abc123
        vapi_workflow:
          type: array
          items:
            type: string
          example: []
        vapi_squad:
          type: array
          items:
            type: string
          example: []
        phone_number:
          type: array
          items:
            type: string
          example: []
        phone_number_pool:
          type: array
          items:
            type: string
          example: []
        knowledge_base:
          type: array
          items:
            type: string
          example: []
        tools_and_functions:
          type: array
          items:
            type: string
          example: []
        campaign:
          type: array
          items:
            type: string
          example:
            - Vm9pY2VDYW1wYWlnbjoxMjM=
    ErrorWithList:
      type: object
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            type: string
    ErrorMessage:
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````