> ## 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.

# Conferir uma afirmação

> Um veredito por objeto e campo, sem esperar pela fonte: se o valor pode ser afirmado agora, se o valor dado bate com o guardado e o que não pode ser dito com dado dessa idade.



## OpenAPI

````yaml openapi/pt/cell.json POST /v1/state/verify
openapi: 3.1.0
info:
  title: API de dados da Niadra
  version: '1'
  description: >-
    Escrita, contexto, histórico, objetos, identidade, privacidade e governança
    de um espaço. Cada espaço tem um endereço estável, com o espaço e a região
    no nome.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: O espaço, que vem na chave de fonte.
      region:
        default: us-east-2
        description: A região do espaço, que também vem na chave.
security: []
paths:
  /v1/state/verify:
    post:
      tags:
        - state
      summary: Conferir uma afirmação
      description: >-
        Um veredito por objeto e campo para uma afirmação, sem esperar pela
        fonte: se pode ser afirmado agora, se um valor dado bate com o guardado
        e o que não pode ser dito com dado dessa idade.


        **Autenticação.** Chave de fonte: `Authorization: Bearer nia_sk_...`.
        Escopo exigido: `context`. Só responde num espaço com a funcionalidade
        `state` ligada (o documento `features`); num espaço sem ela, 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: Resposta de sucesso.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      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: >-
        Detalhes do problema no formato da RFC 9457; `code` vem do catálogo de
        erros versionado.
      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: >-
        Um identificador de um sujeito num canal ou sistema: um telefone, um
        e-mail, um id do CRM.
      properties:
        scope:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: >-
            Espaço de nomes dos identificadores com escopo: a conta do WhatsApp
            Business para `wa_bsuid`, o sistema para `system_id`, o país para
            `gov_id_hmac`.
          title: Scope
        subject_kind:
          anyOf:
            - $ref: '#/components/schemas/SubjectKind'
            - type: 'null'
          description: >-
            O padrão é `person`, exceto nos tipos de handle que só identificam
            organizações.
        type:
          $ref: '#/components/schemas/HandleType'
        value:
          maxLength: 320
          minLength: 1
          title: Value
          type: string
          description: >-
            O identificador. Normalizado no servidor: E.164 para telefone,
            minúsculas para 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: >-
        Um objeto do registro de tipos: de um cliente ou compartilhado, cuja
        chave pode nomear uma variante.
      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: >-
        Uma pessoa, uma organização cliente (`account`) ou uma organização que
        participa sem ser cliente (`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: >-
        O tipo de identificador. O valor é classificado pelo formato, nunca pelo
        campo de onde veio.
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````