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

# Get batch

> Check the status of an async batch. When all enrichments are complete, the
response includes the full enriched row data and total credits used.

A batch is `"complete"` when every enrichment has reached a terminal state —
this includes both succeeded and failed runs. Check `enrichments.failed > 0`
to detect partial failures.

**Rows in the response:** When `status` is `"complete"`, `rows` includes every
row for this batch in a single array (not paginated). Insert requests are
limited to **100 rows** per batch (see `POST /tables/{tableId}/rows`), so
result payloads stay bounded; if that limit increases in the future, pagination
may be introduced for this field.

**Polling strategy:** For fast results, poll every 2–5 seconds. For background
processing, poll every 30–60 seconds.




## OpenAPI

````yaml /openapi-v1.yaml get /batches/{batchId}
openapi: 3.1.0
info:
  title: Origami API
  version: '1.0'
  description: >
    > **Deprecated.** v1 is superseded by the canonical

    > [v2 API](./openapi-v2) (four segments: Agents, Workspace, Sequences,

    > Account). v1 remains fully functional with **no removal date in this

    > release** — but new integrations should target v2. See the

    > [v1 → v2 migration guide](./api-v1-to-v2-migration): `GET /tables` →

    > `GET /api/v2/tables`, `GET /tables/:id/rows` →

    > `GET /api/v2/tables/:tableId/rows`, `POST /tables/:id/rows` →

    > `POST /api/v2/tables/:tableId/rows/upsert` (upsert; no bare insert),

    > `GET /batches/:id` → `GET /api/v2/batches/:batchId`, `GET /credits` →

    > `GET /api/v2/account/credits`.


    The Origami API lets you enrich company and people data programmatically.

    See the [Quickstart](/quickstart) for a walkthrough with curl examples.


    All write endpoints are **asynchronous** — a `POST` returns a `batchId`
    immediately.

    Poll `GET /batches/{batchId}` for progress and enriched results.


    ## Rate limits


    Limits apply in layers: **per IP** (all requests), **per organization**
    (after a valid API key), and an extra **insert** cap on row writes.


    | Scope | Limit |

    |-------|-------|

    | Per client IP | **300 requests / minute** |

    | Per organization (all endpoints) | **100 requests / minute** |

    | `POST /tables/{tableId}/rows` (per organization) | **10 requests /
    minute** |


    Each layer exposes its own response headers:
    `X-RateLimit-Limit-{IP|Global|Insert}`,

    `X-RateLimit-Remaining-{IP|Global|Insert}`, and
    `X-RateLimit-Reset-{IP|Global|Insert}` (Unix seconds).

    A request may include several of these when multiple layers apply.


    ## Request IDs


    Every response includes an `X-Request-Id` header. You can pass your own ID

    via the `X-Request-Id` request header (1–64 alphanumeric / dash / underscore

    characters); otherwise the server generates a UUID. Include this ID in
    support

    requests to help us trace issues.


    ## Errors


    All errors follow a consistent format:


    ```json

    {
      "error": "Human-readable error message",
      "code": "MACHINE_READABLE_CODE"
    }

    ```


    Some errors include additional context fields like `path`, `fields`, `hint`,
    `current`, `limit`, or `requested`.


    | Code | Status | Meaning |

    |------|--------|---------|

    | `UNAUTHORIZED` | 401 | Missing, invalid, revoked, or expired API key. |

    | `VALIDATION_ERROR` | 400 | Invalid request parameter or body. |

    | `NOT_FOUND` | 404 | Table or batch not found. |

    | `RATE_LIMITED` | 429 | Too many requests — see rate-limit headers. |

    | `INSUFFICIENT_CREDITS` | 402 | Not enough credits to complete the
    operation. |

    | `SUBSCRIPTION_REQUIRED` | 402 | Feature requires a plan upgrade. |

    | `INTERNAL_ERROR` | 500 | Unexpected server error. |


    ## Webhooks


    Receive sequencer events (sends, replies, connection acceptances) via

    HTTPS POST. Configure endpoints in **Settings → Developers → Webhooks**

    or read the [webhooks reference](/webhooks/overview). The full event

    catalog ships as [openapi-webhooks.yaml](/openapi-webhooks.yaml) so

    coding agents can author working receivers from the spec.
  contact:
    name: Origami Support
    url: https://origami.chat
  license:
    name: Proprietary
