Enrich

Enrich Data

Enrich items using web research, with optional taxonomy prediction.

Accepts both application/json (plain JSON body) and multipart/form-data (with request_json field, optional items_file, and optional knowledge_base_files).

Two modes of operation:

  1. Direct mode: Pass items and output_schema directly
  2. Full-run mode: Pass source_activity_id from a previous run to process all stored items

Example: Direct enrichment

{
  "prompt": "Find product specifications",
  "items": [{"name": "iPhone 15 Pro"}],
  "output_schema": [
    {"name": "price", "type": "string", "description": "Current retail price"},
    {"name": "weight", "type": "string", "description": "Product weight"}
  ]
}

Example: Dry run (process first 10 items)

{
  "prompt": "Find product specifications",
  "items": [... all 1000 items ...],
  "output_schema": [...],
  "max_rows": 10
}

Example: Full run from previous activity

{
  "prompt": "Find product specifications",
  "source_activity_id": "abc123-previous-activity-id"
}

Large jobs: send multipart/form-data with a small request_json and one items_file JSON upload. items_file must be a JSON array, or an object with an items array. Do not send items_storage_url; it is internal.

All items are stored in the activity, so full runs can be triggered later using source_activity_id.

post/public/enrich

Request

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

Headers

X-Organization-Idstring nullable

Request body

promptstring nullable

Search prompt for web enrichment (e.g., 'Find product specifications'). Optional - defaults to empty string.

itemsobject[]

List of items to enrich. Required unless source_activity_id or source_catalog_id is provided.

attribute_setsobject nullable

Canonical registry for requested-attribute jobs. Items carry attribute_set_id; workers expand that id to requested_attributes only at runtime. Per-row requested_attributes payloads are rejected by the public endpoint.

source_hint_setsobject nullable

Canonical registry for repeated per-item source hints. Items carry source_hint_set_id; workers expand that id to source_hints only at runtime. Inline source_hints are rejected by the public endpoint.

allowed_domainsstring[] nullable

Restrict web scraping to these domains only

blocked_domainsstring[] nullable

Domains to exclude from web search and URL fetches

speedstring

Processing speed: 'fast' (quick), 'medium' (balanced), 'deep'/'slow' (thorough default), 'ultra_slow' (maximum reasoning / strongest model path)

web_searchboolean

If true (default), performs web search to gather content. If false, skips web search and uses input data directly for extraction/validation.

max_rowsinteger nullable

Limit processing to first N items. All items are stored. Use source_activity_id to process remaining items later.

taxonomyobject nullable

Taxonomy definition for category prediction (TaxonomyInput format)

predict_taxonomyboolean

If true and taxonomy is provided, predict category_id for each item

predict_taxonomy_attributesboolean

If true, also predict taxonomy_attributes after classification. Set false for taxonomy classification only.

validate_semanticsboolean

If true, AI validates that field values make sense given their descriptions (e.g., email field contains valid email format)

review_modeboolean

Run the enrich review agent after enrichment, apply clear output corrections, and attach activity.output.audit decisions. Public enrichment jobs keep this enabled.

audit_decisions_enabledboolean

When false, the post-enrichment audit still applies clear output corrections but suppresses human-facing audit decisions/suggestions.

include_source_explanationsboolean

Include source_explanation for each enriched field (and taxonomy attribute) explaining how the value was derived from sources. Always enabled.

catalog_idstring nullable

Optional catalog ID to link this enrichment job to

template_idstring nullable

Optional organization-scoped enrichment template key. Template extraction fields apply to omitted request fields; template-owned safety controls remain enforced.

async_modeboolean

If true, returns immediately with job_id instead of waiting for results

staged_statusstring

Status for staged changes: 'pending' (default, visible to admin) or 'draft' (vendor draft, not visible to admin until submitted)

source_activity_idstring nullable

Activity ID of a previous run. Processes all stored items using saved config.

source_catalog_idstring nullable

Catalog UUID to read items FROM as the enrichment input. Independent of catalog_id (the write target).

file_namestring nullable

Original file name if items were loaded from a file

include_service_usageboolean

If true, include detailed service_usage metrics (costs, tokens, per-item stats) in response

include_debug_logboolean

If true, capture full audit log per item (raw markdown, tool history, LLM responses) and upload to storage

capture_source_artifactsboolean

If true, preserve durable copies of consulted source material for audit trails. Web pages are captured as screenshots; PDFs are copied as PDF files.

reextract_from_activity_idstring nullable

Activity ID to re-extract from. Skips web gather, reuses stored web research data. Supports prompt/schema overrides and feedback.

global_feedbackstring nullable

Feedback to apply to all items during re-extraction (appended to prompt)

item_feedbackobject nullable

Per-item feedback keyed by row index as string (e.g. {'0': 'Wrong product', '3': 'Price is in EUR not USD'})

source_row_indicesinteger[] nullable

Row indices to re-extract (others carried forward from source). Only used with reextract_from_activity_id.

webhook_urlstring nullable

HTTPS URL to POST results to when job completes. Must use https://.

knowledge_base_enabledboolean

If true, use an uploaded knowledge base (OpenAI vector store) for structured generation.

knowledge_base_vector_store_idstring nullable

OpenAI vector store ID containing uploaded knowledge base files.

knowledge_base_sourcesobject nullable

Optional SOURCE_X -> source URL mapping used for field-level citations (for example {'SOURCE_1': 'https://.../specs.pdf'}).

knowledge_base_metadataobject nullable

Optional SOURCE_X -> metadata mapping for uploaded knowledge-base files (for example {'SOURCE_1': {'doc_type': 'approved_marketing'}}).

host_mediaboolean

If true, upload all media URLs (images, PDFs) found in enrichment results to hosted storage, replacing with hosted URLs.

strict_hosted_mediaboolean

If true, media/document output fields are cleared unless the URL is successfully copied to hosted storage.

Response

Successful Response

job_idstring nullable

Job ID for tracking (always returned). Use this with source_activity_id to trigger full run.

total_itemsinteger required

Number of items being processed (may be limited by max_rows)

total_rowsinteger nullable

Total items passed in the request (before max_rows limit)

successfulinteger

Number of successfully enriched items

credits_usedinteger

Number of credits used (1 per successful item)

statusstring

Job status: 'running' (async) or 'completed' (sync)

service_usageobject nullable

Detailed API usage metrics (costs, calls, tokens) - only present when job is complete

pricing_estimatesobject nullable

Estimated pricing breakdown (for example knowledge-base storage + model runtime costs when available)

knowledge_base_enabledboolean nullable

Whether this enrichment job used a knowledge base vector store

knowledge_base_sourcesobject nullable

SOURCE_X -> hosted document URL mapping for knowledge-base files used by the activity

pageinteger nullable

Current page number (1-indexed)

page_sizeinteger nullable

Number of results per page

total_pagesinteger nullable

Total number of pages available

completed_itemsinteger nullable

Number of items with results available so far (useful while status=running)

Changes

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