Skip to content

Create an environment

POST
/environments
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.

Media typeapplication/json
object
name
required
string
<= 100 characters
spec
object
repositories
Array<object>
<= 10 items
object
url
required

An https address, such as https://github.com/acme/api.

string
branch
string
path

The folder in the home folder; the repository’s name by default.

string
credential

The name of one of the environment’s secrets, for a private repository.

string
variables

Non-secret variables, NAME to value (up to 100).

object
key
additional properties
string
setup_script

A shell script run once in each new sandbox, after the repositories are cloned.

string
<= 65536 characters
mcp_servers
Array<object>
<= 20 items

A remote server (url, with headers) or a local one (command, with args and env). Values may use ${SECRET_NAME}.

object
name
required
string
url
string
headers
object
key
additional properties
string
command
string
args
Array<string>
env
object
key
additional properties
string
house_rules

Instructions for the agents, in Markdown.

string
<= 65536 characters

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"
}
}

The new environment, at version 1

Media typeapplication/json
object
id
required
string
name
required
string
version
required

The current version, which new sandboxes get.

integer
spec
required
object
repositories
Array<object>
<= 10 items
object
url
required

An https address, such as https://github.com/acme/api.

string
branch
string
path

The folder in the home folder; the repository’s name by default.

string
credential

The name of one of the environment’s secrets, for a private repository.

string
variables

Non-secret variables, NAME to value (up to 100).

object
key
additional properties
string
setup_script

A shell script run once in each new sandbox, after the repositories are cloned.

string
<= 65536 characters
mcp_servers
Array<object>
<= 20 items

A remote server (url, with headers) or a local one (command, with args and env). Values may use ${SECRET_NAME}.

object
name
required
string
url
string
headers
object
key
additional properties
string
command
string
args
Array<string>
env
object
key
additional properties
string
house_rules

Instructions for the agents, in Markdown.

string
<= 65536 characters
secrets
required
Array<object>
object
name
required
string
mode
required
string
Allowed values: placeholder inside
hosts
required

Where the credential broker may swap the placeholder for the value.

Array<string>
hint
required

The value’s last characters, to recognize it.

string
updated_at
required
string format: date-time
created_by
string
created_at
required
string format: date-time
updated_at
required
string format: date-time

Example

{
"secrets": [
{
"mode": "placeholder"
}
]
}

The request is invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

The API key is missing or invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

Only an owner can do this (owner_only), or the invitation is for another address (not_invited)

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}