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

# Delete Directory

> Delete a directory from an agent's workspace.

## Authentication

Requires JWT token or Platform API key.

<ParamField path="agentId" type="string" required>Agent UUID</ParamField>
<ParamField path="path" type="string" required>Directory path within the agent workspace (wildcard segment)</ParamField>
<ParamField body="recursive" type="boolean">Delete the directory and all its contents recursively</ParamField>

## Example Request

```bash theme={null}
curl -X DELETE "https://api.app.shinzo.ai/v1/agent/agt_abc123/filesystem/directories/workspace/data/exports?recursive=true" \
  -H "Authorization: Bearer <jwt_token>"
```

## Response

```json theme={null}
{
  "message": "Directory deleted successfully"
}
```

## Status Codes

| Code  | Description                                                 |
| ----- | ----------------------------------------------------------- |
| `200` | Directory deleted successfully                              |
| `400` | Directory is not empty and `recursive` is not set to `true` |
| `401` | Invalid authentication                                      |
| `403` | Access denied                                               |
| `404` | Agent or directory not found                                |
