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

# Prune the platform runs index

> Delete runs-index rows older than the configured retention window; return the
window and the number pruned.

A no-op (nothing deleted) when the store is OFF or ``TAI_RUNS_INDEX_RETENTION_DAYS``
is unset — each reported in ``skipped``, mirroring the checkpoint-retention sweep's
disabled-retention posture (unset = rows kept forever).



## OpenAPI

````yaml /openapi.json post /api/runs/prune
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/runs/prune:
    post:
      tags:
        - runs
      summary: Prune the platform runs index
      description: >-
        Delete runs-index rows older than the configured retention window;
        return the

        window and the number pruned.


        A no-op (nothing deleted) when the store is OFF or
        ``TAI_RUNS_INDEX_RETENTION_DAYS``

        is unset — each reported in ``skipped``, mirroring the
        checkpoint-retention sweep's

        disabled-retention posture (unset = rows kept forever).
      operationId: post_api_runs_prune
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/RunsPruneResult'
                required:
                  - data
                type: object
          description: Success.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReloadingError'
          description: The server is applying a config reload; retry shortly.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
      security:
        - ApiKeyAuth: []
components:
  schemas:
    RunsPruneResult:
      description: >-
        The runs-index prune report. ``skipped`` is present ONLY on a no-op
        branch

        (store off or retention unset); ``cutoff`` is present ONLY on a real
        prune (the

        ISO cutoff older than which rows were deleted).
      properties:
        cutoff:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Cutoff
        pruned_count:
          title: Pruned Count
          type: integer
        retention_days:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Retention Days
        skipped:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Skipped
      required:
        - pruned_count
      title: RunsPruneResult
      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
    ReloadingError:
      properties:
        error:
          const: reloading — the server is applying a config reload; retry shortly
          type: string
        reloading:
          const: true
          type: boolean
      required:
        - error
        - reloading
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````