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

# List declared states

> Every declared state, base + composed effective schema included, each with its
``updated_at`` timestamp (the Updated column).



## OpenAPI

````yaml /openapi.json get /api/states
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:
    get:
      tags:
        - states
      summary: List declared states
      description: >-
        Every declared state, base + composed effective schema included, each
        with its

        ``updated_at`` timestamp (the Updated column).
      operationId: get_api_states
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/StateDeclarationList'
                required:
                  - data
                type: object
          description: Success.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    StateDeclarationList:
      description: >-
        The bare-list body of ``list_states`` — every declared state as its full

        ``StateDeclaration`` (base + composed effective schema, regimes and
        ``updated_at``

        included).
      items:
        $ref: '#/components/schemas/StateDeclaration'
      title: StateDeclarationList
      type: array
    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
    StateDeclaration:
      additionalProperties: false
      description: >-
        A declared state: its ``name``, human ``description``, base JSON
        ``schema``

        (wire key ``schema``, attribute ``schema_``), the ``subject_kinds`` it
        serves

        (≥1, unique, each matching :data:`SUBJECT_KIND_RE`), the
        ``default_subject_kind``

        a door's ambient subject resolves to (one of ``subject_kinds``), and an
        optional

        ``retention_days`` (a positive INT4, or unset to keep records forever).


        ``effective_schema`` is the base ``schema`` composed with every attached
        template's

        fragment, and ``regimes`` are the absolute write-regime rules composed
        over the

        attachments (each ``{path, regime}``, the attachment path prefixed onto
        the template's regime

        paths). ``updated_at`` is the row's last-write timestamp. The platform
        computes all

        three and serves them on every read; a client that supplies a
        non-``None`` value for

        any of them on a write is refused (``… is set/computed by the
        platform``), so none can

        be forged across the wire.
      properties:
        default_subject_kind:
          title: Default Subject Kind
          type: string
        description:
          default: ''
          title: Description
          type: string
        effective_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Effective Schema
        name:
          title: Name
          type: string
        regimes:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          default: null
          title: Regimes
        retention_days:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 2147483647
              type: integer
            - type: 'null'
          default: null
          title: Retention Days
        schema:
          anyOf:
            - $ref: '#/components/schemas/TemplatedText'
            - additionalProperties: true
              type: object
          title: Schema
        subject_kinds:
          items:
            type: string
          minItems: 1
          title: Subject Kinds
          type: array
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          title: Updated At
      required:
        - name
        - subject_kinds
        - default_subject_kind
      title: StateDeclaration
      type: object
    TemplatedText:
      additionalProperties: false
      description: >-
        A renderable text: its source plus the parameters its render takes.


        EXACTLY ONE source is set — ``content`` (the text inline) or ``id`` (the
        id of a

        stored resource holding the text); neither and both are refused at
        construction.

        ``kwargs`` are the render parameters for the TEXT and apply either way,
        so moving a

        text from inline to stored (or back) leaves its parameters untouched.
      properties:
        content:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Content
        id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Id
        kwargs:
          additionalProperties: true
          title: Kwargs
          type: object
      title: TemplatedText
      type: object
      x-tai42-templated-text:
        language: jinja
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````