> ## 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 pending state saves

> Outstanding pending state saves newest first, with the outstanding and failed totals.

``status`` ``failed`` lists the failed saves only; ``outstanding`` (or none) lists every save
still outstanding. A page holds at most ``limit`` saves; ``cursor`` continues from a page's
``next_cursor``.



## OpenAPI

````yaml /openapi.json get /api/state-pending-saves
openapi: 3.1.0
info:
  description: >-
    The operator HTTP surface served under /api/*. The platform's core routes.
    Plugin routes are published by each plugin.
  title: tai42-skeleton API
  version: 23.0.0
servers: []
security: []
paths:
  /api/state-pending-saves:
    get:
      tags:
        - states
      summary: List pending state saves
      description: >-
        Outstanding pending state saves newest first, with the outstanding and
        failed totals.


        ``status`` ``failed`` lists the failed saves only; ``outstanding`` (or
        none) lists every save

        still outstanding. A page holds at most ``limit`` saves; ``cursor``
        continues from a page's

        ``next_cursor``.
      operationId: get_api_state_pending_saves
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/StatePendingSavesPage'
                required:
                  - data
                type: object
          description: Success.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '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:
    StatePendingSavesPage:
      description: >-
        One page of pending saves, newest first, with the totals of every
        outstanding and every failed save.


        ``next_cursor`` is the cursor the next page reads from, ``null`` on the
        last page.
      properties:
        failed:
          title: Failed
          type: integer
        items:
          items:
            $ref: '#/components/schemas/StatePendingSave'
          title: Items
          type: array
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        outstanding:
          title: Outstanding
          type: integer
      required:
        - items
        - next_cursor
        - outstanding
        - failed
      title: StatePendingSavesPage
      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
    StatePendingSave:
      description: >-
        One outstanding pending state save, without its record data or call
        arguments.


        ``status`` is ``pending`` (records not yet applied), ``calls`` (records
        applied, calls queued),

        ``running`` (a call is running) or ``failed`` (held until an operator
        retries or discards it;

        ``failed_phase`` says which part failed).
      properties:
        attempts:
          title: Attempts
          type: integer
        calls:
          items:
            $ref: '#/components/schemas/StatePendingSaveCall'
          title: Calls
          type: array
        created_at:
          format: date-time
          title: Created At
          type: string
        failed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Failed At
        failed_phase:
          anyOf:
            - enum:
                - records
                - calls
              type: string
            - type: 'null'
          title: Failed Phase
        id:
          title: Id
          type: string
        last_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Id
        states:
          items:
            type: string
          title: States
          type: array
        status:
          enum:
            - pending
            - calls
            - running
            - failed
          title: Status
          type: string
        subjects:
          items:
            $ref: '#/components/schemas/StatePendingSaveSubject'
          title: Subjects
          type: array
      required:
        - id
        - status
        - run_id
        - states
        - subjects
        - calls
        - attempts
        - last_error
        - failed_phase
        - created_at
        - failed_at
      title: StatePendingSave
      type: object
    StatePendingSaveCall:
      description: >-
        One call a pending save runs after its records apply: its call ``kind``
        and what it calls.
      properties:
        kind:
          title: Kind
          type: string
        target:
          title: Target
          type: string
      required:
        - kind
        - target
      title: StatePendingSaveCall
      type: object
    StatePendingSaveSubject:
      description: One subject a pending save writes, under its ``state``.
      properties:
        state:
          title: State
          type: string
        subject:
          $ref: '#/components/schemas/StateSubject'
      required:
        - state
        - subject
      title: StatePendingSaveSubject
      type: object
    StateSubject:
      additionalProperties: false
      description: >-
        One addressed subject: a scope ``(target_kind, target_name)`` plus
        ``(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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.