Add Database to Stack
curl --request POST \
--url https://api.vertracloud.app/v1/stacks/{stack_id}/databases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"name": "<string>",
"ram": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', name: '<string>', ram: 123})
};
fetch('https://api.vertracloud.app/v1/stacks/{stack_id}/databases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vertracloud.app/v1/stacks/{stack_id}/databases"
payload = {
"type": "<string>",
"name": "<string>",
"ram": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/stacks/{stack_id}/databases"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"ram\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"response": {
"stack": {},
"database_id": "<string>",
"restart_required": true,
"apps_to_restart": [
"<string>"
]
}
}Databases
Add Database to Stack
Creates a database already inside a stack and connects it to the applications you choose.
POST
/
v1
/
stacks
/
{stack_id}
/
databases
Add Database to Stack
curl --request POST \
--url https://api.vertracloud.app/v1/stacks/{stack_id}/databases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"name": "<string>",
"ram": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', name: '<string>', ram: 123})
};
fetch('https://api.vertracloud.app/v1/stacks/{stack_id}/databases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vertracloud.app/v1/stacks/{stack_id}/databases"
payload = {
"type": "<string>",
"name": "<string>",
"ram": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/stacks/{stack_id}/databases"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"ram\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"response": {
"stack": {},
"database_id": "<string>",
"restart_required": true,
"apps_to_restart": [
"<string>"
]
}
}Creates a database inside the stack and connects it to the applications you list. The database counts against your plan like any other, with the same limits as Create Database. Needs the
stacks:write scope when called with an API key.
The same body works on POST https://api.vertracloud.app/v1/apps/{id}/stack/databases, which starts from an application. When that application is not in a stack, the call also creates the stack, named by stack_name.
string
required
The stack ID. On
/v1/apps/{id}/stack/databases, the path has the application ID instead.string
The workspace the stack belongs to, when you act on it as the workspace owner.
string
required
The database engine.
string
required
The database name.
integer
required
Memory in MB.
string
The engine version.
string | null
Optional description.
object[]
The applications to connect it to. Each item has
app_id and an optional env_map (see Create Stack Connection).string
Only for
POST /v1/apps/{id}/stack/databases on an application that is not in a stack: the name of the stack that is created.Response
object
Errors
| Status | Code | When |
|---|---|---|
| 403 | MAX_DATABASES_REACHED | The plan’s database limit was reached. |
| 403 | INSUFFICIENT_MEMORY | Not enough free memory in the plan for the database. |
| 400 | INVALID_DATABASE_VERSION | The version does not exist for the engine. |
| 409 | STACK_MEMBER_CONFLICT | The application is already in another stack. |
| 403 | WORKSPACE_OWNER_ONLY | You are a workspace member, not the owner. |
| 404 | STACK_NOT_FOUND | The stack does not exist or belongs to another account. |
Last modified on October 28, 2026