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

# Verify the chain

> Checks the SHA-256 chain of the receipts of one day.



## OpenAPI

````yaml openapi/en/cell.json GET /v1/receipts/verify
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-1
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/receipts/verify:
    get:
      tags:
        - governance
      summary: Verify the chain
      description: >-
        Recomputes the SHA-256 chain of one day of receipts and compares its
        root with the root anchored in immutable storage. `valid` is true when
        no link is broken; `breaks` lists the slice and sequence of each break.
        Run it during an audit to prove that no receipt was changed or removed.


        **Authentication.** Console person token with the `security` role (or
        admin), or a source key with the `admin` scope.
      operationId: verify_receipts_v1_receipts_verify_get
      parameters:
        - in: query
          name: day
          required: true
          schema:
            format: date
            title: Day
            type: string
          description: The day to verify, in UTC.
          example: '2026-09-22'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChainVerification'
              example:
                day: '2026-09-22'
                receipts: 184233
                valid: true
                heads:
                  - slice: 0
                    seq: 45120
                    hash: sha256:1a2b3c4d5e
                  - slice: 3
                    seq: 88214
                    hash: sha256:7e21c8a4b9
                breaks: []
                anchored_root: sha256:c0ffee42ab
                root_matches: true
          description: >-
            The verification of that day: heads per slice, breaks and whether
            the anchored root matches.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ChainVerification:
      additionalProperties: false
      properties:
        anchored_root:
          anyOf:
            - type: string
            - type: 'null'
          description: Hex Merkle root written by the daily anchor.
          title: Anchored Root
        breaks:
          items:
            $ref: '#/components/schemas/ChainBreakOut'
          title: Breaks
          type: array
        day:
          format: date
          title: Day
          type: string
        heads:
          items:
            $ref: '#/components/schemas/ChainHeadOut'
          title: Heads
          type: array
        receipts:
          title: Receipts
          type: integer
        root_matches:
          anyOf:
            - type: boolean
            - type: 'null'
          description: None while the day is not anchored yet.
          title: Root Matches
        valid:
          title: Valid
          type: boolean
      required:
        - day
        - valid
        - receipts
        - heads
      title: ChainVerification
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    ChainBreakOut:
      additionalProperties: false
      properties:
        reason:
          title: Reason
          type: string
        seq:
          title: Seq
          type: integer
        slice:
          title: Slice
          type: integer
      required:
        - slice
        - seq
        - reason
      title: ChainBreakOut
      type: object
    ChainHeadOut:
      additionalProperties: false
      properties:
        hash:
          title: Hash
          type: string
        seq:
          title: Seq
          type: integer
        slice:
          title: Slice
          type: integer
      required:
        - slice
        - seq
        - hash
      title: ChainHeadOut
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````