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

# A customer's now view

> The customer's objects of the declared types, the shared objects they showed interest in and what changed since they saw them, and the same as lines for the turn block.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/state/view
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/view:
    post:
      tags:
        - state
      summary: A customer's now view
      description: >-
        The subject's `now` view for the read's purpose: their objects, the
        shared objects they showed

        interest in and what changed since they saw them, and the same as lines
        for the turn block.


        **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_view_v1_state_view_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StateViewRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StateView'
          description: Successful Response
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
components:
  schemas:
    StateViewRequest:
      additionalProperties: false
      properties:
        purpose:
          default: display
          enum:
            - display
            - claim
            - decide
          title: Purpose
          type: string
        subject:
          $ref: '#/components/schemas/Handle'
      required:
        - subject
      title: StateViewRequest
      type: object
    StateView:
      additionalProperties: false
      description: >-
        The state of one subject (the `now` view): their objects of the declared
        types, each as a `display`

        read serves it; the shared objects they showed interest in, and what
        changed since they saw them; and

        the same as short lines for the turn block.
      properties:
        changes_since_seen:
          items:
            $ref: '#/components/schemas/ChangeSinceSeen'
          title: Changes Since Seen
          type: array
        degraded:
          default: false
          title: Degraded
          type: boolean
        interests:
          items:
            $ref: '#/components/schemas/InterestState'
          title: Interests
          type: array
        objects:
          items:
            $ref: '#/components/schemas/ObjectRead'
          title: Objects
          type: array
        text:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The view as lines for the turn block, after `slots`: never part of
            the pack's `text`, so the cached prefix keeps its bytes. Absent when
            there is nothing to say.
          title: Text
      title: StateView
      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
    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
    ChangeSinceSeen:
      additionalProperties: false
      description: A field of an interest whose value is not the one the subject was shown.
      properties:
        field:
          maxLength: 256
          minLength: 1
          title: Field
          type: string
        now:
          title: Now
        observed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the source observed the value now held.
          title: Observed At
        ref:
          $ref: '#/components/schemas/StateRef'
        seen:
          title: Seen
      required:
        - ref
        - field
      title: ChangeSinceSeen
      type: object
    InterestState:
      additionalProperties: false
      description: A shared object the subject showed interest in, as it stands now.
      properties:
        at:
          format: date-time
          title: At
          type: string
        object:
          anyOf:
            - $ref: '#/components/schemas/ObjectRead'
            - type: 'null'
          description: >-
            The object as a `display` read serves it; absent once it left the
            working set.
        reason:
          description: '`presented`, `engaged`, `feedback` or `watch`.'
          maxLength: 256
          minLength: 1
          title: Reason
          type: string
        ref:
          $ref: '#/components/schemas/StateRef'
      required:
        - ref
        - reason
        - at
      title: InterestState
      type: object
    ObjectRead:
      additionalProperties: false
      description: >-
        One object as a state read serves it: fields with four logical values
        and their stamps, computed

        values, lifecycle, timers and readings, and what may not be claimed with
        data this old. A read never

        refuses; a `decide` read of a type that asks for it carries `refusal`
        beside the values, for the company's

        tool.
      properties:
        as_of:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: As Of
        axes:
          additionalProperties:
            type: string
          description: >-
            Each time axis of the type whose value is known: a date as
            `YYYY-MM-DD`, an instant in UTC. The platform keeps `known_at` (when
            the producer first knew of the object) and the time its content last
            changed.
          title: Axes
          type: object
        blocked:
          additionalProperties:
            items:
              type: string
            type: array
          description: >-
            What the fields whose value is not known block, as the type declares
            it (`unobserved_blocks`): each activity (`model_read`, `derive`,
            `claim`, or a task of the company such as `decide:close`) with the
            fields that block it. Nothing else is blocked.
          propertyNames:
            maxLength: 256
            minLength: 1
          title: Blocked
          type: object
        declared_gaps:
          items:
            type: string
          title: Declared Gaps
          type: array
        derived_status:
          anyOf:
            - enum:
                - current
                - expired_by_input
              type: string
            - type: 'null'
          title: Derived Status
        expired_by:
          description: The inputs whose change expired it.
          items:
            type: string
          title: Expired By
          type: array
        fields:
          additionalProperties:
            $ref: '#/components/schemas/FieldState'
          title: Fields
          type: object
        latches:
          additionalProperties:
            format: date-time
            type: string
          title: Latches
          type: object
        outcome:
          anyOf:
            - $ref: '#/components/schemas/OutcomeState'
            - type: 'null'
        prohibitions:
          items:
            type: string
          title: Prohibitions
          type: array
        readings:
          additionalProperties:
            $ref: '#/components/schemas/ReadingResult'
          title: Readings
          type: object
        ref:
          $ref: '#/components/schemas/StateRef'
        refetch:
          anyOf:
            - $ref: '#/components/schemas/Refetch'
            - type: 'null'
        refusal:
          anyOf:
            - $ref: '#/components/schemas/Refusal'
            - type: 'null'
        state:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: State
        timers:
          items:
            $ref: '#/components/schemas/TimerState'
          title: Timers
          type: array
        type_version:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Type Version
        values:
          additionalProperties:
            $ref: '#/components/schemas/ValueState'
          title: Values
          type: object
        withheld:
          additionalProperties:
            enum:
              - access
              - licence
              - scan
            type: string
          description: Fields left out for this reader, and why.
          title: Withheld
          type: object
      required:
        - ref
      title: ObjectRead
      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.
    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
    FieldState:
      additionalProperties: false
      description: >-
        One field as a read serves it: the value with its logical value, stamps,
        source and observer, and the

        freshness computed now against the type's current rule.
      properties:
        age_s:
          anyOf:
            - type: integer
            - type: 'null'
          description: Seconds since `observed_at`.
          title: Age S
        claim_safe:
          title: Claim Safe
          type: boolean
        completeness:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Completeness
        content:
          anyOf:
            - $ref: '#/components/schemas/ContentMarker'
            - type: 'null'
        known_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When Niadra first knew it; never moves.
          title: Known At
        logic:
          enum:
            - 'yes'
            - 'no'
            - unobserved
            - known_defect
          title: Logic
          type: string
        masked:
          default: false
          description: 'The reader''s access masks the value: `v` is absent.'
          title: Masked
          type: boolean
        observed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the source observed the value.
          title: Observed At
        observer:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Observer
        role:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Role
        src:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Src
        status:
          enum:
            - fresh
            - stale
            - expired
          title: Status
          type: string
        v:
          title: V
        valid_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Valid At
        was:
          anyOf:
            - $ref: '#/components/schemas/PreviousValue'
            - type: 'null'
      required:
        - logic
        - status
        - claim_safe
      title: FieldState
      type: object
    OutcomeState:
      additionalProperties: false
      properties:
        at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: At
        final:
          title: Final
          type: boolean
        state:
          description: A canonical state of the type, or `expired_without_outcome`.
          maxLength: 256
          minLength: 1
          title: State
          type: string
      required:
        - state
        - final
      title: OutcomeState
      type: object
    ReadingResult:
      additionalProperties: false
      description: >-
        A named reading's value, as niadra-expr computes it: the logical value,
        and the kind and value when

        known (dates as `YYYY-MM-DD`, times in UTC, durations in milliseconds).
      properties:
        absent:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Absent
        inputs:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          description: >-
            For a reading that includes its inputs: the derived object's inputs,
            by the name its type gives them, as `type:namespace:id`.
          title: Inputs
        logic:
          enum:
            - 'yes'
            - 'no'
            - unobserved
            - known_defect
          title: Logic
          type: string
        type:
          anyOf:
            - enum:
                - bool
                - number
                - string
                - duration
                - date
                - datetime
                - list
              type: string
            - type: 'null'
          title: Type
        v:
          title: V
      required:
        - logic
      title: ReadingResult
      type: object
    Refetch:
      additionalProperties: false
      properties:
        admitted:
          title: Admitted
          type: boolean
        priority:
          enum:
            - high
            - normal
            - low
          title: Priority
          type: string
        reason:
          maxLength: 256
          minLength: 1
          title: Reason
          type: string
      required:
        - reason
        - priority
        - admitted
      title: Refetch
      type: object
    Refusal:
      additionalProperties: false
      properties:
        action:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Action
        reason:
          maxLength: 256
          minLength: 1
          title: Reason
          type: string
      required:
        - reason
      title: Refusal
      type: object
    TimerState:
      additionalProperties: false
      properties:
        due_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Computed now from the rule and the values.
          title: Due At
        fired_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Fired At
        name:
          maxLength: 256
          minLength: 1
          title: Name
          type: string
        state:
          enum:
            - armed
            - fired
            - cancelled
          title: State
          type: string
        supersedes_firing_id:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          description: >-
            The firing this one replaces: a timer that already fired fires again
            once the value that armed it is revised.
          title: Supersedes Firing Id
      required:
        - name
        - state
      title: TimerState
      type: object
    ValueState:
      additionalProperties: false
      description: >-
        A value the company computed, kept as a versioned fact with the rule
        that produced it.
      properties:
        absent_as:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: The name of the absence, when absent.
          title: Absent As
        claim_safe:
          title: Claim Safe
          type: boolean
        computed_at:
          format: date-time
          title: Computed At
          type: string
        declared_gaps:
          items:
            type: string
          title: Declared Gaps
          type: array
        gap_effect:
          default: unknown
          enum:
            - errs_early
            - errs_late
            - unknown
          title: Gap Effect
          type: string
        logic:
          enum:
            - 'yes'
            - 'no'
            - unobserved
            - known_defect
          title: Logic
          type: string
        rule:
          maxLength: 256
          minLength: 1
          title: Rule
          type: string
        status:
          enum:
            - fresh
            - stale
            - expired
          title: Status
          type: string
        supersedes_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Supersedes Version
        v:
          title: V
        version:
          minimum: 1
          title: Version
          type: integer
      required:
        - logic
        - version
        - rule
        - computed_at
        - status
        - claim_safe
      title: ValueState
      type: object
    ContentMarker:
      additionalProperties: false
      description: >-
        A content field whose text Niadra does not hold (`pointer`,
        `hash_only`), or holds under scan.
      properties:
        mode:
          enum:
            - full
            - pointer
            - hash_only
          title: Mode
          type: string
        pointer:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          description: Where the SDK reads the text inside the company's boundary.
          title: Pointer
        scan:
          enum:
            - pending
            - clean
            - flagged
          title: Scan
          type: string
        sha256:
          anyOf:
            - pattern: ^[0-9a-f]{64}$
              type: string
            - type: 'null'
          title: Sha256
      required:
        - mode
        - scan
      title: ContentMarker
      type: object
    PreviousValue:
      additionalProperties: false
      description: >-
        A field's value before its latest change, kept for the fields that
        declare `track_changes`.
      properties:
        logic:
          enum:
            - 'yes'
            - 'no'
            - unobserved
            - known_defect
          title: Logic
          type: string
        v:
          title: V
      required:
        - logic
      title: PreviousValue
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````