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

# Get a state

> One state's served declaration: base ``schema``, ``effective_schema``,
``subject_kinds``, ``default_subject_kind``, its ``attachments``, computed ``regimes`` and
``updated_at`` (the ISO timestamp of its last write).



## OpenAPI

````yaml /openapi.json get /api/states/{name}
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}:
    get:
      tags:
        - states
      summary: Get a state
      description: >-
        One state's served declaration: base ``schema``, ``effective_schema``,

        ``subject_kinds``, ``default_subject_kind``, its ``attachments``,
        computed ``regimes`` and

        ``updated_at`` (the ISO timestamp of its last write).
      operationId: get_api_states_name
      parameters:
        - in: path
          name: name
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/ServedStateView'
                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.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ServedStateView:
      description: >-
        The full served declaration read of ``get_state``: the base ``schema``
        and the

        composed ``effective_schema`` (both open JSON-Schema objects), the
        ``subject_kinds``

        the state serves and its ``default_subject_kind``, an optional
        ``retention_days``

        (``null`` to keep records forever), the state's ``attachments``, the
        absolute write-regime

        rules ``regimes`` (each ``{path, regime}``), and ``updated_at`` (the ISO
        timestamp of

        the last write, ``null`` before any). The Python attribute for the wire
        ``schema`` key

        is suffixed to avoid shadowing a ``BaseModel`` member; the wire key
        stays ``schema``

        via the alias.
      properties:
        attachments:
          items:
            $ref: '#/components/schemas/StateAttachmentView'
          title: Attachments
          type: array
        default_subject_kind:
          title: Default Subject Kind
          type: string
        description:
          title: Description
          type: string
        effective_schema:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          title: Effective Schema
          type: object
        name:
          title: Name
          type: string
        regimes:
          items:
            additionalProperties:
              $ref: '#/components/schemas/JsonValue'
            type: object
          title: Regimes
          type: array
        retention_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retention Days
        schema:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          title: Schema
          type: object
        subject_kinds:
          items:
            type: string
          title: Subject Kinds
          type: array
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
      required:
        - name
        - description
        - schema
        - effective_schema
        - subject_kinds
        - default_subject_kind
        - retention_days
        - attachments
        - regimes
        - updated_at
      title: ServedStateView
      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
    StateAttachmentView:
      description: >-
        One template attached on a state, as the served declaration read carries
        it: the

        ``template`` name, the ``path`` in the document where its fragment
        lands, and the

        attachment's resolved ``parameters`` and static ``declarations`` (both
        arbitrary

        per-template JSON).
      properties:
        declarations:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          title: Declarations
          type: object
        parameters:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          title: Parameters
          type: object
        path:
          items:
            type: string
          title: Path
          type: array
        template:
          title: Template
          type: string
      required:
        - template
        - path
        - parameters
        - declarations
      title: StateAttachmentView
      type: object
    JsonValue: {}
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````