Write files
POST
https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/fs/writeUploads and extracts files to a session's filesystem. Files must be uploaded as a gzipped tarball (
.tar.gz) with the Content-Type header set to application/gzip. The tarball contents are extracted to the session's working directory, or to a custom directory specified via the x-cwd header.https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/fs/write
const response = await fetch('https://api.vercel.com/v2/sandboxes/sessions/sessionId/fs/write?teamId=string&slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', },});
const data = await response.json();console.log(data);Response
"value"AuthorizationbearerToken
Default authentication mechanism
200The files were successfully written to the session.
400One of the provided values in the request query is invalid.
One of the provided values in the headers is invalid
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error
422Error
429Error
500Error