---
title: "ListCleanupTasksQuery"
description: "Query parameters for listing CleanupTask entities."
section: "Reference"
group: "Types"
order: 45
---

## Definition

```ts
interface ListCleanupTasksQuery {
  status?: "pending" | "failed" | "completed" | "in_progress" | undefined;
  resource_type?:
    | "delete_workspace"
    | "delete_app"
    | "delete_element"
    | "delete_database"
    | "delete_file"
    | "delete_email"
    | "r2_object"
    | "r2_prefix"
    | "r2_bucket"
    | "d1"
    | "pages_project"
    | "cf_image"
    | "cf_stream"
    | undefined;
  workspace_id?: string | undefined;
  parent_id?: string | undefined;
  source_event_id?: string | undefined;
}
```

## Fields

| Field             | Type                                                                                                                                                                                                                               | Notes                                                                   |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `status`          | `"pending" \| "failed" \| "completed" \| "in_progress" \| undefined`                                                                                                                                                               | `optional` — Filter by cleanup task status.                             |
| `resource_type`   | `"delete_workspace" \| "delete_app" \| "delete_element" \| "delete_database" \| "delete_file" \| "delete_email" \| "r2_object" \| "r2_prefix" \| "r2_bucket" \| "d1" \| "pages_project" \| "cf_image" \| "cf_stream" \| undefined` | `optional` — Filter by resource kind being cleaned up.                  |
| `workspace_id`    | `string \| undefined`                                                                                                                                                                                                              | `optional` — Filter to tasks touching a specific workspace's resources. |
| `parent_id`       | `string \| undefined`                                                                                                                                                                                                              | `optional` — Filter to children of a given parent cleanup task.         |
| `source_event_id` | `string \| undefined`                                                                                                                                                                                                              | `optional` — Filter to tasks spawned by a specific source event.        |
