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

# Get Enrichment Job

> Poll enrichment job status and get results.

Returns results **progressively** — partial results are available while the job
is still running, as each batch of items completes processing.

**Flow:**
1. Submit enrichment with `async_mode=true` → get `job_id`
2. Poll this endpoint — results appear incrementally as items are processed
3. When `status` changes to `completed`, all results are ready

**Pagination:**
- `page`: Page number (1-indexed, default: 1)
- `page_size`: Results per page (default: 1000)
- Response includes `page`, `page_size`, `total_pages`, `completed_items`

**Statuses:**
- `running`: Job is still processing (partial results may be available)
- `completed`: Job finished, all results ready
- `failed`: Job failed or was cancelled (partial results may still be available)

**Example:**
```
GET /api/public/enrich/{job_id}?page=1&page_size=50

Response (running, partial results):
{
    "job_id": "08aa2b0d-...",
    "status": "running",
    "results": [
        {"after_data": {...}, "before_data": {...}, "sources": {...}}
    ],
    "total_items": 500,
    "completed_items": 200,
    "successful": 0,
    "credits_used": 0,
    "page": 1,
    "page_size": 50,
    "total_pages": 4
}
```



## OpenAPI

````yaml /api-reference/openapi.json get /public/enrich/{job_id}
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/enrich/{job_id}:
    get:
      tags:
        - Enrich
      summary: Get Enrichment Job
      description: >-
        Poll enrichment job status and get results.


        Returns results **progressively** — partial results are available while
        the job

        is still running, as each batch of items completes processing.


        **Flow:**

        1. Submit enrichment with `async_mode=true` → get `job_id`

        2. Poll this endpoint — results appear incrementally as items are
        processed

        3. When `status` changes to `completed`, all results are ready


        **Pagination:**

        - `page`: Page number (1-indexed, default: 1)

        - `page_size`: Results per page (default: 1000)

        - Response includes `page`, `page_size`, `total_pages`,
        `completed_items`


        **Statuses:**

        - `running`: Job is still processing (partial results may be available)

        - `completed`: Job finished, all results ready

        - `failed`: Job failed or was cancelled (partial results may still be
        available)


        **Example:**

        ```

        GET /api/public/enrich/{job_id}?page=1&page_size=50


        Response (running, partial results):

        {
            "job_id": "08aa2b0d-...",
            "status": "running",
            "results": [
                {"after_data": {...}, "before_data": {...}, "sources": {...}}
            ],
            "total_items": 500,
            "completed_items": 200,
            "successful": 0,
            "credits_used": 0,
            "page": 1,
            "page_size": 50,
            "total_pages": 4
        }

        ```
      operationId: get_enrichment_job_api_public_enrich__job_id__get
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
        - name: page
          in: query
          required: false
          schema:
            type: integer
            title: Page
            default: 1
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            default: 1000
            title: Page Size
        - name: X-Organization-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Organization-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrichResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    EnrichResponse:
      properties:
        job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Id
          description: >-
            Job ID for tracking (always returned). Use this with
            source_activity_id to trigger full run.
        results:
          items:
            $ref: '#/components/schemas/EnrichItemResult'
          type: array
          title: Results
          description: Enrichment results for each item (empty if async_mode=true)
        total_items:
          type: integer
          title: Total Items
          description: Number of items being processed (may be limited by max_rows)
        total_rows:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Rows
          description: Total items passed in the request (before max_rows limit)
        successful:
          type: integer
          title: Successful
          description: Number of successfully enriched items
          default: 0
        credits_used:
          type: integer
          title: Credits Used
          description: Number of credits used (1 per successful item)
          default: 0
        status:
          type: string
          title: Status
          description: 'Job status: ''running'' (async) or ''completed'' (sync)'
          default: completed
        service_usage:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Service Usage
          description: >-
            Detailed API usage metrics (costs, calls, tokens) - only present
            when job is complete
        pricing_estimates:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Pricing Estimates
          description: >-
            Estimated pricing breakdown (for example knowledge-base storage +
            model runtime costs when available)
        knowledge_base_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Knowledge Base Enabled
          description: Whether this enrichment job used a knowledge base vector store
        knowledge_base_sources:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Knowledge Base Sources
          description: >-
            SOURCE_X -> hosted document URL mapping for knowledge-base files
            used by the activity
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
          description: Current page number (1-indexed)
        page_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page Size
          description: Number of results per page
        total_pages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Pages
          description: Total number of pages available
        completed_items:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completed Items
          description: >-
            Number of items with results available so far (useful while
            status=running)
      type: object
      required:
        - total_items
      title: EnrichResponse
      description: Response with enriched data for all items.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EnrichItemResult:
      properties:
        original_data:
          additionalProperties: true
          type: object
          title: Original Data
          description: The original input data
        after_data:
          additionalProperties: true
          type: object
          title: After Data
          description: >-
            Complete enriched record with values, sources, and
            source_explanations
        all_sources:
          items:
            type: string
          type: array
          title: All Sources
          description: All web sources used across all fields
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message if enrichment failed for this item
        category_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Category Id
          description: Predicted taxonomy node ID
        taxonomy_attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Taxonomy Attributes
          description: Predicted taxonomy-specific attributes
        taxonomy_attribute_sources:
          anyOf:
            - additionalProperties:
                items:
                  type: string
                type: array
              type: object
            - type: 'null'
          title: Taxonomy Attribute Sources
          description: >-
            Per-attribute source URLs or input references used to derive
            taxonomy attribute values
        taxonomy_attribute_explanations:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Taxonomy Attribute Explanations
          description: Per-attribute explanations of how values were derived from sources
        review_info:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Review Info
          description: AI reasoning, flags for human review
        low_confidence_candidates:
          anyOf:
            - items:
                $ref: '#/components/schemas/LowConfidenceCandidate'
              type: array
            - type: 'null'
          title: Low Confidence Candidates
          description: >-
            Optional tail section of plausible but non-canonical field or
            taxonomy candidates
        low_confidence_fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Low Confidence Fields
          description: >-
            Field or taxonomy attribute names that should be highlighted as
            low-confidence while remaining in after_data
        staged_change_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Staged Change Id
          description: ID of the staged change record (if stage_changes=true)
      type: object
      required:
        - original_data
      title: EnrichItemResult
      description: Result for a single enriched item.
    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
    LowConfidenceCandidate:
      properties:
        scope:
          type: string
          title: Scope
          description: 'Candidate scope: field, taxonomy_attribute, or category'
          default: field
        name:
          type: string
          title: Name
          description: Canonical field or taxonomy attribute name
        candidate_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Candidate Value
          description: Candidate value serialized as exact text or compact JSON
        confidence:
          type: string
          title: Confidence
          description: Confidence level for this candidate
          default: LOW
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: >-
            Why this candidate is plausible but not strong enough for canonical
            output
        sources:
          items:
            type: string
          type: array
          title: Sources
          description: Resolved source URLs or input:* references supporting the candidate
        source_explanation:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Explanation
          description: Optional short explanation of where the candidate came from
      type: object
      required:
        - name
      title: LowConfidenceCandidate
      description: >-
        A plausible but non-canonical candidate that should not be merged into
        final output.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Rastro API key or user token

````