# Delete a workspace

`DELETE https://api.vidmoat.com/v1/workspaces/{id}`

- Scope: `projects.write`
- Cost: Free

Delete a workspace. The projects inside are KEPT and become unfiled; the response returns how many.

> **Note.** Deleting a folder never deletes work. `freed` in the response is the number of projects that came out of it.

### Path parameters

- `id` (string, required): The workspace id.

## Response

Returns `200`.

### Response fields

- `deleted` (boolean): Always `true`.
- `freed` (integer): How many projects were in it. They are not deleted: they move out of the workspace and stay yours.

## Errors

Besides the errors any request can get ([authentication](https://developer.vidmoat.com/developer/docs/authentication#when-a-request-is-refused), [rate limits](https://developer.vidmoat.com/developer/docs/rate-limits)):

| Status | Code | When |
| --- | --- | --- |
| 404 | [`not_found`](https://developer.vidmoat.com/developer/docs/errors#not_found) | No such workspace. |

## Request examples

```bash curl
curl -X DELETE https://api.vidmoat.com/v1/workspaces/$ID \
  -H "Authorization: Bearer $VIDMOAT_KEY"
```

```js Node
const ID = 'YOUR_PROJECT_ID';

const res = await fetch(`https://api.vidmoat.com/v1/workspaces/${ID}`, {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.VIDMOAT_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? `HTTP ${res.status}`);
console.log(data);
```

```python Python
import os
import requests

ID = "YOUR_PROJECT_ID"

res = requests.delete(
    f"https://api.vidmoat.com/v1/workspaces/{ID}",
    headers={"Authorization": f"Bearer {os.environ['VIDMOAT_KEY']}"},
    timeout=60,
)
res.raise_for_status()
print(res.json())
```

## Example response

```json
{ "deleted": true, "freed": 4 }
```

---

Source: https://developer.vidmoat.com/developer/docs/api/workspaces/delete-workspace
Previous: [Update a workspace](https://developer.vidmoat.com/developer/docs/api/workspaces/update-workspace.md)
Next: [File a project](https://developer.vidmoat.com/developer/docs/api/workspaces/set-project-workspace.md)
All documentation: https://developer.vidmoat.com/llms-full.txt
