---
title: "Add Catalog Field Public"
method: POST
path: "/public/catalogs/{catalog_id}/schema/fields"
tags: ["Catalog Schemas"]
---

# Add Catalog Field Public

`POST /public/catalogs/{catalog_id}/schema/fields`

## Request

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

Add a new field to the catalog schema (API key or user token).

Creates a new schema version with the additional field.

## Path parameters

- `catalog_id` string, required

## Headers

- `X-Organization-Id` string, nullable

## Request body

- AddSchemaFieldRequest: Request to add a field to catalog schema
  - `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

## 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)
