From 6d9e19b4a869c2f2eb923f15b78a72f0a49fba22 Mon Sep 17 00:00:00 2001 From: Komal Date: Thu, 20 Jun 2024 10:37:08 -0700 Subject: [PATCH] Document the create stack API (#12085) * Document the create stack api * Fix parameter type Co-authored-by: Luke Hoban --------- Co-authored-by: Luke Hoban --- .../pulumi-cloud/cloud-rest-api/_index.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/content/docs/pulumi-cloud/cloud-rest-api/_index.md b/content/docs/pulumi-cloud/cloud-rest-api/_index.md index bd25a1cd1b9f..2ddde867a052 100644 --- a/content/docs/pulumi-cloud/cloud-rest-api/_index.md +++ b/content/docs/pulumi-cloud/cloud-rest-api/_index.md @@ -53,6 +53,34 @@ Content-Type: application/json ## Stacks +### Create Stack + +Creates a new stack in the Pulumi Cloud. If the project does not exist, it will also be created. + +``` +POST /api/stacks/{organization}/{project} +``` + +#### Parameters + +| Parameter | Type | In | Description | +|----------------|--------|------|--------------------------------------------------------------------------------------------------| +| `organization` | string | path | Organization name | +| `project` | string | path | Name of the project to create the stack under. If the project doesn't exist, it will be created. | +| `stackName` | string | body | Name of the stack being created. | + +#### Example + +```bash +curl \ + -H "Accept: application/vnd.pulumi+8" \ + -H "Content-Type: application/json" \ + -H "Authorization: token $PULUMI_ACCESS_TOKEN" \ + --request POST \ + --data '{"stackName":"{stackName}"}' \ + https://api.pulumi.com/api/stacks/{organization}/{project} +``` + ### List Stacks Lists stacks available to the authenticated user.