Edit Sandbox
- PATCH
- /workspaces
- /:workspace
- /sandboxes
- /:sandbox_id
Update sandbox configuration
Examples
Example: Update sandbox configuration
curl -X PATCH "https://api.buddy.works/workspaces/:workspace/sandboxes/:sandbox_id" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated sandbox name",
"resources": "4x8",
"first_boot_commands": "npm install && npm run build && npm test",
"apps": [
{
"command": "npm run start:prod"
}
],
"app_dir": "/app/dist",
"timeout": 7200,
"backup": "WEEKLY",
"snapshot_retention": {
"keep_for_days": 30
},
"tags": [
"production",
"api",
"nodejs",
"optimized"
],
"endpoints": [
{
"name": "api",
"endpoint": "3000",
"type": "HTTP",
"region": "EU",
"whitelist": [
"192.168.1.0/24",
"10.0.0.0/8",
"172.16.0.0/12"
],
"timeout": 45,
"http": {
"verify_certificate": true,
"compression": true,
"http2": true,
"log_requests": false,
"request_headers": {
"X-Forwarded-For": "updated.domain.pl",
"X-Real-IP": "127.0.0.1",
"Cache-Control": "no-cache"
},
"response_headers": {
"X-Frame-Options": "SAMEORIGIN",
"X-Content-Type-Options": "nosniff",
"Strict-Transport-Security": "max-age=31536000"
},
"login": "updated-api-user",
"password": "example-password",
"circuit_breaker": 3,
"serve_path": "/v2/api"
}
},
{
"name": "monitoring",
"endpoint": "9090",
"type": "HTTP",
"region": "EU",
"timeout": 15,
"http": {
"verify_certificate": false,
"compression": false,
"serve_path": "/metrics"
}
}
],
"variables": [
{
"key": "my_var",
"value": "some_value",
"type": "VAR",
"description": "a sandbox variable"
}
],
"permissions": {
"others": "DENIED",
"users": [
{
"id": 42,
"access_level": "MANAGE"
},
{
"id": 55,
"access_level": "READ_WRITE"
}
],
"groups": [
{
"id": 10,
"access_level": "READ_WRITE"
},
{
"id": 20,
"access_level": "READ_ONLY"
}
]
},
"pipelines_access_level": "DENIED",
"allowed_pipelines": [
{
"project": "my-project",
"pipeline": "deploy-pipeline",
"access_level": "USE_ONLY"
}
],
"note": "Notes about this resource",
"agent_note": "my_custom_field: note for agent"
}'Example: Update sandbox name only
curl -X PATCH "https://api.buddy.works/workspaces/:workspace/sandboxes/:sandbox_id" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "My Renamed Sandbox"
}'EXAMPLE RESPONSE
{
"url": "https://api.buddy.works/workspaces/my-workspace/sandboxes/sb-12345",
"html_url": "https://app.buddy.works/sandboxes/sb-12345",
"id": "sb-12345",
"identifier": "my-api-sandbox",
"name": "My API Development Sandbox",
"status": "RUNNING",
"source_sandbox_id": null,
"snapshot_id": null,
"os": "ubuntu:24.04",
"resources": "2x4",
"first_boot_commands": "npm install && npm run build",
"app_dir": "/app",
"apps": [
{
"id": "a1b2c3d",
"command": "npm start",
"app_status": "RUNNING"
}
],
"timeout": 3600,
"backup": "DAILY",
"snapshot_retention": {
"keep_last": 10
},
"tags": [
"development",
"api",
"nodejs"
],
"boot_logs": [
"Starting sandbox...",
"Installing dependencies...",
"npm install completed successfully",
"Building application...",
"Application ready on port 3000"
],
"setup_status": "SUCCESS",
"endpoints": [
{
"name": "www",
"endpoint": "80",
"type": "HTTP",
"region": "EU",
"whitelist": [
"192.168.1.0/24"
],
"timeout": 30,
"active": true,
"target_latency": 12,
"http": {
"endpoint_url": "https://www-my-api-sandbox-proj1757492386363-my-workspace.eu-1.buddy.app",
"verify_certificate": true,
"compression": true,
"http2": true,
"log_requests": true,
"request_headers": {
"X-Forwarded-For": "wp.pl"
},
"response_headers": {
"X-Frame-Options": "DENY"
},
"circuit_breaker": 5,
"serve_path": "/api"
}
}
],
"project": {
"url": "https://api.buddy.works/workspaces/my-workspace/projects/proj1757492386363",
"html_url": "https://app.buddy.works/proj1757492386363",
"name": "proj1757492386363",
"display_name": "proj1757492386363",
"status": "ACTIVE"
},
"variables": [
{
"key": "my_var",
"value": "some_value",
"type": "VAR",
"description": "a sandbox variable"
}
],
"permissions": {
"others": "READ_ONLY",
"users": [
{
"id": 42,
"access_level": "READ_WRITE"
}
],
"groups": [
{
"id": 10,
"access_level": "READ_WRITE"
}
]
},
"pipelines_access_level": "DENIED",
"allowed_pipelines": [
{
"project": "my-project",
"pipeline": "deploy-pipeline",
"access_level": "USE_ONLY"
}
],
"note": "Notes about this resource",
"agent_note": "my_custom_field: note for agent"
}STATUS
200 OK