https://pulumi.com logo
#automation-api
Title
# automation-api
f

full-dress-10026

06/10/2023, 8:01 PM
I’m taking a look at creating a deployment via the rest api. It mentions a stack must exist prior to creating the deployment. Reasonable. However, looking at the regular rest api for stacks, I do not see any way to create a stack via the rest api. Is this actually the case? So even using the deployment api would still require wrapping the cli to create a stack?
l

lemon-agent-27707

06/10/2023, 9:17 PM
Ah, that is a gap in our documentation. There is indeed a REST API for creating a stack it is just missing from the docs. I opened a bug so we can backfill the docs. In the meantime, the API is:
Copy code
POST /api/stacks/{organization}/{project}
And here are the types for the payload: https://github.com/pulumi/pulumi/blob/master/sdk/go/common/apitype/stacks.go#L45-L54 A post body along these lines is the minimum:
Copy code
{
  "stackName": "yourStackName"
}
f

full-dress-10026

06/10/2023, 9:18 PM
Ooo lemme try. Thank you!!
Booyah - it worked