---
title: "Cleanup Orphaned Schedules"
method: POST
path: "/api/admin/diagnostics/schedules/cleanup-orphaned"
tags: ["v2", "admin", "diagnostics", "admin"]
---

# Cleanup Orphaned Schedules

`POST /api/admin/diagnostics/schedules/cleanup-orphaned`

Cleanup orphaned schedules by deleting from scheduler (admin only).

Args:
    request: Contains list of schedule_ids to delete

Returns:
    Number of schedules deleted and success message

## Request body

- ScheduleCleanupRequest — Request model for cleaning up schedules
  - `schedule_ids` string[], required

## Response `200`

Successful Response

- ScheduleCleanupResponse — Response model for schedule cleanup operations
  - `success` boolean, required
  - `deleted_count` integer
  - `message` string, required

## Other responses

- `401` — Authentication required
- `422` — Validation Error

---

[API](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/versions/382041c7ecb2/schema)
