---
title: "Batch Update Catalog Fields Public"
method: PUT
path: "/public/catalogs/{catalog_id}/schema/fields/batch"
tags: ["Catalog Schemas"]
---

# Batch Update Catalog Fields Public

`PUT /public/catalogs/{catalog_id}/schema/fields/batch`

## Request

- Base URL: `https://catalogapi.rastro.ai/api`
- URL: `https://catalogapi.rastro.ai/api/public/catalogs/{catalog_id}/schema/fields/batch`
- Auth: HTTP bearer

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.

## Path parameters

- `catalog_id` string, required

## Headers

- `X-Organization-Id` string, nullable

## Request body

- BatchSchemaFieldRequest: Request to perform multiple schema field operations
  - `fields_to_add` AddSchemaFieldRequest[]: Fields to add
    - `field_name` string, required: Name of the field to add
    - `field_type` string, required: Field type: string, number, boolean, array, object
    - `description` string, nullable: Field description
    - `required` boolean: Whether field is required
    - `scope` string: Field scope: variant, product, both. Accepted by the request model; the single-field public route does not apply scope metadata.
    - `field_category` string: Field category: input or generated. Stored as workflow-tracking metadata when workflow_id is provided.
    - `position` string: Where to add field: top or bottom
    - `workflow_id` string, nullable: Workflow ID that's adding this field
    - `validation_rules` object, nullable: JSON Schema validation rules (pattern, enum, minLength, etc.)
    - `unit` string, nullable: Unit of measurement (e.g., 'V', 'W', 'kg', 'm')
    - `sample_values` string[], nullable: Sample values to help understand expected formats
  - `fields_to_update` object[]: Fields to update
  - `fields_to_remove` string[]: Field names to remove
  - `workflow_id` string, nullable: Workflow ID making these changes
  - `reason` string: Reason for the changes

## Response `200`

Successful Response

- SchemaFieldOperationResponse: Response for schema field operations
  - `success` boolean, required
  - `catalog_id` string, required
  - `new_schema_version` string, required
  - `previous_schema_version` string, required
  - `fields_added` string[]
  - `fields_updated` string[]
  - `fields_removed` string[]
  - `message` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/rastro-ai/apis/rastro-public-api.md) - [All operations](https://skmtc.dev/rastro-ai/apis/rastro-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rastro-ai/apis/rastro-public-api/revisions/57c8ed4854bb?raw)
