curl -X POST "https://api.buddy.works/workspaces/:workspace/sandboxes" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "New sandbox",
"identifier": "new_sandbox",
"os": "ubuntu:24.04",
"resources": "2x4",
"first_boot_commands": "npm install && npm run build",
"apps": [
"npm start",
"npm run worker"
],
"app_dir": "/app",
"timeout": 3600,
"tags": [
"development",
"api",
"nodejs"
],
"endpoints": [
{
"name": "www",
"endpoint": "80",
"type": "HTTP",
"region": "EU",
"whitelist": [
"192.168.1.0/24",
"10.0.0.0/8"
],
"timeout": 30,
"http": {
"verify_certificate": true,
"compression": true,
"http2": true,
"log_requests": true,
"request_headers": {
"X-Forwarded-For": "wp.pl",
"X-Real-IP": "127.0.0.1"
},
"response_headers": {
"X-Frame-Options": "DENY",
"X-Content-Type-Options": "nosniff"
},
"login": "api-user",
"password": "secure-password-123",
"circuit_breaker": 5,
"serve_path": "/api"
}
},
{
"name": "secure_api",
"endpoint": "443",
"type": "TLS",
"region": "EU",
"timeout": 60,
"tls": {
"private_key": "-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----",
"certificate": "-----BEGIN CERTIFICATE----------END CERTIFICATE-----",
"ca_certificate": "-----BEGIN CERTIFICATE----------END CERTIFICATE-----",
"terminate_at": "REGION"
}
}
],
"variables": [
{
"key": "my_var",
"value": "some_value",
"type": "VAR",
"description": "a sandbox variable"
}
],
"permissions": {
"others": "READ_ONLY",
"users": [
{
"id": 42,
"access_level": "READ_WRITE"
},
{
"id": 100,
"access_level": "MANAGE"
}
],
"groups": [
{
"id": 10,
"access_level": "READ_WRITE"
}
]
}
}'
{
"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,
"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,
"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"
}
]
}
}
STATUS
201 Created