Upsert products
Product Catalog
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.
POST
Upsert products
Overview
Synchronize your entire product catalog with a product block. This endpoint creates new products, updates existing ones, and deletes products not in the request - providing a complete catalog sync. ⚠️ Important: Products not included in the request will be deleted from the block.Use Cases
- Full Catalog Sync: Replace entire catalog with current inventory
- Nightly Sync: Complete synchronization from e-commerce platform
- Inventory Management: Ensure only available products are in catalog
- Clean Sync: Remove discontinued products automatically
Authentication
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
promptBlockId | string | Yes | Product block ID to synchronize |
Request Body
Array of product objects (no limit):| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Product name |
description | string | Yes | Natural language description for AI (max 8192) |
price | number | Yes | Product price (positive number) |
currency | string | Yes | Currency code |
type | string | Yes | PRODUCT or SERVICE |
external_id | string | Yes | Your unique identifier |
file_url | string | No | Product image URL |
sku | string | No | Product SKU. Falls back to sku key in metadata |
metadata | array | Yes | Additional product data as key-value pairs |
⚠️ DELETES PRODUCTS: Any products in the block that are NOT in this
request will be permanently deleted.
Example Request
Behavior
What Happens
- Creates: Products with new
external_idare created - Updates: Products with existing
external_idare updated - Deletes: Products in block but NOT in request are deleted
- AI Embeddings: All products are re-indexed for AI search
Example Scenario
Before: Block has products A, B, C Request: Send products B (updated), D (new) After: Block has products B (updated), D (new) Deleted: Products A and CError Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid data |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Product block not found |
| 500 | Internal Server Error |
Related Endpoints
- POST /api/public/product/create/ - Add without deleting
- POST /api/public/product/delete/ - Delete specific products
- GET /api/public/product/product-blocks - List blocks
Headers
API key needed to authorize the request
Path Parameters
The prompt block ID to upsert the products
Body
application/json
The payload to send with the products
Minimum string length:
1In 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
Required string length:
1 - 8192Available options:
shopify, vambe, woocommerce, axis, vtex, jumpseller, odoo, tiendanube, magento, custom_app Available options:
CLP, USD, MXN, BRL, UF, ARS, COP, UYU, PEN, EUR, HNL, BOB, PYG, GTQ, NIO, PAB, CRC, DOP, VES, BZD, SRD, GYD Required range:
x > 0Response
Products upserted successfully.
