Write to command stdin
Changed onWrites data to the stdin of a running command, and optionally closes it. The command must have been started with attachStdin set to true. Writes are applied in the order they are received. Send them one at a time to keep the data in order. A write returns once the command has accepted the data, and fails with a 504 after 30 seconds if the command is not reading stdin. Each write counts against the sandbox control plane rate limit, so batch small writes where possible. Set offset to the position in stdin where data starts to make a request safe to resend, for example after a 502 or 504: bytes the command has already received are skipped, and an offset past them fails with a 409. The response returns bytesWritten, the total written so far, and a 504 includes it in the error when the sandbox reports it. A request with no data and no close writes nothing and returns it.
Request
- Base URL: https://api.vercel.com
- URL: https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/stdin
- Auth: HTTP bearer
Path parameters
The unique identifier of the command to write to.
The unique identifier of the session containing the command.
Query parameters
The Team identifier to perform the request on behalf of.
The Team slug to perform the request on behalf of.
Request body
Example request
{
"data": "aGVsbG8K"
}Response
The data was written to the command's stdin.
Example response
{
"command": {
"args": [
"run",
"build"
],
"cwd": "/vercel/sandbox",
"durationMs": 1234,
"id": "cmd_123a6c5209bc3778245d011443644c8d27dc2c50",
"name": "npm",
"sessionId": "sbx_123a6c5209bc3778245d011443644c8d27dc2c50",
"startedAt": 1673123456789
}
}Changes
- info
removed the non-success response with the status
- info
- info
endpoint added
- info