---
title: Delete Chat Version Files
description: Deletes source files from a specific chat version (block). Files are removed from the version and a new source version is created.
docs_index: /docs/llms.txt
lastUpdated: 2026-10-23
product: v0 API
type: reference
prerequisites:
  - /docs/api/v1/quickstart
---

> For an index of all documentation, see [/docs/llms.txt](/docs/llms.txt).

Deletes source files from a specific chat version (block). Files are removed from the version and a new source version is created.

#### `POST /v1/chats/{chatId}/versions/{versionId}/files/delete`

## Usage

```typescript
import { v0 } from 'v0-sdk'

const result = await v0.chats.deleteVersionFiles({
  chatId: 'chat_abc123',
  versionId: 'version_xyz789',
  filePaths: ['components/old-component.tsx', 'lib/unused-utils.ts'],
})

console.log(result)
```

```bash
curl -X POST https://api.v0.dev/chats/{chatId}/versions/{versionId}/files/delete \
  -H "Authorization: Bearer $V0_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filePaths": ["components/old-component.tsx", "lib/unused-utils.ts"]}'
```

## API Signature

### Request

#### Path Parameters

- `chatId: string` The unique identifier of the chat containing the version to delete files from.
- `versionId: string` The unique identifier of the version (block) to delete files from.

#### Body

- `filePaths: string[]` Array of file paths to delete (e.g., \["components/test.tsx", "lib/utils.ts"]). Must contain at least one file path.

### Response

- `id: string` A unique identifier for the version.
- `object: 'version'` Fixed value identifying this object as a version.
- `status: 'pending' | 'completed' | 'failed'` The current status of the version generation process.
- `demoUrl?: string` Optional URL for previewing the generated output.
- `screenshotUrl?: string` An authenticated URL to retrieve a screenshot of this version. Fetching this URL requires the same Authorization: Bearer header as all other API calls — it cannot be used directly as an `<img>` `src`. To display it in a browser, proxy the request server-side and forward the Authorization header. Append `?ignoreCache=1` to bypass the one-week screenshot cache.
- `createdAt: string` The date and time when the version was created, in ISO 8601 format.
- `updatedAt?: string` The date and time when the version was last updated, in ISO 8601 format.
- `files: object[]` A list of files that remain in this version after deletion.
  - `item: object` Detailed representation of a file, including its content and lock status.
    - `object: 'file'` Fixed value identifying this object as a file.
    - `name: string` The name of the file, including its extension.
    - `content: string` The full contents of the file as a raw string.
    - `locked: boolean` Whether the file is locked to prevent AI from overwriting it during new version generation.

---

For a semantic overview of all documentation, see [/docs/sitemap.md](/docs/sitemap.md)

For an index of all available documentation, see [/docs/llms.txt](/docs/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/docs/agents.md](/docs/agents.md)