servers:
  - url: https://origami.chat/api/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Tables
    description: List tables and read row data.
  - name: Rows
    description: Insert rows and trigger enrichment.
  - name: Batches
    description: Poll async batch progress and retrieve results.
  - name: Credits
    description: Check your organization's credit balance.
paths:
  /batches/{batchId}:
    get:
      tags:
        - Batches
      summary: Get batch
      description: >
        Check the status of an async batch. When all enrichments are complete,
        the

        response includes the full enriched row data and total credits used.


        A batch is `"complete"` when every enrichment has reached a terminal
        state —

        this includes both succeeded and failed runs. Check `enrichments.failed
        > 0`

        to detect partial failures.


        **Rows in the response:** When `status` is `"complete"`, `rows` includes
        every

        row for this batch in a single array (not paginated). Insert requests
        are

        limited to **100 rows** per batch (see `POST /tables/{tableId}/rows`),
        so

        result payloads stay bounded; if that limit increases in the future,
        pagination

        may be introduced for this field.


        **Polling strategy:** For fast results, poll every 2–5 seconds. For
        background

        processing, poll every 30–60 seconds.
      operationId: getBatch
      parameters:
        - name: batchId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The batch ID returned by a write operation.
      responses:
        '200':
          description: Batch status retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Batch'
              examples:
                processing:
                  summary: Batch still processing
                  value:
                    batchId: f47ac10b-58cc-4372-a567-0e02b2c3d479
                    tableId: d290f1ee-6c54-4b01-90e6-d701748f0851
                    type: insert
                    status: processing
                    rowCount: 2
                    enrichments:
                      total: 10
                      completed: 4
                      pending: 6
                      failed: 0
                    failures: {}
                    creditsUsed: 0
                    createdAt: '2026-07-01T14:30:00Z'
                    completedAt: null
                complete:
                  summary: Batch complete with enriched data
                  value:
                    batchId: f47ac10b-58cc-4372-a567-0e02b2c3d479
                    tableId: d290f1ee-6c54-4b01-90e6-d701748f0851
                    type: insert
                    status: complete
                    rowCount: 2
                    enrichments:
                      total: 10
                      completed: 10
                      pending: 0
                      failed: 0
                    failures: {}
                    columns:
                      company-name: Company Name
                      website: Website
                      ceo-email: CEO Email
                      employee-count: Employee Count
                    rows:
                      - id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                        company-name: Acme Corp
                        website: acme.com
                        ceo-email: ceo@acme.com
                        employee-count: 150
                      - id: b2c3d4e5-f6a7-8901-bcde-f12345678901
                        company-name: Beta Inc
                        website: beta.io
                        ceo-email: founder@beta.io
                        employee-count: 42
                    creditsUsed: 12
                    createdAt: '2026-07-01T14:30:00Z'
                    completedAt: '2026-07-01T14:31:15Z'
                partialFailure:
                  summary: Batch complete with some failures
                  value:
                    batchId: f47ac10b-58cc-4372-a567-0e02b2c3d479
                    tableId: d290f1ee-6c54-4b01-90e6-d701748f0851
                    type: insert
                    status: complete
                    rowCount: 5
                    enrichments:
                      total: 10
                      completed: 6
                      pending: 0
                      failed: 4
                    failures:
                      insufficientCredits: 3
                      enrichmentError: 1
                    columns:
                      company-name: Company Name
                      website: Website
                      ceo-email: CEO Email
                    rows:
                      - id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                        company-name: Acme Corp
                        website: acme.com
                        ceo-email: ceo@acme.com
                    creditsUsed: 36
                    createdAt: '2026-07-01T14:30:00Z'
                    completedAt: '2026-07-01T14:32:00Z'
        '400':
          description: Invalid path parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid batchId
                code: VALIDATION_ERROR
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Batch not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Batch not found
                code: NOT_FOUND
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Batch:
      type: object
      required:
        - batchId
        - tableId
        - type
        - status
        - rowCount
        - enrichments
        - failures
        - creditsUsed
        - createdAt
        - completedAt
      properties:
        batchId:
          type: string
          format: uuid
        tableId:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - insert
          description: The operation type that created this batch.
        status:
          type: string
          enum:
            - processing
            - complete
            - errored
          description: >
            - `processing` — enrichment is still running

            - `complete` — all enrichments finished (check `enrichments.failed`
            for partial failures)

            - `errored` — the batch failed to start (e.g. enrichment pipeline
            error)
        rowCount:
          type: integer
          description: |
            Number of rows created by this batch. Each row can have multiple
            enrichment cells (one per enrichment column), so `enrichments.total`
            will typically be higher than `rowCount`.
        enrichments:
          $ref: '#/components/schemas/BatchEnrichments'
        columns:
          type: object
          additionalProperties:
            type: string
          description: >
            Map of column slug → display name. Only present when `status` is
            `"complete"`.

            Use this to resolve slug keys in `rows` to human-readable column
            names.
        rows:
          type: array
          items:
            $ref: '#/components/schemas/Row'
          description: >
            Enriched row data. Only present when `status` is `"complete"`.

            Row keys are column slugs — use the `columns` map to resolve display
            names.

            All rows for the batch are returned in one response (see operation
            description

            for the relationship to per-request insert limits).
        failures:
          $ref: '#/components/schemas/BatchFailures'
        creditsUsed:
          type: integer
          description: >-
            Total credits consumed by this batch (rounded to nearest whole
            credit). `0` while processing or when no credits were used.
        createdAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the batch finished. `null` while still processing.
    Error:
      type: object
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Machine-readable error code.
      additionalProperties: true
    BatchEnrichments:
      type: object
      required:
        - total
        - completed
        - pending
        - failed
      properties:
        total:
          type: integer
          description: >-
            Total enrichment cells in the batch (one per enrichment column per
            row).
        completed:
          type: integer
          description: Enrichment cells that finished successfully.
        pending:
          type: integer
          description: Enrichment cells still waiting or in progress.
        failed:
          type: integer
          description: Enrichment cells that errored. Check `failures` for breakdown.
    Row:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: Row UUID.
      additionalProperties: true
      description: |
        Flat object with column **slugs** as keys. Values are strings, numbers,
        or arrays depending on column type. Cells with no value are omitted.
        Use the `columns` map in the response to resolve slugs to display names.
    BatchFailures:
      type: object
      description: >
        Breakdown of failed enrichment cells by cause. Empty object `{}` when
        there are no failures.
      properties:
        insufficientCredits:
          type: integer
          description: >-
            Cells that failed because the org ran out of credits. Top up and
            re-run.
        enrichmentError:
          type: integer
          description: >-
            Cells that failed due to an enrichment service error (bad input,
            upstream API down, etc.).
  responses:
    Unauthorized:
      description: Missing, invalid, revoked, or expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid API key
            code: UNAUTHORIZED
    RateLimited:
      description: Rate limit exceeded.
      headers:
        X-RateLimit-Limit-IP:
          schema:
            type: integer
          description: IP bucket — maximum requests allowed in the window.
        X-RateLimit-Remaining-IP:
          schema:
            type: integer
          description: IP bucket — requests remaining in the current window.
        X-RateLimit-Reset-IP:
          schema:
            type: integer
          description: IP bucket — Unix timestamp when the window resets.
        X-RateLimit-Limit-Global:
          schema:
            type: integer
          description: Organization bucket — maximum requests allowed in the window.
        X-RateLimit-Remaining-Global:
          schema:
            type: integer
          description: Organization bucket — requests remaining in the current window.
        X-RateLimit-Reset-Global:
          schema:
            type: integer
          description: Organization bucket — Unix timestamp when the window resets.
        X-RateLimit-Limit-Insert:
          schema:
            type: integer
          description: >-
            Insert bucket — maximum requests allowed in the window (write routes
            only).
        X-RateLimit-Remaining-Insert:
          schema:
            type: integer
          description: Insert bucket — requests remaining in the current window.
        X-RateLimit-Reset-Insert:
          schema:
            type: integer
          description: Insert bucket — Unix timestamp when the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Rate limit exceeded
            code: RATE_LIMITED
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal server error
            code: INTERNAL_ERROR
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: og_live_*
      description: |
        API key with `og_live_` prefix. Create keys in **Settings → API Keys**.

        Pass in the `Authorization` header:
        ```
        Authorization: Bearer og_live_abc123...
        ```

````