Enrich

Infer Schema From File

Analyze an uploaded file and infer enrichment configuration.

Upload a CSV or Excel file, and get back:

  • suggested_schema: JSON Schema with all fields (existing + suggested enrichments)
  • web_enrichment_fields: Fields to use with /public/enrich endpoint
  • suggested_taxonomy: Category hierarchy (if generate_taxonomy=true)

This endpoint helps you configure an enrichment pipeline without manual schema definition.

Example usage:

  1. Upload your data file with a description
  2. Use the returned web_enrichment_fields as output_schema in /public/enrich
  3. Use suggested_taxonomy with predict_taxonomy=true in /public/enrich

Supported file formats:

  • CSV (.csv)
  • Excel (.xlsx, .xls)
post/public/infer-schema

Request

  • Base URL
    https://catalogapi.rastro.ai/api
  • Auth
    HTTP bearer

Headers

X-Organization-Idstring nullable

Request body multipart/form-data

filestring binary required

CSV or Excel file to analyze

promptstring required

Description of the data (e.g., 'Product catalog for electronics retailer')

generate_taxonomyboolean

If true, also generate a suggested taxonomy

max_sample_rowsinteger

Maximum rows to sample for analysis (default 20)

Response

Successful Response

file_namestring required

Name of the uploaded file

total_rowsinteger required

Total rows in the file

sample_rows_usedinteger required

Number of rows sampled for inference

suggested_schemaobject required

JSON Schema with all fields found in the data. 'x-field-category' indicates 'input' (existing) or 'enriched' (suggested to add via web).

suggested_taxonomyobject nullable

Taxonomy in TaxonomyInput format. Only present if generate_taxonomy=true.

Changes

No recorded changes to this operation across all 1 revision of this API.