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

# Read a subject's record

> One subject's record, or ``null`` when none exists. An unknown ``person`` subject is a
refusal, never an empty document. A subject ``key`` that contains ``/`` (a thread key is
a thread id) is percent-encoded as one path segment; this holds for every single-record
door.



## OpenAPI

````yaml /openapi.json get /api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 14.0.2
servers: []
security: []
paths:
  /api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}:
    get:
      tags:
        - states
      summary: Read a subject's record
      description: >-
        One subject's record, or ``null`` when none exists. An unknown
        ``person`` subject is a

        refusal, never an empty document. A subject ``key`` that contains ``/``
        (a thread key is

        a thread id) is percent-encoded as one path segment; this holds for
        every single-record

        door.
      operationId: get_api_states_name_records_target_kind_target_name_kind_key
      parameters:
        - in: path
          name: name
          required: true
          schema:
            type: string
        - in: path
          name: target_kind
          required: true
          schema:
            type: string
        - in: path
          name: target_name
          required: true
          schema:
            type: string
        - in: path
          name: kind
          required: true
          schema:
            type: string
        - in: path
          name: key
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/StateRecordOrNull'
                required:
                  - data
                type: object
          description: Success.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Resource not found.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Request failed validation.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    StateRecordOrNull:
      anyOf:
        - $ref: '#/components/schemas/StateRecord'
        - type: 'null'
      description: >-
        The ``read_state_record`` body: one subject's record as a
        ``StateRecord``, or

        ``null`` when the subject holds none.
      title: StateRecordOrNull
    Error:
      properties:
        code:
          description: >-
            Stable machine-readable reason a client keys a dedicated error state
            on, present on refusals that opt in (e.g. a 501 not-configured
            refusal). Optional: absent when the error carries only a
            human-readable message.
          type: string
        error:
          type: string
      required:
        - error
      type: object
    StateRecord:
      additionalProperties: false
      description: >-
        A read record: the ``state``, its ``subject``, the ``data`` document and
        its

        monotonic ``seq``, plus the ``canonical_subject`` a fold resolved the
        subject to

        and every subject ``folded_from`` into it. Frozen.
      properties:
        canonical_subject:
          $ref: '#/components/schemas/StateSubject'
        data:
          additionalProperties: true
          title: Data
          type: object
        folded_from:
          items:
            $ref: '#/components/schemas/StateSubject'
          title: Folded From
          type: array
        seq:
          title: Seq
          type: number
        state:
          title: State
          type: string
        subject:
          $ref: '#/components/schemas/StateSubject'
      required:
        - state
        - subject
        - seq
        - canonical_subject
      title: StateRecord
      type: object
    StateSubject:
      additionalProperties: false
      description: >-
        One addressed subject: the conversation-target scope

        ``(target_kind, target_name)`` plus the ``(kind, key)`` within it.


        Equality (and identity across every store method) is all four fields.
        ``key`` is

        stripped and must be 1..512 characters; ``kind`` matches
        :data:`SUBJECT_KIND_RE`.

        Frozen so a validated subject cannot be mutated after it is read back.
      properties:
        key:
          title: Key
          type: string
        kind:
          title: Kind
          type: string
        target_kind:
          enum:
            - agent
            - tool
          title: Target Kind
          type: string
        target_name:
          minLength: 1
          title: Target Name
          type: string
      required:
        - target_kind
        - target_name
        - kind
        - key
      title: StateSubject
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````