Update item
curl --request POST \
--url https://api.neuronsearchlab.com/v1/items/{item_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Wireless Headphones v2",
"metadata": {
"category": "electronics",
"availability": "in_stock"
},
"active": true
}
'import requests
url = "https://api.neuronsearchlab.com/v1/items/{item_id}"
payload = {
"name": "Wireless Headphones v2",
"metadata": {
"category": "electronics",
"availability": "in_stock"
},
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Wireless Headphones v2',
metadata: {category: 'electronics', availability: 'in_stock'},
active: true
})
};
fetch('https://api.neuronsearchlab.com/v1/items/{item_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuronsearchlab.com/v1/items/{item_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Wireless Headphones v2',
'metadata' => [
'category' => 'electronics',
'availability' => 'in_stock'
],
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.neuronsearchlab.com/v1/items/{item_id}"
payload := strings.NewReader("{\n \"name\": \"Wireless Headphones v2\",\n \"metadata\": {\n \"category\": \"electronics\",\n \"availability\": \"in_stock\"\n },\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.neuronsearchlab.com/v1/items/{item_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Wireless Headphones v2\",\n \"metadata\": {\n \"category\": \"electronics\",\n \"availability\": \"in_stock\"\n },\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neuronsearchlab.com/v1/items/{item_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Wireless Headphones v2\",\n \"metadata\": {\n \"category\": \"electronics\",\n \"availability\": \"in_stock\"\n },\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "7f3a2c9e",
"object": "item",
"name": "Wireless Headphones",
"description": "Noise-cancelling Bluetooth headphones.",
"metadata": {
"category": "electronics",
"brand": "Acme"
},
"active": true,
"created": 1777478400,
"updated_at": 1777478500
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "Validation error",
"details": {
"fieldErrors": {
"name": [
"Required"
]
}
}
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized_no_client_id_in_jwt",
"message": "Unauthorized: No client ID in JWT"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"type": "not_found_error",
"code": "item_not_found",
"message": "Item not found"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Items
Update item
Update an existing catalog item.
POST
/
v1
/
items
/
{item_id}
Update item
curl --request POST \
--url https://api.neuronsearchlab.com/v1/items/{item_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Wireless Headphones v2",
"metadata": {
"category": "electronics",
"availability": "in_stock"
},
"active": true
}
'import requests
url = "https://api.neuronsearchlab.com/v1/items/{item_id}"
payload = {
"name": "Wireless Headphones v2",
"metadata": {
"category": "electronics",
"availability": "in_stock"
},
"active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Wireless Headphones v2',
metadata: {category: 'electronics', availability: 'in_stock'},
active: true
})
};
fetch('https://api.neuronsearchlab.com/v1/items/{item_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuronsearchlab.com/v1/items/{item_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Wireless Headphones v2',
'metadata' => [
'category' => 'electronics',
'availability' => 'in_stock'
],
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.neuronsearchlab.com/v1/items/{item_id}"
payload := strings.NewReader("{\n \"name\": \"Wireless Headphones v2\",\n \"metadata\": {\n \"category\": \"electronics\",\n \"availability\": \"in_stock\"\n },\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.neuronsearchlab.com/v1/items/{item_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Wireless Headphones v2\",\n \"metadata\": {\n \"category\": \"electronics\",\n \"availability\": \"in_stock\"\n },\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.neuronsearchlab.com/v1/items/{item_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Wireless Headphones v2\",\n \"metadata\": {\n \"category\": \"electronics\",\n \"availability\": \"in_stock\"\n },\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "7f3a2c9e",
"object": "item",
"name": "Wireless Headphones",
"description": "Noise-cancelling Bluetooth headphones.",
"metadata": {
"category": "electronics",
"brand": "Acme"
},
"active": true,
"created": 1777478400,
"updated_at": 1777478500
}{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "Validation error",
"details": {
"fieldErrors": {
"name": [
"Required"
]
}
}
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized_no_client_id_in_jwt",
"message": "Unauthorized: No client ID in JWT"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"type": "not_found_error",
"code": "item_not_found",
"message": "Item not found"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Description
Updates an existing item. All body fields are optional, but at least one field must be supplied. Ifname, description, or metadata changes, the item embedding is refreshed.
PATCH /v1/items/{item_id} is also available as a compatibility alias with the same request and response shape.
Request
POST /v1/items/7f3a2c9e
{
"name": "Wireless Headphones v2",
"metadata": {
"category": "electronics",
"availability": "in_stock"
},
"active": true
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | Replacement item name. |
description | string | no | Replacement description. |
metadata | object | no | Replacement metadata object. |
active | boolean | no | Whether the item is eligible for recommendations. |
Response
{
"id": "7f3a2c9e",
"object": "item",
"name": "Wireless Headphones v2",
"description": "Noise-cancelling Bluetooth headphones.",
"metadata": {
"category": "electronics",
"availability": "in_stock"
},
"active": true,
"created": 1777478400,
"updated_at": 1777478500
}
Errors
| Status | Scenario |
|---|---|
400 | Malformed item ID, empty body, or invalid field |
404 | Item does not exist for the authenticated tenant |
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Public item ID.
Pattern:
^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$Body
application/json
Partial item update. At least one field must be supplied.
Response
Updated item
Pattern:
^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$Example:
"7f3a2c9e"
Available options:
item Example:
"Wireless Headphones"
Example:
"Noise-cancelling Bluetooth headphones."
Arbitrary JSON object used for filtering, ranking, and debugging.
Example:
{
"category": "electronics",
"brand": "Acme",
"price": 10999,
"currency": "usd"
}
Example:
true
Unix timestamp in seconds.
Example:
1777478400
Unix timestamp in seconds.
Example:
1777478500
Was this page helpful?
⌘I

