> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rastro.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Catalog Field Public

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

Creates a new schema version with the additional field.



## OpenAPI

````yaml /api-reference/openapi.json post /public/catalogs/{catalog_id}/schema/fields
openapi: 3.1.0
info:
  title: Rastro Public API
  description: >-
    Public API for enrichment, catalog management, workflows, activities,
    snapshots, taxonomy, and MCP integrations.
  version: 0.1.0
servers:
  - url: https://catalogapi.rastro.ai/api
security:
  - bearerAuth: []
paths:
  /public/catalogs/{catalog_id}/schema/fields:
    post:
      tags:
        - Catalog Schemas
      summary: Add Catalog Field Public
      description: |-
        Add a new field to the catalog schema (API key or user token).

        Creates a new schema version with the additional field.
      operationId: >-
        add_catalog_field_public_api_public_catalogs__catalog_id__schema_fields_post
      parameters:
        - name: catalog_id
          in: path
          required: true
          schema:
            type: string
            title: Catalog Id
        - name: X-Organization-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Organization-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddSchemaFieldRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaFieldOperationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    AddSchemaFieldRequest:
      properties:
        field_name:
          type: string
          title: Field Name
          description: Name of the field to add
        field_type:
          type: string
          title: Field Type
          description: 'Field type: string, number, boolean, array, object'
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Field description
        required:
          type: boolean
          title: Required
          description: Whether field is required
          default: false
        scope:
          type: string
          title: Scope
          description: >-
            Field scope: variant, product, both. Accepted by the request model;
            the single-field public route does not apply scope metadata.
          default: variant
        field_category:
          type: string
          title: Field Category
          description: >-
            Field category: input or generated. Stored as workflow-tracking
            metadata when workflow_id is provided.
          default: input
        position:
          type: string
          title: Position
          description: 'Where to add field: top or bottom'
          default: bottom
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Id
          description: Workflow ID that's adding this field
        validation_rules:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Validation Rules
          description: JSON Schema validation rules (pattern, enum, minLength, etc.)
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
          description: Unit of measurement (e.g., 'V', 'W', 'kg', 'm')
        sample_values:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Sample Values
          description: Sample values to help understand expected formats
      type: object
      required:
        - field_name
        - field_type
      title: AddSchemaFieldRequest
      description: Request to add a field to catalog schema
    SchemaFieldOperationResponse:
      properties:
        success:
          type: boolean
          title: Success
        catalog_id:
          type: string
          title: Catalog Id
        new_schema_version:
          type: string
          title: New Schema Version
        previous_schema_version:
          type: string
          title: Previous Schema Version
        fields_added:
          items:
            type: string
          type: array
          title: Fields Added
          default: []
        fields_updated:
          items:
            type: string
          type: array
          title: Fields Updated
          default: []
        fields_removed:
          items:
            type: string
          type: array
          title: Fields Removed
          default: []
        message:
          type: string
          title: Message
      type: object
      required:
        - success
        - catalog_id
        - new_schema_version
        - previous_schema_version
        - message
      title: SchemaFieldOperationResponse
      description: Response for schema field operations
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Rastro API key or user token

````