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

# Get ingestion batch status

> Poll a batch you submitted to /v1/ingest.

Normalization runs in the background, so a batch moves `queued` → `processing` → `done` (or `error`). Poll this endpoint with the `batchId` returned by [Ingest records](/api-reference/ingest-records).

The counts tell you what actually landed: `accepted` and `deduplicated` are known immediately, while `recordsCreated` and `eventsCreated` populate once the batch reaches `done`. Anything Seyn couldn't accept appears in `rejected` with a reason.


## OpenAPI

````yaml openapi.yaml GET /v1/ingest/{batchId}
openapi: 3.1.0
info:
  title: Seyn API
  version: 1.0.0
  description: >
    Programmatic access to Seyn for your organization.


    - **Ingest** data from any source with the Ingestion endpoints (requires a
    key with the `ingest` scope).

    - **Read** extracted process knowledge: search, rules, libraries,
    provenance, and metrics.


    Authenticate with a bearer API key (`sk_live_*`); each key is scoped to a
    single organization.
  contact:
    name: Seyn Support
    email: support@seynlabs.com
    url: https://seynlabs.com
servers:
  - url: https://api.seynlabs.com
    description: Production
  - url: https://api-dev.seynlabs.com
    description: Staging
security:
  - bearerAuth: []
tags:
  - name: Ingestion
    description: >-
      Push data into Seyn from any source: register a custom source and stream
      records to it
  - name: Knowledge
    description: Natural-language search over extracted knowledge
  - name: Rules
    description: Process rules, the atomic knowledge units extracted by the pipeline
  - name: Libraries
    description: Versioned snapshots of extracted knowledge for your organization
  - name: Patterns
    description: Aggregate pipeline analytics
paths:
  /v1/ingest/{batchId}:
    get:
      tags:
        - Ingestion
      summary: Get ingestion batch status
      description: >
        Poll the status of an ingestion batch. Normalization runs
        asynchronously, so a

        batch moves `queued` → `processing` → `done` (or `error`). Counts
        reflect what

        landed: `recordsCreated` after dedup, `eventsCreated` after
        normalization.
      operationId: ingestBatchGet
      parameters:
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Batch status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessEnvelope_IngestBatch'
              example:
                success: true
                data:
                  batchId: 9b2e4d1a-7c3f-4e8a-9b1c-2d3e4f5a6b7c
                  sourceId: b6f1c0de-1f2a-4c3b-9d4e-5a6b7c8d9e0f
                  status: done
                  accepted: 2
                  deduplicated: 0
                  rejected: []
                  recordsCreated: 2
                  eventsCreated: 5
                  createdAt: '2026-06-12T16:24:11Z'
                meta:
                  requestId: 5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    SuccessEnvelope_IngestBatch:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/IngestBatch'
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - success
        - data
        - meta
    IngestBatch:
      type: object
      properties:
        batchId:
          type: string
          format: uuid
        sourceId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - queued
            - processing
            - done
            - error
          description: Normalization runs asynchronously after records are accepted.
        accepted:
          type: integer
          minimum: 0
          description: Records accepted into the batch.
        deduplicated:
          type: integer
          minimum: 0
          description: Records skipped as unchanged duplicates (by content hash).
        rejected:
          type: array
          items:
            $ref: '#/components/schemas/RejectedRecord'
        recordsCreated:
          type: integer
          minimum: 0
          description: Raw records persisted. Populated once status is `done`.
        eventsCreated:
          type: integer
          minimum: 0
          description: Normalized events produced. Populated once status is `done`.
        createdAt:
          type: string
          format: date-time
      required:
        - batchId
        - sourceId
        - status
        - accepted
        - deduplicated
        - rejected
        - createdAt
    Meta:
      type: object
      properties:
        requestId:
          type: string
          description: Per-request UUID; quote in support tickets.
      additionalProperties: true
      required:
        - requestId
    ErrorBody:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - MISSING_AUTH_HEADER
                - INVALID_API_KEY
                - KEY_REVOKED
                - RATE_LIMITED
                - NOT_FOUND
                - LIBRARY_NOT_FOUND
                - SOURCE_NOT_FOUND
                - VALIDATION_ERROR
                - INSUFFICIENT_SCOPE
                - PAYLOAD_TOO_LARGE
                - INTERNAL_ERROR
            message:
              type: string
          required:
            - code
            - message
      required:
        - success
        - error
    RejectedRecord:
      type: object
      properties:
        recordId:
          type: string
        reason:
          type: string
          description: >-
            Why this record was rejected (for example missing `entityType`, or
            an oversized payload).
      required:
        - recordId
        - reason
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            missing:
              summary: No Authorization header
              value:
                success: false
                error:
                  code: MISSING_AUTH_HEADER
                  message: 'Authorization: Bearer <api-key> header is required'
            invalid:
              summary: Unrecognized key
              value:
                success: false
                error:
                  code: INVALID_API_KEY
                  message: API key is invalid or unrecognized
    Forbidden:
      description: API key was revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            revoked:
              value:
                success: false
                error:
                  code: KEY_REVOKED
                  message: API key has been revoked
    NotFound:
      description: Resource not found in this organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            notFound:
              value:
                success: false
                error:
                  code: NOT_FOUND
                  message: Process rule not found
    RateLimited:
      description: Per-key rate limit exceeded (default 60 req/min/key).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            rateLimited:
              value:
                success: false
                error:
                  code: RATE_LIMITED
                  message: Rate limit exceeded for this API key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk_live_*
      description: |
        Bearer token from `app.seynlabs.com` → Settings → API Keys.
        Send as `Authorization: Bearer sk_live_...`.

````