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

# Attach Products

> Attaches one or more products to the agent. After the attach succeeds,
the service triggers `Ai::AgentProductSyncService` to update the
agent's config in evo-ai-core-service.

Requires `agents.update`.




## OpenAPI

````yaml /api-reference/openapi/EvoAI-CRM-Service/ai-agent-products.yaml post /api/v1/ai_agents/{ai_agent_id}/products
openapi: 3.0.4
info:
  title: Evolution Foundation - CRM Service - AI Agent Products
  description: >
    Attach and detach products to AI agents. The agent's config (which lives in

    evo-ai-core-service) is automatically synced when products are

    attached/detached, so the agent picks up the new catalog on its next

    conversation.


    Available starting `v1.0.0-rc3`.


    **Note:** This OpenAPI spec was generated from the controller as part of the
    rc3 release. Schemas reflect the controller surface but request/response
    examples may need refinement based on real payloads.
  version: 1.0.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3000
    description: Development server
security: []
paths:
  /api/v1/ai_agents/{ai_agent_id}/products:
    parameters:
      - name: ai_agent_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: ID of the AI agent
    post:
      summary: Attach Products
      description: |
        Attaches one or more products to the agent. After the attach succeeds,
        the service triggers `Ai::AgentProductSyncService` to update the
        agent's config in evo-ai-core-service.

        Requires `agents.update`.
      operationId: attach-products-to-agent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  required:
                    - product_ids
                  properties:
                    product_ids:
                      type: array
                      items:
                        type: string
                        format: uuid
                      description: List of product IDs to attach (preferred)
                - type: object
                  required:
                    - product_id
                  properties:
                    product_id:
                      type: string
                      format: uuid
                      description: Single product ID (legacy shape)
      responses:
        '200':
          description: Products attached successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      ai_agent_id:
                        type: string
                        format: uuid
                      attached:
                        type: array
                        items:
                          type: string
                          format: uuid
                        description: IDs of products that were attached in this request
                  message:
                    type: string
        '400':
          description: Bad request — missing product_ids/product_id
        '404':
          description: AI agent or one of the products not found
      security:
        - userApiKey: []
components:
  securitySchemes:
    userApiKey:
      type: apiKey
      in: header
      name: api_access_token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.