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

# A subject's write audit trail

> One keyset page of a subject's write ledger: ``items`` (each entry's seq, timestamp,
completed origin (door/actor/consumer/meta/run/turn) and the paths it touched) and the
``next_cursor`` the next page reads from (null on the last page).



## OpenAPI

````yaml /openapi.json get /api/states/{name}/records/{target_kind}/{target_name}/{kind}/{key}/writes
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}/writes:
    get:
      tags:
        - states
      summary: A subject's write audit trail
      description: >-
        One keyset page of a subject's write ledger: ``items`` (each entry's
        seq, timestamp,

        completed origin (door/actor/consumer/meta/run/turn) and the paths it
        touched) and the

        ``next_cursor`` the next page reads from (null on the last page).
      operationId: get_api_states_name_records_target_kind_target_name_kind_key_writes
      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/WritesPage'
                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:
    WritesPage:
      additionalProperties: false
      description: >-
        One keyset page of a subject's write ledger: the ``items`` (newest
        first) and the

        ``next_cursor`` a caller feeds the next call. ``next_cursor`` is the
        last row's id (a

        string) when the page is full, else ``None`` — the page-model idiom the
        subject and

        search pages share, so a caller pages the audit trail the same way it
        pages them.
      properties:
        items:
          items:
            $ref: '#/components/schemas/WriteEntry'
          title: Items
          type: array
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Next Cursor
      title: WritesPage
      type: object
    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
    WriteEntry:
      additionalProperties: false
      description: >-
        One row of a subject's audit trail: the ``seq`` and timestamp ``at`` of
        the

        write, the :class:`CompletedOrigin` that produced it, and the absolute
        ``paths``

        it touched (each a list of string keys / integer list indices).
      properties:
        at:
          format: date-time
          title: At
          type: string
        origin:
          $ref: '#/components/schemas/CompletedOrigin'
        paths:
          items:
            items:
              anyOf:
                - type: string
                - type: integer
            type: array
          title: Paths
          type: array
        seq:
          title: Seq
          type: number
      required:
        - seq
        - at
        - origin
      title: WriteEntry
      type: object
    CompletedOrigin:
      additionalProperties: false
      description: >-
        A :class:`WriteOrigin` completed by the platform write chokepoint: the

        consumer's fields plus the ``door``, ``actor``, ``turn_id`` and
        ``inbound_id``

        stamped from :class:`StateContext`. This is the shape the
        ``state_writes`` ledger

        row and the ``_trace`` stamp carry. Frozen.
      properties:
        actor:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Actor
        consumer:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Consumer
        door:
          enum:
            - conversation
            - hook
            - schedule
            - tool
            - api
            - operator
          title: Door
          type: string
        inbound_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Inbound Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Meta
        op_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Op Id
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Run Id
        turn_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Turn Id
      required:
        - door
      title: CompletedOrigin
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````