curl -X POST "https://api.nevia.cloud/v1/computers/01d4cnjk3xg90y576w8y6t4gdwm/exec" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"argv": [
"sh",
"-c",
"echo hello"
]
}'{
"result": {
"exit_code": 0,
"signal": 0,
"stdout": "hello\n",
"stderr": ""
},
"operations": [
"01d4cnjm89yk0r3xtv80dy0x7by"
]
}Authorization
bearerAuth Send the token in the Authorization: Bearer <token> header. See Authenticate.
In: header
Path Parameters
Computer id: 27 lowercase letters and digits.
^[A-Za-z0-9_-]{1,64}$Header Parameters
text/event-stream for SSE output, else JSON
Optional retry key, kept 24 hours
1 <= length <= 255Request Body
application/json
Run a command in the primary container
Behavior
The command gets the computer's stored env, with env over it. Values resolve at call time, so secrets and variables take their current values.
There is no shell, cwd or timeout. Closing the request does not stop the process. An abandoned command runs until it exits.
Each argv item is at most 128 KiB of UTF-8, and the whole array at most 256 KiB as JSON.
With Accept: text/event-stream, stdout and stderr events carry a UTF-8 chunk as a JSON string, and exit carries {exit_code, signal}. A failure after the stream opens arrives as an error event: the error envelope plus status, the HTTP status it would have had.
The API accepts Idempotency-Key but does not replay it. Every call runs the command.
Response
application/jsonThe exit code, signal and buffered output, or an SSE stream.