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

# Ler um objeto

> Estado derivado de um pedido, ticket ou fatura, com as pendências abertas.



## OpenAPI

````yaml openapi/pt/cell.json GET /v1/objects/{object_type}/{namespace}/{external_id}
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-1
        description: A região do espaço, que também vem na chave.
security: []
paths:
  /v1/objects/{object_type}/{namespace}/{external_id}:
    get:
      tags:
        - objects
      summary: Ler um objeto
      description: >-
        Estado derivado de um pedido, ticket ou fatura, com `as_of`, a fonte e a
        referência ao registro de origem. O valor oficial continua no seu
        sistema. Aceita `If-None-Match`.


        **Autenticação.** Chave de fonte: `Authorization: Bearer nia_sk_...`.
        Escopo exigido: `context`.
      operationId: read_object_v1_objects__object_type___namespace___external_id__get
      parameters:
        - in: path
          name: object_type
          required: true
          schema:
            title: Object Type
            type: string
          example: invoice
        - in: path
          name: namespace
          required: true
          schema:
            title: Namespace
            type: string
          example: erp
        - in: path
          name: external_id
          required: true
          schema:
            title: External Id
            type: string
          description: O id no sistema de registro. Pode conter barras.
          example: '0823'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectState'
              example:
                ref:
                  type: invoice
                  namespace: erp
                  id: '0823'
                state:
                  status: credited
                  amount_due: 49.9
                  currency: USD
                as_of: '2026-09-22T17:06:21Z'
                source_id: src_erp
                record_ref: erp://invoices/0823
                open_items: []
          description: O objeto.
        '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: |-
            invoice = niadra.object_state("invoice:erp:0823")
            if invoice:
                print(invoice.state, invoice.as_of)
        - lang: typescript
          label: TypeScript
          source: >-
            const { data: invoice } = await
            niadra.objectState("invoice:erp:0823");

            if (invoice) console.log(invoice.state, invoice.as_of);
components:
  schemas:
    ObjectState:
      additionalProperties: false
      properties:
        as_of:
          format: date-time
          title: As Of
          type: string
        open_items:
          items:
            $ref: '#/components/schemas/HistoryItem'
          title: Open Items
          type: array
        record_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Record Ref
          description: Referência ao registro de origem.
        ref:
          $ref: '#/components/schemas/ObjectRef'
        source_id:
          title: Source Id
          type: string
        state:
          additionalProperties: true
          title: State
          type: object
          description: Estado derivado. O valor oficial continua no sistema de registro.
      required:
        - ref
        - state
        - as_of
        - source_id
      title: ObjectState
      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
    HistoryItem:
      additionalProperties: false
      properties:
        at:
          format: date-time
          title: At
          type: string
        channel:
          anyOf:
            - type: string
            - type: 'null'
          title: Channel
        confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence
        id:
          title: Id
          type: string
        kind:
          title: Kind
          type: string
          description: >-
            Um de `episode`, `fact`, `open_item`, `action`, `system_event`,
            `object`, `trait`.
        origin_event_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Origin Event Id
          description: O evento de onde este item veio.
        outcome:
          anyOf:
            - type: string
            - type: 'null'
          title: Outcome
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
        text:
          title: Text
          type: string
          description: Texto denso, no mesmo estilo chave e valor do contexto.
      required:
        - id
        - kind
        - text
        - at
      title: HistoryItem
      type: object
    ObjectRef:
      additionalProperties: false
      description: Um objeto de negócio num sistema de registro.
      properties:
        id:
          maxLength: 512
          minLength: 1
          title: Id
          type: string
          description: O id nesse sistema.
        namespace:
          maxLength: 256
          minLength: 1
          title: Namespace
          type: string
          description: O sistema onde ele vive, como `erp`.
        type:
          maxLength: 256
          minLength: 1
          title: Type
          type: string
          description: Tipo do objeto, como `invoice`, `order` ou `ticket`.
      required:
        - type
        - namespace
        - id
      title: ObjectRef
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````