---
title: Fork Chat
description: Creates a new chat fork (duplicate) from a specific version within an existing chat.
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).

Creates a new chat fork (duplicate) from a specific version within an existing chat.

#### `POST /v1/chats/{chatId}/fork`

> `v0-auto` is deprecated. Requests using it are handled as `v0-pro`. Use `v0-pro` for new integrations.

> `Fork Chat` only supports chats created through v0 API v1. To duplicate a chat created in v0 web or v0 API v2, use [Duplicate Chat](/docs/api/v2/reference/chats/duplicate-chat).

## Usage

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

const result = await v0.chats.fork({
  chatId: '123',
})

console.log(result)
```

```bash
curl -X POST https://api.v0.dev/v1/chats/123/fork   -H "Authorization: Bearer $V0_API_KEY"   -H "Content-Type: application/json"   -d '{
    "chatId": "123"
  }'
```

## API Signature

### Request

#### Path Parameters

- `chatId: string` The unique identifier of the chat to fork. Provided as a path parameter.

#### Body

- `versionId?: string` The identifier of the specific chat version to fork from. If omitted, the latest version will be used.
- `privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'` Determines the privacy setting of the forked chat. This can control whether the chat is visible only to the user, to team members, or is public.

### Response

- `id: string` A unique identifier for the chat.
- `object: 'chat'` Fixed value identifying this object as a chat.
- `shareable: boolean` **Deprecated.** Deprecated: Use the `privacy` field instead. A chat is shareable when privacy is public or unlisted.
- `privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'` Defines the visibility of the chat—private, team-only, or public.
- `name?: string` An optional name assigned to the chat by the user.
- `title?: string` **Deprecated.** Deprecated title field preserved for backward compatibility.
- `createdAt: string` The ISO timestamp representing when the chat was created.
- `updatedAt?: string` The ISO timestamp of the last update to the chat.
- `favorite: boolean` Indicates whether the chat is marked as a favorite.
- `authorId: string` The ID of the user who created the chat.
- `projectId?: string` **Deprecated.** Optional ID of the v0 project associated with this chat.
- `vercelProjectId?: string` Optional ID of the linked Vercel project, if connected.
- `webUrl: string` Web URL to view this chat in the browser.
- `apiUrl: string` API URL to access this chat via the API.
- `latestVersion?: object` Full details of the most recent generated version, if available.
  - `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 were generated or included in this version.
    - `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.
- `url: string` **Deprecated.** The canonical URL to access this chat.
- `messages: object[]` All messages exchanged in the chat, including user and assistant entries.
  - `item: object` Summary of a single message within a chat, including role, content, type, timestamp, and API URL.
    - `id: string` A unique identifier for the message.
    - `object: 'message'` Fixed value identifying this object as a message.
    - `content: string` The main text content of the message.
    - `experimental_content?: any[] | any[][]` The parsed content of the message as an array structure containing AST nodes. This is an experimental field that may change.
      - `item: any[] | any[]`
    - `createdAt: string` The ISO timestamp representing when the message was created.
    - `updatedAt?: string` The ISO timestamp representing when the message was last updated.
    - `type: 'message' | 'forked-block' | 'forked-chat' | 'open-in-v0' | 'refinement' | 'added-environment-variables' | 'added-integration' | 'deleted-file' | 'moved-file' | 'renamed-file' | 'edited-file' | 'replace-src' | 'reverted-block' | 'fix-with-v0' | 'auto-fix-with-v0' | 'sync-git' | 'pull-changes' | 'fix-cve' | 'answered-questions'` Indicates the format or category of the message, such as plain text or code.
    - `role: 'user' | 'assistant'` Specifies whether the message was sent by the user or the assistant.
    - `finishReason?: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' | 'unknown'` The reason why the message generation finished.
    - `apiUrl: string` API URL to access this message via the API.
    - `authorId: string | null` The ID of the user who sent the message.
    - `parentId?: string | null` The ID of the parent message.
    - `attachments?: object[]`
      - `item: object`
        - `url: string` The URL where the attachment file can be accessed.
        - `name?: string` The original filename of the attachment.
        - `contentType?: string` The MIME type of the attachment file (e.g., image/png, application/pdf).
        - `size: number` The size of the attachment file in bytes.
        - `content?: string` The base64-encoded content of the attachment file, if available.
        - `type?: 'screenshot' | 'figma' | 'zip'` Optional v0-specific attachment type for enhanced processing.
- `files?: object[]` Optional array of files associated with the chat context.
  - `item: object`
    - `lang: string` Programming language used in the file (e.g., JavaScript, Python).
    - `meta: object` A key-value map of metadata associated with the file (e.g., path, type).
    - `source: string` The origin or identifier of the file source (e.g., path or upload label).
- `demo?: string` **Deprecated.** Deprecated demo URL used for previewing the chat result.
- `text: string` The main user prompt or instruction that started the chat.
- `modelConfiguration?: object` The configuration used to generate responses in this chat.
  - `modelId?: 'v0-auto' | 'v0-mini' | 'v0-pro' | 'v0-max' | 'v0-max-fast' | string` Model to use for the generation. `v0-auto` is deprecated and falls back to `v0-pro`.
  - `imageGenerations?: boolean` Enables image generations to generate up to 5 images per version.
  - `thinking?: boolean` Enables thinking to generate a response in multiple steps.
- `permissions: object`
  - `write: boolean` If true, the user has write access to the chat.
- `metadata: Record<string, string>` Arbitrary key-value data associated with this chat.

---

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)