Databases are created first and variables applied last, so a reference to something in the same call resolves. A call takes at most ten resources.
curl -s -X POST https://app.ridgelinehost.com/api/v1/stacks \
-H "Authorization: Bearer $RIDGELINE_TOKEN" \
-H "content-type: application/json" \
-d '{
"resources": [
{ "name": "postgres", "source": "database" },
{ "name": "cache", "source": "database", "engine": "redis" },
{ "name": "web", "source": "repo",
"repoUrl": "https://github.com/you/app", "branch": "main",
"variables": { "STRIPE_KEY": "sk_live_…" } },
{ "name": "worker", "source": "repo",
"repoUrl": "https://github.com/you/app", "branch": "main",
"http": false,
"startCommand": "sh -c \"npm run migrate && npm run start:worker\"" }
]
}'That returns each resource with its url, and 207 (not 201) if some
of them failed — with a failed[] saying which and why.