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

# Upsert products

> Upsert products and their embeddings, this endpoint creates and updates all products that are in the list and delete all products that are not in the list.



## OpenAPI

````yaml /openapi.json post /api/public/product/upsert/{promptBlockId}
openapi: 3.0.0
info:
  title: Vambe AI API
  description: Vambe AI documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api.vambe.me
    description: Production Server
security: []
tags:
  - name: Vambe AI
    description: ''
paths:
  /api/public/product/upsert/{promptBlockId}:
    post:
      tags:
        - Product
      summary: Upsert products
      description: >-
        Upsert products and their embeddings, this endpoint creates and updates
        all products that are in the list and delete all products that are not
        in the list.
      operationId: PublicProductController_upsertProducts
      parameters:
        - name: promptBlockId
          required: true
          in: path
          description: The prompt block ID to upsert the products
          schema:
            type: string
        - name: x-api-key
          in: header
          description: API key needed to authorize the request
          required: true
          schema:
            type: string
      requestBody:
        required: true
        description: The payload to send with the products
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicUpsertProducts'
      responses:
        '201':
          description: Products upserted successfully.
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
components:
  schemas:
    PublicUpsertProducts:
      type: array
      items:
        type: object
        properties:
          name:
            type: string
            minLength: 1
          file_url:
            type: string
          description:
            description: >-
              In the description you only need to add words that help the AI do
              a semantic search, avoide placing here prices, links or other type
              of data that is not natural language
            type: string
            minLength: 1
            maxLength: 8192
          type:
            type: string
            enum:
              - shopify
              - vambe
              - woocommerce
              - axis
              - vtex
              - jumpseller
              - odoo
              - tiendanube
              - magento
              - custom_app
            x-enumNames:
              - Shopify
              - Vambe
              - WooCommerce
              - Axis
              - Vtex
              - Jumpseller
              - Odoo
              - TiendaNube
              - Magento
              - CustomApp
          currency:
            type: string
            enum:
              - CLP
              - USD
              - MXN
              - BRL
              - UF
              - ARS
              - COP
              - UYU
              - PEN
              - EUR
              - HNL
              - BOB
              - PYG
              - GTQ
              - NIO
              - PAB
              - CRC
              - DOP
              - VES
              - BZD
              - SRD
              - GYD
            x-enumNames:
              - CLP
              - USD
              - MXN
              - BRL
              - UF
              - ARS
              - COP
              - UYU
              - PEN
              - EUR
              - HNL
              - BOB
              - PYG
              - GTQ
              - NIO
              - PAB
              - CRC
              - DOP
              - VES
              - BZD
              - SRD
              - GYD
          price:
            type: number
            minimum: 0
            exclusiveMinimum: false
          external_id:
            type: string
          sku:
            type: string
          metadata:
            type: array
            items:
              type: object
              properties:
                key:
                  type: string
                  minLength: 1
                value:
                  type: string
                  minLength: 1
              required:
                - key
                - value
        required:
          - name
          - description
          - type
          - currency
          - price
          - external_id
          - metadata

````