# Delete one source file

Source: https://docs.vlayers.ai/reference/hosting/delete-agent-source-file

`DELETE /v1/agents/{id}/source/file` · scope `workspace:write`

Deletes one file of the working copy. Snapshots keep their own copy of it. Deleting a file that is not there succeeds with `deleted: false`.

Requires an API key with the `workspace:write` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | The agent id. Example: `"0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78"` |
| `path` | query | string | yes | The file to delete. Example: `"src/old.ts"` |

## Request

cURL:

```bash
curl -X DELETE "https://api.vlayers.ai/v1/agents/$AGENT_ID/source/file?path=src/old.ts" \
  -H "Authorization: Bearer $VOICELAYER_API_KEY"
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { deleted } = await voicelayer.hosting.deleteAgentSourceFile('<agent-id>', {
  path: 'src/old.ts'
});
console.log(deleted);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.hosting.delete_agent_source_file("<agent-id>", path="src/old.ts")
print(result.deleted)
```

## Response `200`

```json
{
  "deleted": true,
  "totalBytes": 1204
}
```
