Create an environment
const url = 'https://api.global.stillbox.example/v1/environments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","spec":{"repositories":[{"url":"example","branch":"example","path":"example","credential":"example"}],"variables":{"additionalProperty":"example"},"setup_script":"example","mcp_servers":[{"name":"example","url":"example","headers":{"additionalProperty":"example"},"command":"example","args":["example"],"env":{"additionalProperty":"example"}}],"house_rules":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.global.stillbox.example/v1/environments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "spec": { "repositories": [ { "url": "example", "branch": "example", "path": "example", "credential": "example" } ], "variables": { "additionalProperty": "example" }, "setup_script": "example", "mcp_servers": [ { "name": "example", "url": "example", "headers": { "additionalProperty": "example" }, "command": "example", "args": [ "example" ], "env": { "additionalProperty": "example" } } ], "house_rules": "example" } }'What every sandbox made from it starts with. Its secrets are set separately.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
An https address, such as https://github.com/acme/api.
The folder in the home folder; the repository’s name by default.
The name of one of the environment’s secrets, for a private repository.
Non-secret variables, NAME to value (up to 100).
object
A shell script run once in each new sandbox, after the repositories are cloned.
A remote server (url, with headers) or a local one (command, with args and env). Values may use ${SECRET_NAME}.
object
object
object
Instructions for the agents, in Markdown.
Example generated
{ "name": "example", "spec": { "repositories": [ { "url": "example", "branch": "example", "path": "example", "credential": "example" } ], "variables": { "additionalProperty": "example" }, "setup_script": "example", "mcp_servers": [ { "name": "example", "url": "example", "headers": { "additionalProperty": "example" }, "command": "example", "args": [ "example" ], "env": { "additionalProperty": "example" } } ], "house_rules": "example" }}Responses
Section titled “Responses”The new environment, at version 1
object
The current version, which new sandboxes get.
object
object
An https address, such as https://github.com/acme/api.
The folder in the home folder; the repository’s name by default.
The name of one of the environment’s secrets, for a private repository.
Non-secret variables, NAME to value (up to 100).
object
A shell script run once in each new sandbox, after the repositories are cloned.
A remote server (url, with headers) or a local one (command, with args and env). Values may use ${SECRET_NAME}.
object
object
object
Instructions for the agents, in Markdown.
object
Where the credential broker may swap the placeholder for the value.
The value’s last characters, to recognize it.
Example
{ "secrets": [ { "mode": "placeholder" } ]}The request is invalid
object
Example
{ "code": "not_found"}The API key is missing or invalid
object
Example
{ "code": "not_found"}Only an owner can do this (owner_only), or the invitation is for another address (not_invited)
object
Example
{ "code": "not_found"}