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

# Seal a record set

> Finalises a record set once every chunk has been sent. The `expected_count` you supply is compared with the number of records actually staged, and the seal is refused if they disagree — which is how a chunk lost in transit is caught before anything is dialled. Re-sealing with the same `expected_count` returns the same result.



## OpenAPI

````yaml /openapi.json post /record-sets/{record_set_id}/seal
openapi: 3.1.0
info:
  title: GetDialed Flows API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/flows
    description: Production
security: []
paths:
  /record-sets/{record_set_id}/seal:
    post:
      tags:
        - record-sets
      summary: Seal a record set
      description: >-
        Finalises a record set once every chunk has been sent. The
        `expected_count` you supply is compared with the number of records
        actually staged, and the seal is refused if they disagree — which is how
        a chunk lost in transit is caught before anything is dialled. Re-sealing
        with the same `expected_count` returns the same result.
      operationId: seal_record_set_record_sets__record_set_id__seal_post
      parameters:
        - name: record_set_id
          in: path
          required: true
          schema:
            type: string
            title: Record Set Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordSetSealRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordSetResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              example:
                detail: Authentication required
        '403':
          description: Admin role required
          content:
            application/json:
              example:
                detail: Admin role required
        '404':
          description: Not found — also returned on cross-tenant access (never 403)
          content:
            application/json:
              example:
                detail: Record set not found
        '409':
          description: Conflict — the record set's state does not allow this request
          content:
            application/json:
              example:
                detail: Staged record count does not match expected_count
        '422':
          description: Validation error (see body for field details)
          content:
            application/json:
              example:
                detail: Validation error
        '429':
          description: Rate limit exceeded — retry after the Retry-After header
          content:
            application/json:
              example:
                detail: Rate limit exceeded
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    RecordSetSealRequest:
      properties:
        expected_count:
          type: integer
          minimum: 0
          title: Expected Count
          description: Total number of records sent across every chunk.
      type: object
      required:
        - expected_count
      title: RecordSetSealRequest
      description: >-
        Finalise a record set once every chunk has been sent.


        `expected_count` is the total number of records you sent across all
        chunks.

        The API compares it with the number it actually staged and refuses the
        seal

        if they disagree, which is how a chunk that was silently lost in transit
        is

        caught before anything is dialled. You do not need to know the total in

        advance — only at seal time — so several files can be streamed into one

        record set.


        Sealing is safe to retry: re-sealing an already-sealed record set with
        the

        same `expected_count` returns the same result.
      example:
        expected_count: 1000000
    RecordSetResponse:
      properties:
        id:
          type: string
          title: Id
        status:
          type: string
          title: Status
        chunk_size:
          type: integer
          title: Chunk Size
        received_count:
          type: integer
          title: Received Count
        chunk_count:
          type: integer
          title: Chunk Count
        expected_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expected Count
        content_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Hash
        batch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Batch Id
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        sealed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sealed At
        consumed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Consumed At
        staging_expires_at:
          type: string
          format: date-time
          title: Staging Expires At
      type: object
      required:
        - id
        - status
        - chunk_size
        - received_count
        - chunk_count
        - expected_count
        - content_hash
        - batch_id
        - metadata
        - created_at
        - updated_at
        - sealed_at
        - consumed_at
        - staging_expires_at
      title: RecordSetResponse
      description: >-
        A record set's manifest and current progress.


        `status` moves `open` -> `sealed` -> `consumed`: `open` accepts chunks,

        `sealed` is complete and ready to trigger, and `consumed` means a
        trigger

        has claimed it (each record set is used exactly once). `received_count`
        and

        `chunk_count` track what has arrived so far, `content_hash` identifies
        the

        sealed contents, `batch_id` points at the batch that consumed it, and

        `staging_expires_at` is when an untriggered record set and its staged

        records are reclaimed.
      example:
        chunk_count: 100
        chunk_size: 10000
        content_hash: 9f2c4e1b7a35d80c6e4f1a92b3c7d5e08f6a1b2c3d4e5f60718293a4b5c6d7e8
        created_at: '2026-07-27T12:00:00Z'
        expected_count: 1000000
        id: rs_0123456789abcdef
        metadata:
          campaign: spring-2026
        received_count: 1000000
        sealed_at: '2026-07-27T12:04:31Z'
        staging_expires_at: '2026-08-03T12:00:00Z'
        status: sealed
        updated_at: '2026-07-27T12:04:31Z'
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````