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

# Sweep expired checkpoint threads

> Delete the checkpoint threads of the deployment's store that are past their retention horizon.

A finished thread (marked by its owner) goes at the due time stored with its mark; on
``postgres``/``sqlite`` any thread goes its waiting retention (declared by its owner, else
``checkpoint_retention_waiting_minutes``) after its newest checkpoint (``redis`` expires it by key
TTL and ``memory`` keeps it for the process — both reported in ``skipped``). A thread a
registered live-thread filter claims is spared and listed. ``waiting_minutes`` and
``finished_minutes`` in the result are the platform's values: the default and ceiling of every
thread's retention.



## OpenAPI

````yaml /openapi.json post /api/checkpoints/sweep
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/checkpoints/sweep:
    post:
      tags:
        - checkpoints
      summary: Sweep expired checkpoint threads
      description: >-
        Delete the checkpoint threads of the deployment's store that are past
        their retention horizon.


        A finished thread (marked by its owner) goes at the due time stored with
        its mark; on

        ``postgres``/``sqlite`` any thread goes its waiting retention (declared
        by its owner, else

        ``checkpoint_retention_waiting_minutes``) after its newest checkpoint
        (``redis`` expires it by key

        TTL and ``memory`` keeps it for the process — both reported in
        ``skipped``). A thread a

        registered live-thread filter claims is spared and listed.
        ``waiting_minutes`` and

        ``finished_minutes`` in the result are the platform's values: the
        default and ceiling of every

        thread's retention.
      operationId: post_api_checkpoints_sweep
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/CheckpointSweepResult'
                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:
    CheckpointSweepResult:
      description: >-
        The checkpoint-sweep report.


        ``finished_swept`` / ``waiting_swept`` list the threads deleted past
        each horizon;

        ``spared`` lists the threads past a horizon a live-thread filter
        reported live.

        ``skipped`` is set only when the provider has no waiting-horizon sweep
        (its threads

        expire by key TTL, or live as long as the process). ``waiting_minutes``
        /

        ``finished_minutes`` are the platform's two retention values: the
        default and the

        ceiling of every thread's retention, which a thread's owner may declare
        shorter.
      properties:
        finished_minutes:
          title: Finished Minutes
          type: integer
        finished_swept:
          items:
            type: string
          title: Finished Swept
          type: array
        provider:
          title: Provider
          type: string
        skipped:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Skipped
        spared:
          items:
            type: string
          title: Spared
          type: array
        swept_count:
          title: Swept Count
          type: integer
        waiting_minutes:
          title: Waiting Minutes
          type: integer
        waiting_swept:
          items:
            type: string
          title: Waiting Swept
          type: array
      required:
        - provider
        - waiting_minutes
        - finished_minutes
        - swept_count
        - finished_swept
        - waiting_swept
        - spared
      title: CheckpointSweepResult
      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

````

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