Update many sandboxes
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
id: 'sbx_06d8k3m7q2v9x4b1n5c0e8f2ja',
name: 'agent-42',
labels: {project: 'web', agent: 'reviewer'},
stopAfterSeconds: 3600,
stopAt: '2026-11-16T12:00:00Z',
pinImage: true
}
]
})
};
fetch('https://vms.dev/api/v1/sandboxes/update-many', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://vms.dev/api/v1/sandboxes/update-many \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": "sbx_06d8k3m7q2v9x4b1n5c0e8f2ja",
"name": "agent-42",
"labels": {
"project": "web",
"agent": "reviewer"
},
"stopAfterSeconds": 3600,
"stopAt": "2026-11-16T12:00:00Z",
"pinImage": true
}
]
}
'import requests
url = "https://vms.dev/api/v1/sandboxes/update-many"
payload = { "items": [
{
"id": "sbx_06d8k3m7q2v9x4b1n5c0e8f2ja",
"name": "agent-42",
"labels": {
"project": "web",
"agent": "reviewer"
},
"stopAfterSeconds": 3600,
"stopAt": "2026-11-16T12:00:00Z",
"pinImage": True
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"succeeded": 0,
"failed": 0,
"message": "<string>",
"data": [
{
"index": 0,
"id": "<string>",
"error": "<string>"
}
]
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}Sandboxes
Update many sandboxes
Changes up to 500 sandboxes in one request. Give each item the id of a sandbox and the fields of an update, such as state: stopped to stop it. The API changes the items one after the other. It returns a result for each item, in the sequence of the items: the ID, and an error message if the change failed. Needs the sandboxes:write scope.
POST
/
v1
/
sandboxes
/
update-many
Update many sandboxes
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
id: 'sbx_06d8k3m7q2v9x4b1n5c0e8f2ja',
name: 'agent-42',
labels: {project: 'web', agent: 'reviewer'},
stopAfterSeconds: 3600,
stopAt: '2026-11-16T12:00:00Z',
pinImage: true
}
]
})
};
fetch('https://vms.dev/api/v1/sandboxes/update-many', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://vms.dev/api/v1/sandboxes/update-many \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": "sbx_06d8k3m7q2v9x4b1n5c0e8f2ja",
"name": "agent-42",
"labels": {
"project": "web",
"agent": "reviewer"
},
"stopAfterSeconds": 3600,
"stopAt": "2026-11-16T12:00:00Z",
"pinImage": true
}
]
}
'import requests
url = "https://vms.dev/api/v1/sandboxes/update-many"
payload = { "items": [
{
"id": "sbx_06d8k3m7q2v9x4b1n5c0e8f2ja",
"name": "agent-42",
"labels": {
"project": "web",
"agent": "reviewer"
},
"stopAfterSeconds": 3600,
"stopAt": "2026-11-16T12:00:00Z",
"pinImage": True
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"succeeded": 0,
"failed": 0,
"message": "<string>",
"data": [
{
"index": 0,
"id": "<string>",
"error": "<string>"
}
]
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}Authorizations
Body
application/json