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

# Delete an instance

> Permanently delete an instance and end its billing. Download anything you want to keep first.

<RequestExample>
  ```bash curl wrap theme={null}
  curl -X DELETE \
    https://api.agent37.com/v1/instances/ab12cd34ef \
    -H "Authorization: Bearer sk_live_..."
  ```

  ```python Python wrap theme={null}
  import requests

  response = requests.delete(
      "https://api.agent37.com/v1/instances/ab12cd34ef",
      headers={
          "Authorization": "Bearer sk_live_..."
      },
  )
  response.raise_for_status()
  print(response.json())
  ```

  ```javascript Node wrap theme={null}
  const response = await fetch(
    "https://api.agent37.com/v1/instances/ab12cd34ef",
    {
      method: "DELETE",
      headers: {
        "Authorization": "Bearer sk_live_..."
      },
    },
  );
  if (!response.ok) {
    throw new Error(await response.text());
  }
  console.log(await response.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 wrap theme={null}
  {
    "id": "ab12cd34ef",
    "deleted": true
  }
  ```
</ResponseExample>

Authenticate with `Authorization: Bearer sk_live_...` on `https://api.agent37.com`.

## Path parameters

<ParamField path="id" type="string" required>
  The instance id, returned when you create an instance.
</ParamField>

## What deletion does

`DELETE /v1/instances/{id}` returns `{ "id": "ab12cd34ef", "deleted": true }`. It acts once: a repeat delete returns `404`. Delete settles the final metered window and billing ends; nothing is ever prepaid, so there is nothing to refund.

<Warning>
  Delete is destructive: the instance's files, memory, sessions, and backups are gone, and no API call brings them back. A backup belongs to the instance, not to your workspace, and [restore](/docs/agents-api/instances/restore) only ever writes back in place, so [download](/docs/agents-api/files#download-a-folder) anything you want to keep first. A copy of the instance's data stays in backup storage for seven days after the delete and is then purged, so allow for that window in any promise to erase your own users' data. To pause work while keeping everything, `stop` it instead. A stopped instance bills its disk alone; delete is what ends billing entirely.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.