Skip to main content
Pulumi logo Pulumi logo
  1. Docs
  2. Reference
  3. REST API Docs
  4. Stack Tags

Stack Tags

    Stack Tags are key-value metadata attached to Pulumi stacks. They can be used for organization, filtering, and to store additional information about your stacks.

    Add Stack Tag

    POST /api/stacks/{orgName}/{projectName}/{stackName}/tags

    Creates a new tag on the specified stack. Tags are key-value metadata pairs that can be used for organization, filtering, and storing additional information about stacks. The request body must include both a tag name and value. Returns 400 if the tag name is invalid or the tag already exists. The ‘pulumi:’, ‘gitHub:’ and ‘vcs:’ name prefixes are reserved for built-in tags that Pulumi manages automatically: deploys refresh them from project metadata, so a value written directly is overwritten by the next update. In particular, a stack’s description is the ‘description’ field in the project’s Pulumi.yaml, surfaced as the ‘pulumi:description’ tag — set it by editing Pulumi.yaml rather than by creating the tag.

    Request Parameters

    • orgName string path required
      The organization name
    • projectName string path required
      The project name
    • stackName string path required
      The stack name

    Request Body

    Schema: StackTag
    • name enum required
      The tag key, which must conform to the stack tag naming rules.
      Values:
      pulumi:project — ProjectNameTag
      ProjectNameTag is a tag that represents the name of a project (coresponds to the name property of Pulumi.yaml).
      pulumi:runtime — ProjectRuntimeTag
      ProjectRuntimeTag is a tag that represents the runtime of a project (the runtime property of Pulumi.yaml).
      pulumi:description — ProjectDescriptionTag
      ProjectDescriptionTag is a tag that represents the description of a project (Pulumi.yaml’s description).
      pulumi:template — ProjectTemplateTag
      ProjectTemplateTag is a tag that represents the template that was used to create a project.
      vcs:owner — VCSOwnerNameTag
      VCSOwnerNameTag is a tag that represents the name of the owner on the cloud VCS that this stack may be associated with (inferred by the CLI based on git remote info).
      vcs:repo — VCSRepositoryNameTag
      VCSRepositoryNameTag is a tag that represents the name of a repository on the cloud VCS that this stack may be associated with (inferred by the CLI based on git remote info).
      vcs:kind — VCSRepositoryKindTag
      VCSRepositoryKindTag is a tag that represents the kind of the cloud VCS that this stack may be associated with (inferred by the CLI based on the git remote info).
      vcs:root — VCSRepositoryRootTag
      VCSRepositoryRootTag is a tag that represents the root directory of the repository on the cloud VCS that this stack may be associated with (pulled from git by the CLI)
    • value string required
      The tag value associated with this key.

    Responses

    204 No Content
    Errors: 400 Invalid tag name or tag already exists.

    Update Stack Tags

    PATCH /api/stacks/{orgName}/{projectName}/{stackName}/tags

    Replaces all tags on the specified stack with the tags provided in the request body. This is a wholesale replacement operation: any existing tags not included in the request will be removed. The request body is a JSON map of tag name-value pairs. Returns 400 if the operation would change the project name tag or if any tags are invalid. Tags with the built-in ‘pulumi:’, ‘gitHub:’ and ‘vcs:’ name prefixes are managed automatically by Pulumi and refreshed from project metadata on every deploy; include them unchanged in the replacement map rather than modifying them — a stack’s description comes from the ‘description’ field in the project’s Pulumi.yaml, not from a direct write of the ‘pulumi:description’ tag.

    Request Parameters

    • orgName string path required
      The organization name
    • projectName string path required
      The project name
    • stackName string path required
      The stack name

    Request Body

    Responses

    204 No Content
    Errors: 400 Cannot change project's name or tags are invalid

    Update Stack Tag

    PATCH /api/stacks/{orgName}/{projectName}/{stackName}/tags/{tagName}

    Updates the value of an existing tag on the specified stack. The tag is identified by its name in the URL path. Built-in tags (those automatically managed by the Pulumi CLI, such as project name tags) cannot be updated and will return a 400 error. Returns 404 if the specified tag does not exist on the stack.

    Request Parameters

    • orgName string path required
      The organization name
    • projectName string path required
      The project name
    • stackName string path required
      The stack name
    • tagName string path required
      The tag name

    Request Body

    Schema: StackTag
    • name enum required
      The tag key, which must conform to the stack tag naming rules.
      Values:
      pulumi:project — ProjectNameTag
      ProjectNameTag is a tag that represents the name of a project (coresponds to the name property of Pulumi.yaml).
      pulumi:runtime — ProjectRuntimeTag
      ProjectRuntimeTag is a tag that represents the runtime of a project (the runtime property of Pulumi.yaml).
      pulumi:description — ProjectDescriptionTag
      ProjectDescriptionTag is a tag that represents the description of a project (Pulumi.yaml’s description).
      pulumi:template — ProjectTemplateTag
      ProjectTemplateTag is a tag that represents the template that was used to create a project.
      vcs:owner — VCSOwnerNameTag
      VCSOwnerNameTag is a tag that represents the name of the owner on the cloud VCS that this stack may be associated with (inferred by the CLI based on git remote info).
      vcs:repo — VCSRepositoryNameTag
      VCSRepositoryNameTag is a tag that represents the name of a repository on the cloud VCS that this stack may be associated with (inferred by the CLI based on git remote info).
      vcs:kind — VCSRepositoryKindTag
      VCSRepositoryKindTag is a tag that represents the kind of the cloud VCS that this stack may be associated with (inferred by the CLI based on the git remote info).
      vcs:root — VCSRepositoryRootTag
      VCSRepositoryRootTag is a tag that represents the root directory of the repository on the cloud VCS that this stack may be associated with (pulled from git by the CLI)
    • value string required
      The tag value associated with this key.

    Responses

    204 No Content
    Errors: 400 built-in tags cannot be updated or invalid tag name 404 tag not found

    Delete Stack Tag

    DELETE /api/stacks/{orgName}/{projectName}/{stackName}/tags/{tagName}

    Removes a specific tag from the stack, identified by the tag name in the URL path. Built-in tags (those automatically managed by the Pulumi CLI) cannot be deleted and will return a 400 error. Returns 404 if the specified tag does not exist on the stack. Returns 204 with no content on success.

    Request Parameters

    • orgName string path required
      The organization name
    • projectName string path required
      The project name
    • stackName string path required
      The stack name
    • tagName string path required
      The tag name

    Responses

    204 No Content
    Errors: 400 built-in tags cannot be deleted 404 Tag not found

      The infrastructure as code platform for any cloud.