> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specterops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger database and datalake cleanup

> Trigger the housekeeping service to clean up expired files and database entries, and reset the workflow manager state. Optionally specify an expiration date or 'all' to remove all files.



## OpenAPI

````yaml /nemesis-docs/docs/nemesis-api.json post /system/cleanup
openapi: 3.1.0
info:
  title: Enrichment API
  description: API for file enrichment services
  version: 0.1.0
servers:
  - url: /api
security: []
tags:
  - name: files
    description: File management operations
  - name: workflows
    description: Workflow management operations
  - name: enrichments
    description: Enrichment management operations
  - name: system
    description: System and health check endpoints
paths:
  /system/cleanup:
    post:
      tags:
        - system
      summary: Trigger database and datalake cleanup
      description: >-
        Trigger the housekeeping service to clean up expired files and database
        entries, and reset the workflow manager state. Optionally specify an
        expiration date or 'all' to remove all files.
      operationId: trigger_cleanup_system_cleanup_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CleanupRequest'
              description: Optional cleanup parameters
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CleanupRequest:
      properties:
        expiration:
          anyOf:
            - type: string
            - type: 'null'
          title: Expiration
      type: object
      title: CleanupRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Error message details
      type: object
      required:
        - detail
      title: ErrorResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````