Skip to content
Docs

Stream command logs

GEThttps://api.vercel.com/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/logs
Streams the output of a command in real-time using newline-delimited JSON (ND-JSON). Each entry includes the output data and stream type. Stream types include stdout, stderr, and error (for stream failures).
https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/logs
const response = await fetch('https://api.vercel.com/v2/sandboxes/sessions/sessionId/cmd/cmdId/logs?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
{
"stream": "string",
"data": {
"code": "sandbox_stream_closed",
"message": "Sandbox stream was closed and is not accepting commands."
}
}
AuthorizationbearerToken

Default authentication mechanism

sessionIdstringRequired
The unique identifier of the session containing the command.
cmdIdstringRequired
The unique identifier of the command to stream logs for.
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Success
streamstringRequired
dataobjectRequired
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.
404Error
410Error
422Error
429Error
500Error