> ## 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 a claim

> A verdict per object and field, without waiting for the source: whether the value may be claimed now, whether the given value matches the one held and what may not be said with data this old.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/state/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-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/state/verify:
    post:
      tags:
        - state
      summary: Verify a claim
      description: >-
        A verdict per object and field for a claim, without waiting for the
        source: whether it may be claimed

        now, whether a value given matches the one held, and what may not be
        said with data this old.


        **Authentication.** Source key: `Authorization: Bearer nia_sk_...`.
        Required scope: `context`. It answers only in a space with the `state`
        feature on (the `features` document); in a space without it, 404.
      operationId: state_verify_v1_state_verify_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StateVerifyRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StateVerifyResponse'
          description: Successful Response
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
      x-codeSamples:
        - lang: python
          label: Python
          source: >-
            # Whether the agent may state this price now; a value not safe to
            claim is read again by your resolver

            verdict = conversation.verify_claim("item_variant:store:991",
            "price_sale", 199.9)

            if not verdict.claim_safe:
                ...  # say the gap, or quote again
        - lang: typescript
          label: TypeScript
          source: >-
            // Whether the agent may state this price now; a value not safe to
            claim is read again by your resolver

            const verdict = await convo.verifyClaim("item_variant:store:991",
            "price_sale", 199.9);

            if (!verdict.claimSafe) {
              // say the gap, or quote again
            }
components:
  schemas:
    StateVerifyRequest:
      additionalProperties: false
      properties:
        checks:
          items:
            $ref: '#/components/schemas/VerifyCheck'
          maxItems: 50
          minItems: 1
          title: Checks
          type: array
        subject:
          anyOf:
            - $ref: '#/components/schemas/Handle'
            - type: 'null'
      required:
        - checks
      title: StateVerifyRequest
      type: object
    StateVerifyResponse:
      additionalProperties: false
      properties:
        verdicts:
          items:
            $ref: '#/components/schemas/Verdict'
          title: Verdicts
          type: array
      required:
        - verdicts
      title: StateVerifyResponse
      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
    VerifyCheck:
      additionalProperties: false
      properties:
        field:
          maxLength: 256
          minLength: 1
          title: Field
          type: string
        ref:
          $ref: '#/components/schemas/StateRef'
        value:
          title: Value
      required:
        - ref
        - field
      title: VerifyCheck
      type: object
    Handle:
      additionalProperties: false
      description: >-
        An identifier of a subject in some channel or system: a phone, an
        e-mail, a CRM id.
      properties:
        scope:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: >-
            Namespace for scoped identifiers: the WhatsApp Business account for
            `wa_bsuid`, the system for `system_id`, the country for
            `gov_id_hmac`.
          title: Scope
        subject_kind:
          anyOf:
            - $ref: '#/components/schemas/SubjectKind'
            - type: 'null'
          description: Defaults to `person`, except for organization-only handle types.
        type:
          $ref: '#/components/schemas/HandleType'
        value:
          maxLength: 320
          minLength: 1
          title: Value
          type: string
          description: >-
            The identifier. Normalized on the server: E.164 for phones,
            lowercase for e-mail.
      required:
        - type
        - value
      title: Handle
      type: object
    Verdict:
      additionalProperties: false
      properties:
        claim_safe:
          title: Claim Safe
          type: boolean
        declared_gaps:
          items:
            type: string
          title: Declared Gaps
          type: array
        field:
          maxLength: 256
          minLength: 1
          title: Field
          type: string
        matches:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Matches
        prohibitions:
          items:
            type: string
          title: Prohibitions
          type: array
        ref:
          $ref: '#/components/schemas/StateRef'
        status:
          enum:
            - fresh
            - stale
            - expired
          title: Status
          type: string
      required:
        - ref
        - field
        - claim_safe
        - status
      title: Verdict
      type: object
    StateRef:
      additionalProperties: false
      description: >-
        An object of the type registry: a subject's or a shared one, whose key
        may name a variant.
      properties:
        id:
          maxLength: 512
          minLength: 1
          title: Id
          type: string
        namespace:
          maxLength: 256
          minLength: 1
          title: Namespace
          type: string
        type:
          maxLength: 256
          minLength: 1
          title: Type
          type: string
        variant:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Variant
      required:
        - type
        - namespace
        - id
      title: StateRef
      type: object
    SubjectKind:
      enum:
        - person
        - account
        - partner
      title: SubjectKind
      type: string
      description: >-
        A person, a customer organization (`account`) or an organization that
        takes part without being a customer (`partner`).
    HandleType:
      enum:
        - phone_e164
        - wa_id
        - wa_jid
        - wa_lid
        - wa_bsuid
        - email
        - gov_id_hmac
        - app_user_id
        - system_id
        - org_registry_hmac
        - email_domain
        - anon_id
      title: HandleType
      type: string
      description: >-
        The kind of identifier. The value is classified by its format, never by
        the field it came from.
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````