---
title: Get Chat Files
description: Returns the source files for a chat.
product: Platform API
type: reference
prerequisites:
  - /docs/api/platform/quickstart
---

# Get Chat Files



<EndpointDisplay method="get" path="/chats/{chatId}/files" versionPrefix="/v2" />

## Usage [#usage]

<CustomCodeBlock languages="['TypeScript', 'cURL']" defaultLanguage="TypeScript">
  <CodeVariant
    language="TypeScript"
    title="TypeScript Example"
    code="`import { v0 } from 'v0-sdk'

const result = await v0.chats.getFiles({
  chatId: 'chat_abc123',
})

console.log(result)`"
  />

  <CodeVariant
    language="cURL"
    title="cURL Example"
    code="`curl -X GET &#x22;https://api.v0.dev/api/v2/chats/chat_abc123/files&#x22; \
  -H &#x22;Authorization: Bearer $V0_API_KEY&#x22; \
  -H &#x22;Content-Type: application/json&#x22;`"
  />
</CustomCodeBlock>

## API Signature [#api-signature]

### Request [#request]

#### Path Parameters [#path-parameters]

<APISignature
  parameters="[
  {
    &#x22;name&#x22;: &#x22;chatId&#x22;,
    &#x22;type&#x22;: &#x22;string&#x22;,
    &#x22;required&#x22;: true,
    &#x22;description&#x22;: &#x22;The unique identifier of the chat.&#x22;,
    &#x22;deprecated&#x22;: false
  }
]"
/>

### Response [#response]

<APISignature
  parameters="[
  {
    &#x22;name&#x22;: &#x22;files&#x22;,
    &#x22;type&#x22;: &#x22;object[]&#x22;,
    &#x22;required&#x22;: true,
    &#x22;description&#x22;: &#x22;All source files in the chat.&#x22;,
    &#x22;deprecated&#x22;: false,
    &#x22;arrayItems&#x22;: {
      &#x22;name&#x22;: &#x22;item&#x22;,
      &#x22;type&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: true,
      &#x22;description&#x22;: &#x22;A single source file in the chat.&#x22;,
      &#x22;deprecated&#x22;: false,
      &#x22;properties&#x22;: [
        {
          &#x22;name&#x22;: &#x22;path&#x22;,
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;description&#x22;: &#x22;Project-relative file path, e.g. \&#x22;app/page.tsx\&#x22;.&#x22;,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;content&#x22;,
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;description&#x22;: &#x22;Content of the file.&#x22;,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;encoding&#x22;,
          &#x22;type&#x22;: &#x22;'utf8' | 'base64'&#x22;,
          &#x22;required&#x22;: true,
          &#x22;description&#x22;: &#x22;How `content` is encoded. `utf8` for text files; `base64` for binary files.&#x22;,
          &#x22;deprecated&#x22;: false
        }
      ]
    }
  }
]"
/>
