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

# Ingest records

> Push a batch of records from any system into Seyn.

This is the core of bringing your own data. Send records from any system, shaped as `{ recordId, entityType, payload, sourceUpdatedAt }`, and Seyn stores each payload verbatim, deduplicates by content hash, and normalizes it into [events](/platform/events) asynchronously.

A few rules worth knowing:

* **Idempotent.** Re-sending an unchanged record is a no-op. Reuse a record's `recordId` when it changes and Seyn supersedes the prior version instead of duplicating it.
* **Batched.** Up to 500 records and 10 MB per request. Split larger loads into multiple calls.
* **Asynchronous.** The call returns `202` with a `batchId` the moment your records are accepted. Normalization happens in the background; poll [Get ingestion batch status](/api-reference/get-ingest-batch) to see what landed.
* **Scoped.** Requires an API key with the `ingest` scope. Read-only keys get `INSUFFICIENT_SCOPE`.

Create the `sourceId` first with [Create a custom source](/api-reference/create-source). See [Connectors → Build your own](/platform/connectors#build-your-own) for the full model.


## OpenAPI

````yaml openapi.yaml POST /v1/ingest
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:
    post:
      tags:
        - Ingestion
      summary: Ingest records
      description: >
        Push a batch of records to a source. Each record is stored verbatim and

        deduplicated by content hash (re-sending an unchanged record is a
        no-op), then

        normalized into events asynchronously. Reuse a record's `recordId` on
        update and

        Seyn supersedes the prior version instead of duplicating it.


        Returns a `batchId` you can poll with `GET /v1/ingest/{batchId}`. Up to
        500

        records and 10 MB per request. Requires an API key with the `ingest`
        scope.
      operationId: ingestRecords
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Optional. Reuse the same key when retrying a batch after a network
            error so it's processed only once. (Records are also deduplicated by
            content hash regardless.)
          example: 9b2e4d1a-7c3f-4e8a-9b1c-2d3e4f5a6b7c
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestRequest'
            examples:
              deals:
                summary: Two CRM deals
                value:
                  sourceId: b6f1c0de-1f2a-4c3b-9d4e-5a6b7c8d9e0f
                  records:
                    - recordId: deal-4471
                      entityType: deal
                      sourceUpdatedAt: '2026-06-10T14:03:00Z'
                      payload:
                        name: Acme Corp renewal
                        stage: negotiation
                        amount: 42000
                        owner: jane.smith@acme.com
                        movedToStageBy: jane.smith@acme.com
                    - recordId: deal-4472
                      entityType: deal
                      sourceUpdatedAt: '2026-06-10T15:21:00Z'
                      payload:
                        name: Northwind expansion
                        stage: closed_won
                        amount: 12500
                        owner: mark.lee@acme.com
              tickets:
                summary: A support ticket
                value:
                  sourceId: b6f1c0de-1f2a-4c3b-9d4e-5a6b7c8d9e0f
                  records:
                    - recordId: ticket-91022
                      entityType: ticket
                      sourceUpdatedAt: '2026-06-11T09:12:00Z'
                      payload:
                        subject: Login fails after password reset
                        priority: high
                        status: escalated
                        assignee: sara.kim@acme.com
                        escalatedTo: tier-2
      responses:
        '202':
          description: Batch accepted for processing.
          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: queued
                  accepted: 2
                  deduplicated: 0
                  rejected: []
                  createdAt: '2026-06-12T16:24:11Z'
                meta:
                  requestId: 3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '404':
          $ref: '#/components/responses/SourceNotFound'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    IngestRequest:
      type: object
      properties:
        sourceId:
          type: string
          format: uuid
          description: >-
            The source to ingest into. Create a custom one with `POST
            /v1/sources`.
        records:
          type: array
          minItems: 1
          maxItems: 500
          description: Up to 500 records per request.
          items:
            $ref: '#/components/schemas/RawRecordInput'
      required:
        - sourceId
        - records
    SuccessEnvelope_IngestBatch:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/IngestBatch'
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - success
        - data
        - meta
    RawRecordInput:
      type: object
      description: >-
        One record exactly as it exists in your source system. The payload is
        stored verbatim as the bottom of the provenance chain.
      properties:
        recordId:
          type: string
          description: >-
            Stable identifier for this record in your system. Reuse it on update
            so Seyn supersedes rather than duplicates.
        entityType:
          type: string
          description: >-
            The kind of thing this record is (for example `deal`, `ticket`,
            `task`). Routes normalization.
          example: deal
        payload:
          type: object
          additionalProperties: true
          description: >-
            The raw record, as arbitrary JSON. Stored verbatim and never written
            back to your system.
        sourceUpdatedAt:
          type: string
          format: date-time
          description: >-
            When the record last changed in your system. Defaults to ingestion
            time if omitted.
      required:
        - recordId
        - entityType
        - payload
    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:
    ValidationError:
      description: Request parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            validationError:
              value:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: Query parameter 'q' is required
    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
    InsufficientScope:
      description: The API key is read-only; write operations need the `ingest` scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            insufficientScope:
              value:
                success: false
                error:
                  code: INSUFFICIENT_SCOPE
                  message: This API key is read-only; an ingest-scoped key is required
    SourceNotFound:
      description: Source not found in this organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            sourceNotFound:
              value:
                success: false
                error:
                  code: SOURCE_NOT_FOUND
                  message: Source not found
    PayloadTooLarge:
      description: Ingestion batch exceeded the size limit (500 records or 10 MB).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            payloadTooLarge:
              value:
                success: false
                error:
                  code: PAYLOAD_TOO_LARGE
                  message: Ingestion batch exceeds 500 records or 10 MB
    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_...`.

````