---
title: "Delete an RL training environment"
method: DELETE
path: "/rl/environments/{environmentId}"
tags: ["Create"]
---

# Delete an RL training environment

`DELETE /rl/environments/{environmentId}`

## Request

- Base URL: `https://www.cloudworldmodel.ai/api`
- URL: `https://www.cloudworldmodel.ai/api/rl/environments/{environmentId}`
- Auth: none required

Cancel a running RL training episode. This endpoint is idempotent - calling it multiple times
on the same episode will return success without error.

**Cancellation Rules:**
- Episodes with isActive=true will be cancelled
- Episodes already cancelled (isActive=false) will return success (idempotent behavior)
- Cancelled episodes will have isActive set to false and a cancelledAt timestamp

## Path parameters

- `environmentId` string, uuid, required

## Response `200`

Episode cancelled successfully or was already cancelled.
Returns the same response whether cancelling for the first time or if already cancelled
(idempotent operation).

- object
  - `id` string, uuid
  - `isActive` false
  - `cancelledAt` string, date-time
  - `message` string: Message indicating if episode was just cancelled or already cancelled

## Other responses

- `404`: Resource not found

---

[API](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api.md) · [All operations](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api/revisions/ecc3ad1ff07f?raw)
