Create and start a Docker stack
curl --request POST \
--url https://my.server.express/api/v1/cloud/{id}/apps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"compose": "<string>",
"image": "<string>",
"ports": [
"8080:80"
],
"volumes": [
"./data:/data"
],
"env": {},
"overwrite": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
compose: '<string>',
image: '<string>',
ports: ['8080:80'],
volumes: ['./data:/data'],
env: {},
overwrite: false
})
};
fetch('https://my.server.express/api/v1/cloud/{id}/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/cloud/{id}/apps"
payload = {
"name": "<string>",
"compose": "<string>",
"image": "<string>",
"ports": ["8080:80"],
"volumes": ["./data:/data"],
"env": {},
"overwrite": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Cloud
Create and start a Docker stack
Writes a compose file (and `.env` when `env` is given) to /opt/serverexpress/<name> on the VM and runs
`docker compose up -d`. Send raw `compose` text, or the simple form (`image`, `ports`, `volumes`, `env`) and we'll build
the compose file. Session auth only; needs the operate role. 409 if the stack exists and `overwrite` isn't set, or the
server isn't provisioned; 502 if the files were written but the stack failed to start.
POST
/
v1
/
cloud
/
{id}
/
apps
Create and start a Docker stack
curl --request POST \
--url https://my.server.express/api/v1/cloud/{id}/apps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"compose": "<string>",
"image": "<string>",
"ports": [
"8080:80"
],
"volumes": [
"./data:/data"
],
"env": {},
"overwrite": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
compose: '<string>',
image: '<string>',
ports: ['8080:80'],
volumes: ['./data:/data'],
env: {},
overwrite: false
})
};
fetch('https://my.server.express/api/v1/cloud/{id}/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/cloud/{id}/apps"
payload = {
"name": "<string>",
"compose": "<string>",
"image": "<string>",
"ports": ["8080:80"],
"volumes": ["./data:/data"],
"env": {},
"overwrite": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
Session access token (JWT) from POST /v1/auth/login or /v1/auth/refresh. A session satisfies every API scope.
Path Parameters
Service id of the cloud server.
Body
application/json
Stack name; lowercased before validation.
Pattern:
^[a-z0-9][a-z0-9-]{0,62}$Raw compose YAML. Takes precedence over the simple form and must have a services section.
Maximum string length:
60000Simple form — container image reference.
Environment variables; keys must match ^[A-Za-z_][A-Za-z0-9_]*$.
Show child attributes
Show child attributes
Replace an existing stack of the same name.
Response
Stack created and started.