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

# Get data stream ingestion health

> Cheap, indexed snapshot of ingestion health for the stream — record count, import batch totals, orphan records, bulk request counters by status, and last ingestion time. Safe to poll from the UI.



## OpenAPI

````yaml /openapi.json get /data_streams/{key}/health
openapi: 3.1.0
info:
  title: End Close API
  description: REST API is used to interact with the End Close platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.endclose.com/v1
security:
  - ApiKeyAuth: []
paths:
  /data_streams/{key}/health:
    get:
      summary: Get data stream ingestion health
      description: >-
        Cheap, indexed snapshot of ingestion health for the stream — record
        count, import batch totals, orphan records, bulk request counters by
        status, and last ingestion time. Safe to poll from the UI.
      parameters:
        - in: path
          name: key
          required: true
          schema:
            type: string
          description: The immutable data stream key
      responses:
        '200':
          description: Health snapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataStreamHealth'
        '401':
          description: Unauthorized
        '404':
          description: Data stream not found
components:
  schemas:
    DataStreamHealth:
      type: object
      description: >-
        Ingestion health snapshot for a data stream. All counts are indexed
        lookups; safe to poll.
      properties:
        records_count:
          type: integer
        import_batches_count:
          type: integer
        import_batches_record_sum:
          type: integer
          description: >-
            Sum of `record_count` across all import batches. Drift from
            `records_count` indicates orphaned or extra records.
        orphan_records_count:
          type: integer
          description: >-
            Records on this stream with no `import_batch_id` (typically created
            via POST /records or POST /records/bulk)
        bulk_requests:
          type: object
          properties:
            pending:
              type: integer
            processing:
              type: integer
            completed:
              type: integer
            failed:
              type: integer
            cancelled:
              type: integer
            stuck:
              type: integer
              description: Currently `processing` with no heartbeat for >5 minutes
        last_ingestion_at:
          type: string
          format: date-time
          nullable: true
          description: Most recent record `created_at` on this stream
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````