---
title: "Delete Schedule Session"
method: DELETE
path: "/schedules/{schedule_id}/delete"
---

# Delete Schedule Session

`DELETE /schedules/{schedule_id}/delete`

Schedule deletion of an existing session after the HTTP response is sent.

Args:
    schedule_id: Unique identifier of the session to delete.
    background_tasks: FastAPI response-scoped background task collector.

Returns:
    A message confirming that session cleanup has been queued.

Raises:
    HTTPException: Status 404 when the session does not exist.

Behavior:
    Cleanup is registered with FastAPI rather than run before responding. The
    cleanup routine removes the session and requests cancellation of unfinished
    scheduler initialization or background generation. A later request may see
    the session until the response background task executes.

## Path parameters

- `schedule_id` string, required

## Response `200`

Successful Response

- MessageResponse — Generic message response model. **Usage:** ```python MessageResponse(message="ok") ``` **Fields:** - message: Response message text
  - `message` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/mucsci/apis/course-scheduler-api.md) · [All operations](https://skmtc.dev/mucsci/apis/course-scheduler-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mucsci/course-scheduler-api/revisions/592f7d3013d3/schema)
