Skip to content
Docs

Get Deployment File Contents

GEThttps://api.vercel.com/v8/deployments/{id}/files/{fileId}
Allows to retrieve the content of a file by supplying the file identifier and the deployment unique identifier. The response body will contain a JSON response containing the contents of the file encoded as base64.
https://api.vercel.com/v8/deployments/{id}/files/{fileId}
const response = await fetch('https://api.vercel.com/v8/deployments/id/files/fileId?path=string&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
{}
AuthorizationbearerToken

Default authentication mechanism

idstringRequired
The unique deployment identifier
fileIdstringRequired
The unique file identifier
pathstringOptional
Path to the file to fetch (only for Git deployments)
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
400One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404File not found Deployment not found
410Invalid API version.