Skip to main content

Stage Env

POST /v1/vms/{vm_id}/stage-env

Set secret environment variables in one of your running VMs. Send up to 16 entries of env_name and value per call (64 names per VM in total); new shells and the VM's running terminal sessions see them. The values are not returned or logged: the response lists only the names staged, in staged. Guest tokens may call this for their own VM.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
vm_idpathstringYes
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

application/json​

Resolved schema:

{
"properties": {
"entries": {
"items": {
"properties": {
"env_name": {
"type": "string",
"title": "Env Name"
},
"value": {
"type": "string",
"title": "Value"
}
},
"type": "object",
"required": [
"env_name",
"value"
],
"title": "StageEnvEntry"
},
"type": "array",
"title": "Entries"
}
},
"type": "object",
"required": [
"entries"
],
"title": "StageEnvRequest"
}

Field details:

FieldTypeRequiredDescriptionConstraints
entriesarray<object>Yes
entries[]objectYes
entries[].env_namestringYes
entries[].valuestringYes

Responses​

200​

Successful Response

application/json​

Resolved schema:

{
"properties": {
"staged": {
"items": {
"type": "string"
},
"type": "array",
"title": "Staged"
}
},
"type": "object",
"required": [
"staged"
],
"title": "StageEnvResponse"
}

Field details:

FieldTypeRequiredDescriptionConstraints
stagedarray<string>Yes
staged[]stringYes

401​

No credentials, or the Bearer token, guest token or X-API-Key is invalid.

No response body.

403​

The account is disabled; or the VM belongs to another account.

No response body.

404​

VM not found.

No response body.

409​

The VM is not running.

No response body.

422​

Validation Error

application/json​

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo

502​

Staging the variables inside the VM failed.

No response body.

503​

Environment staging is temporarily unavailable, or the VM is temporarily unreachable. Retry later.

No response body.