List Deployment Files | Vercel REST API

List Deployment Files

GET https://api.vercel.com/v6/deployments/{id}/files

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.

TypeScript Example

const response = await fetch('https://api.vercel.com/v6/deployments/id/files?teamId=string&slug=string', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);

Response

[
  {
    "children": [
      {}
    ],
    "contentType": "application/json",
    "mode": "123",
    "name": "my-file.json",
    "type": "file",
    "uid": "2d4aad419917f15b1146e9e03ddc9bb31747e4d0"
  }
]

Authentication

Authorization bearer Token - Default authentication mechanism

Path Parameters

Query Parameters

Response Codes

Related Vercel Documentation