Batch Update Catalog Fields Public
curl --request PUT \
--url https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields_to_add": [
{
"field_name": "<string>",
"field_type": "<string>",
"description": "<string>",
"required": false,
"scope": "variant",
"field_category": "input",
"position": "bottom",
"workflow_id": "<string>",
"validation_rules": {},
"unit": "<string>",
"sample_values": [
"<string>"
]
}
],
"fields_to_update": [
{}
],
"fields_to_remove": [
"<string>"
],
"workflow_id": "<string>",
"reason": "Batch field operation"
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch"
payload = {
"fields_to_add": [
{
"field_name": "<string>",
"field_type": "<string>",
"description": "<string>",
"required": False,
"scope": "variant",
"field_category": "input",
"position": "bottom",
"workflow_id": "<string>",
"validation_rules": {},
"unit": "<string>",
"sample_values": ["<string>"]
}
],
"fields_to_update": [{}],
"fields_to_remove": ["<string>"],
"workflow_id": "<string>",
"reason": "Batch field operation"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields_to_add: [
{
field_name: '<string>',
field_type: '<string>',
description: '<string>',
required: false,
scope: 'variant',
field_category: 'input',
position: 'bottom',
workflow_id: '<string>',
validation_rules: {},
unit: '<string>',
sample_values: ['<string>']
}
],
fields_to_update: [{}],
fields_to_remove: ['<string>'],
workflow_id: '<string>',
reason: 'Batch field operation'
})
};
fetch('https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch', 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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fields_to_add' => [
[
'field_name' => '<string>',
'field_type' => '<string>',
'description' => '<string>',
'required' => false,
'scope' => 'variant',
'field_category' => 'input',
'position' => 'bottom',
'workflow_id' => '<string>',
'validation_rules' => [
],
'unit' => '<string>',
'sample_values' => [
'<string>'
]
]
],
'fields_to_update' => [
[
]
],
'fields_to_remove' => [
'<string>'
],
'workflow_id' => '<string>',
'reason' => 'Batch field operation'
]),
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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch"
payload := strings.NewReader("{\n \"fields_to_add\": [\n {\n \"field_name\": \"<string>\",\n \"field_type\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": false,\n \"scope\": \"variant\",\n \"field_category\": \"input\",\n \"position\": \"bottom\",\n \"workflow_id\": \"<string>\",\n \"validation_rules\": {},\n \"unit\": \"<string>\",\n \"sample_values\": [\n \"<string>\"\n ]\n }\n ],\n \"fields_to_update\": [\n {}\n ],\n \"fields_to_remove\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\",\n \"reason\": \"Batch field operation\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields_to_add\": [\n {\n \"field_name\": \"<string>\",\n \"field_type\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": false,\n \"scope\": \"variant\",\n \"field_category\": \"input\",\n \"position\": \"bottom\",\n \"workflow_id\": \"<string>\",\n \"validation_rules\": {},\n \"unit\": \"<string>\",\n \"sample_values\": [\n \"<string>\"\n ]\n }\n ],\n \"fields_to_update\": [\n {}\n ],\n \"fields_to_remove\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\",\n \"reason\": \"Batch field operation\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields_to_add\": [\n {\n \"field_name\": \"<string>\",\n \"field_type\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": false,\n \"scope\": \"variant\",\n \"field_category\": \"input\",\n \"position\": \"bottom\",\n \"workflow_id\": \"<string>\",\n \"validation_rules\": {},\n \"unit\": \"<string>\",\n \"sample_values\": [\n \"<string>\"\n ]\n }\n ],\n \"fields_to_update\": [\n {}\n ],\n \"fields_to_remove\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\",\n \"reason\": \"Batch field operation\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"catalog_id": "<string>",
"new_schema_version": "<string>",
"previous_schema_version": "<string>",
"message": "<string>",
"fields_added": [],
"fields_updated": [],
"fields_removed": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Catalog Schemas
Batch Update Catalog Fields Public
Batch add, update, and/or remove schema fields in one atomic operation (API key or user token).
Creates a single new schema version for all changes.
PUT
/
public
/
catalogs
/
{catalog_id}
/
schema
/
fields
/
batch
Batch Update Catalog Fields Public
curl --request PUT \
--url https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields_to_add": [
{
"field_name": "<string>",
"field_type": "<string>",
"description": "<string>",
"required": false,
"scope": "variant",
"field_category": "input",
"position": "bottom",
"workflow_id": "<string>",
"validation_rules": {},
"unit": "<string>",
"sample_values": [
"<string>"
]
}
],
"fields_to_update": [
{}
],
"fields_to_remove": [
"<string>"
],
"workflow_id": "<string>",
"reason": "Batch field operation"
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch"
payload = {
"fields_to_add": [
{
"field_name": "<string>",
"field_type": "<string>",
"description": "<string>",
"required": False,
"scope": "variant",
"field_category": "input",
"position": "bottom",
"workflow_id": "<string>",
"validation_rules": {},
"unit": "<string>",
"sample_values": ["<string>"]
}
],
"fields_to_update": [{}],
"fields_to_remove": ["<string>"],
"workflow_id": "<string>",
"reason": "Batch field operation"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fields_to_add: [
{
field_name: '<string>',
field_type: '<string>',
description: '<string>',
required: false,
scope: 'variant',
field_category: 'input',
position: 'bottom',
workflow_id: '<string>',
validation_rules: {},
unit: '<string>',
sample_values: ['<string>']
}
],
fields_to_update: [{}],
fields_to_remove: ['<string>'],
workflow_id: '<string>',
reason: 'Batch field operation'
})
};
fetch('https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch', 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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'fields_to_add' => [
[
'field_name' => '<string>',
'field_type' => '<string>',
'description' => '<string>',
'required' => false,
'scope' => 'variant',
'field_category' => 'input',
'position' => 'bottom',
'workflow_id' => '<string>',
'validation_rules' => [
],
'unit' => '<string>',
'sample_values' => [
'<string>'
]
]
],
'fields_to_update' => [
[
]
],
'fields_to_remove' => [
'<string>'
],
'workflow_id' => '<string>',
'reason' => 'Batch field operation'
]),
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://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch"
payload := strings.NewReader("{\n \"fields_to_add\": [\n {\n \"field_name\": \"<string>\",\n \"field_type\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": false,\n \"scope\": \"variant\",\n \"field_category\": \"input\",\n \"position\": \"bottom\",\n \"workflow_id\": \"<string>\",\n \"validation_rules\": {},\n \"unit\": \"<string>\",\n \"sample_values\": [\n \"<string>\"\n ]\n }\n ],\n \"fields_to_update\": [\n {}\n ],\n \"fields_to_remove\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\",\n \"reason\": \"Batch field operation\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields_to_add\": [\n {\n \"field_name\": \"<string>\",\n \"field_type\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": false,\n \"scope\": \"variant\",\n \"field_category\": \"input\",\n \"position\": \"bottom\",\n \"workflow_id\": \"<string>\",\n \"validation_rules\": {},\n \"unit\": \"<string>\",\n \"sample_values\": [\n \"<string>\"\n ]\n }\n ],\n \"fields_to_update\": [\n {}\n ],\n \"fields_to_remove\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\",\n \"reason\": \"Batch field operation\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields_to_add\": [\n {\n \"field_name\": \"<string>\",\n \"field_type\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": false,\n \"scope\": \"variant\",\n \"field_category\": \"input\",\n \"position\": \"bottom\",\n \"workflow_id\": \"<string>\",\n \"validation_rules\": {},\n \"unit\": \"<string>\",\n \"sample_values\": [\n \"<string>\"\n ]\n }\n ],\n \"fields_to_update\": [\n {}\n ],\n \"fields_to_remove\": [\n \"<string>\"\n ],\n \"workflow_id\": \"<string>\",\n \"reason\": \"Batch field operation\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"catalog_id": "<string>",
"new_schema_version": "<string>",
"previous_schema_version": "<string>",
"message": "<string>",
"fields_added": [],
"fields_updated": [],
"fields_removed": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
Body
application/json
Request to perform multiple schema field operations
Fields to add
Show child attributes
Show child attributes
Fields to update
Field names to remove
Workflow ID making these changes
Reason for the changes
⌘I