---
title: "List Deployment Files"
method: GET
path: "/v6/deployments/{id}/files"
tags: ["deployments"]
---

# List Deployment Files

`GET /v6/deployments/{id}/files`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v6/deployments/{id}/files`
- Auth: HTTP bearer

Allows to retrieve the file structure of the source code of a deployment by supplying the deployment unique identifier. If the deployment was created with the Vercel CLI or the API directly with the `files` key, it will have a file tree that can be retrievable.

## Path parameters

- `id` string, required: The unique deployment identifier

## Query parameters

- `teamId` string
- `slug` string

## Response `200`

Retrieved the file tree successfully

- FileTree[]
  - `children` FileTree[]: The list of children files of the directory (only valid for the `directory` type)
  - `contentType` string: The content-type of the file (only valid for the `file` type)
  - `mode` number, required: The file "mode" indicating file type and permissions.
  - `name` string, required: The name of the file tree entry
  - `type` 'directory' | 'file' | 'invalid' | 'lambda' | 'middleware' | 'symlink', required: String indicating the type of file tree entry.
  - `uid` string: The unique identifier of the file (only valid for the `file` type)

## Other responses

- `400`: One of the provided values in the request query is invalid.
- `401`: The request is not authorized.
- `403`: You do not have permission to access this resource.
- `404`: File tree not found Deployment not found
- `410`

## Changes

- **2026-07-21** `2ae10ee9d21c`: 1 info
  - added the non-success response with the status `410`
- **2025-11-28** `45991e5c8b6d`: 1 warning
  - removed the optional property `items/symlink` from the response with the `200` status
- **2025-03-19** `37b482c58c92`: 2 info
  - added the new optional `query` request parameter `slug`
  - added the non-success response with the status `401`
- **2022-12-06** `8eb562567170`: 1 warning
  - added the new `middleware` enum value to the `items/type` response property for the response status `200`

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v6/deployments/:id/files/get.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
