Contentstack introduces the Agentic Experience Platform | Press release
Contentstack introduces the Agentic Experience Platform | Press release
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs
  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing
  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases
  • Academy
  • Docs
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP
  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support
  • Overview
  • Find a partner
  • Login
  • About us
  • News
  • Customer support portal
  • Contact
  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.

AI Assistant

Ask a question below...

infoAI responses may contain mistakes.
/
  1. Home
  2. APIs
  3. Launch API
  4. Environments

Environments

markdownView as Markdown

Launch environments help you deploy and manage different versions of your project independently. Each environment is auto-deployed to a unique URL and can be customized to match your development workflow.

Get all Environments

GEThttps://launch-api.contentstack.com/projects/{project_uid}/environments

The Get all Environments request fetches the list of all environments in your project.

Hide Parameters

URL Parameters

project_uidrequiredstring

Enter the project_uid of the project where the environments belong.

Query Parameters

skipoptionalstring

The "skip" parameter will skip a specific number of environments in the output. For example, if there are 20 environments and you want to skip the first 2 to get only the last 12 in the response body, you need to specify "2" here.

limitoptionalstring

The "limit" parameter will return a specific number of environments (in between 0-100) in your response based on the value you provide. If there are 20 environments and you want to fetch only 10 environments, set the limit as 10.

Headers

authorizationoptionalstring

Use a bearer token to authenticate if you're not using the authtoken header. Format: Bearer . If provided, the organization_uid header isn't required.

authtokenoptionalstring

Use an authentication token if the Authorization header isn't provided. **Requires the organization_uid header.** When using authtoken authentication, you must explicitly provide the organization_uid header. The organization_uid cannot be derived from project_uid for Launch REST APIs.

x-cs-api-versionoptionalstring

Enter the API version. Default is 1.0

organization_uidoptionalstring

⚠️ **REQUIRED when using authtoken authentication** - you must explicitly provide this header. Optional with Authorization Bearer token (organization_uid can be derived from the token).

Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728293031323334353637
{
  "pagination": {
    "count": 1,
    "limit": 10,
    "skip": 0
  },
  "environments": [
    {
      "uid": "690xxxxxxxxxxxxxx95f",
      "name": "Test Environment",
      "description": "It is a test environment.",
      "project": "691xxxxxxxxxxxxx9103",
      "gitBranch": "main",
      "buildCommand": "npx @11ty/eleventy",
      "outputDirectory": "./_site",
      "frameworkPreset": "OTHER",
      "environmentVariables": [
        {
          "key": "key1",
          "value": "value1"
        }
      ],
      "autoDeployOnPush": true,
      "nodeVersion": "22",
      "organizationUid": "bltxxxxxxxxxxxx3589",
      "createdAt": "2025-11-06T07:39:19.230Z",
      "updatedAt": "2025-11-06T07:39:53.582Z",
      "createdBy": "bltxxxxxxxxxxxx5783",
      "updatedBy": "bltxxxxxxxxxxxx5783",
      "hasLyticsEnabled": false,
      "isCachePrimingEnabled": false,
      "passwordProtection": {
        "isEnabled": false
      }
    }
  ]
}

Create an Environment

POSThttps://launch-api.contentstack.com/projects/{project_uid}/environments

Get an Environment

GEThttps://launch-api.contentstack.com/projects/{project_uid}/environments/{environment_uid}

Update an Environment

PUThttps://launch-api.contentstack.com/projects/{project_uid}/environments/{environment_uid}

Delete an Environment

DELETEhttps://launch-api.contentstack.com/projects/{project_uid}/environments/{environment_uid}

The Delete an Environment request lets you delete an existing environment in your project.

Revalidate CDN Cache

POSThttps://launch-api.contentstack.com/projects/{project_uid}/environments/{environment_uid}/revalidate-cdn-cache

The Create Environment request lets you create a new environment in your Launch project.

The examples below explain how to create environments using a Git Provider or the File Upload option.

Create an Environment by FileUpload:

{
  "name": "Test Environment",
  "outputDirectory": "./",
  "frameworkPreset": "OTHER",
  "description": "It is a test environment.",
  "uploadUid": "8dxxxxxx00",
  "buildCommand": "npm run build",
  "serverCommand": "npm run start",
  "environmentVariables": [
    {
      "key": "key1",
      "value": "value1"
    }
  ],
  "autoDeployOnPush": true
}

To create an environment using FileUpload, you must run the following APIs step-by-step:

1. Get a Signed Upload URL for an Environment.

2. Upload your ZIP file to Launch (The signed URL is valid only for 10 minutes).

Sample Request
123456789101112131415
{
  "name": "Test Environment",
  "outputDirectory": "./_site",
  "frameworkPreset": "OTHER",
  "description": "It is a test environment.",
  "gitBranch": "main",
  "buildCommand": "npx @11ty/eleventy",
  "environmentVariables": [
    {
      "key": "key1",
      "value": "value1"
    }
  ],
  "autoDeployOnPush": true
}
Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930
{
  "environment": {
    "uid": "690xxxxxxxxxxxxxx95f",
    "name": "Test Environment",
    "description": "It is a test environment.",
    "project": "691xxxxxxxxxxxxx9103",
    "gitBranch": "main",
    "buildCommand": "npx @11ty/eleventy",
    "outputDirectory": "./_site",
    "frameworkPreset": "OTHER",
    "environmentVariables": [
      {
        "key": "key1",
        "value": "value1"
      }
    ],
    "autoDeployOnPush": true,
    "nodeVersion": "22",
    "organizationUid": "bltxxxxxxxxxxxx3589",
    "createdAt": "2025-11-06T07:39:19.230Z",
    "updatedAt": "2025-11-06T07:39:53.582Z",
    "createdBy": "bltxxxxxxxxxxxx5783",
    "updatedBy": "bltxxxxxxxxxxxx5783",
    "hasLyticsEnabled": false,
    "isCachePrimingEnabled": false,
    "passwordProtection": {
      "isEnabled": false
    }
  }
}

The Get an Environment request fetches a specific environment from a project in Launch using the project_uid and environment_uid path parameters.

Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930
{
  "environment": {
    "uid": "690xxxxxxxxxxxxxx95f",
    "name": "Test Environment",
    "description": "It is a test environment.",
    "project": "691xxxxxxxxxxxxx9103",
    "gitBranch": "main",
    "buildCommand": "npx @11ty/eleventy",
    "outputDirectory": "./_site",
    "frameworkPreset": "OTHER",
    "environmentVariables": [
      {
        "key": "key1",
        "value": "value1"
      }
    ],
    "autoDeployOnPush": true,
    "nodeVersion": "22",
    "organizationUid": "bltxxxxxxxxxxxx3589",
    "createdAt": "2025-11-06T07:39:19.230Z",
    "updatedAt": "2025-11-06T07:39:53.582Z",
    "createdBy": "bltxxxxxxxxxxxx5783",
    "updatedBy": "bltxxxxxxxxxxxx5783",
    "hasLyticsEnabled": false,
    "isCachePrimingEnabled": false,
    "passwordProtection": {
      "isEnabled": false
    }
  }
}

The Update an Environment request lets you update an existing environment in your project.

Sample Request
1234567891011121314151617181920212223
{
  "name": "Test02",
  "outputDirectory": "./_site",
  "frameworkPreset": "OTHER",
  "description": "It is a dev environment 2.",
  "gitBranch": "dev",
  "buildCommand": "npx @11ty/eleventy",
  "autoDeployOnPush": true,
  "isStreamingEnabled": true,
  "isCachePrimingEnabled": true,
  "hasLyticsEnabled": true,
  "passwordProtection": {
    "isEnabled": true,
    "username": "test-user",
    "password": "test-password"
  },
  "environmentVariables": [
    {
      "key": "NEXT_PUBLIC_TEST_VARIABLE",
      "value": "TEST_VALUE"
    }
  ]
}
Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930
{
  "environment": {
    "uid": "690xxxxxxxxxxxxxx95f",
    "name": "Test02",
    "description": "It is a dev environment 2.",
    "project": "691xxxxxxxxxxxxx9103",
    "gitBranch": "main",
    "buildCommand": "npx @11ty/eleventy",
    "outputDirectory": "./_site",
    "frameworkPreset": "OTHER",
    "environmentVariables": [
      {
        "key": "NEXT_PUBLIC_TEST_VARIABLE",
        "value": "TEST_VALUE"
      }
    ],
    "autoDeployOnPush": true,
    "nodeVersion": "22",
    "organizationUid": "bltxxxxxxxxxxxx3589",
    "createdAt": "2025-11-06T07:39:19.230Z",
    "updatedAt": "2025-11-06T07:39:53.582Z",
    "createdBy": "bltxxxxxxxxxxxx5783",
    "updatedBy": "bltxxxxxxxxxxxx5783",
    "hasLyticsEnabled": true,
    "isCachePrimingEnabled": true,
    "passwordProtection": {
      "isEnabled": true
    }
  }
}
Sample Response
Status|204 No Content
1
Environment deleted successfully.

The Revalidate CDN Cache request lets you view the latest content after changes to your environment. The CDN checks for updates and fetches fresh content from the origin server if needed, without manually purging the cache. This helps maintain consistency across all domains sharing the same CDN configuration.

The examples below provide a detailed explanation on how to revalidate CDN cache with various options.

Purge cache of a specific path:

{
  "cachePath": {
    "path": "/blog",
    "isPrefix": false
  }
}

Use the cachePath object with isPrefix set to false to purge the cache for an exact path (e.g., /blog).

Purge cache by cache tags:

{
  "cacheTags": [
    "blogs"
  ]
}

Use cacheTags to purge the cache for routes tagged with specific cache tags.

Purge cache for specific hostnames:

{
  "hostnames": [
    "test.contentstackapps.com"
  ]
}

Use hostnames to purge the cache for specific hostnames.

Sample Request
123456
{
  "cachePath": {
    "path": "/blog",
    "isPrefix": true
  }
}
Sample Response
Status|200 OK
123
{
  "message": "The CDN cache revalidation task has been initiated."
}
Hide Parameters

URL Parameters

project_uidrequiredstring

Enter the project_uid of the project where you want to create the environment.

Headers

authorizationoptionalstring

Use a bearer token to authenticate if you're not using the authtoken header. Format: Bearer . If provided, the organization_uid header isn't required.

authtokenoptionalstring

Use an authentication token if the Authorization header isn't provided. **Requires the organization_uid header.** When using authtoken authentication, you must explicitly provide the organization_uid header. The organization_uid cannot be derived from project_uid for Launch REST APIs.

x-cs-api-versionoptionalstring

Enter the API version. Default is 1.0

organization_uidoptionalstring

⚠️ **REQUIRED when using authtoken authentication** - you must explicitly provide this header. Optional with Authorization Bearer token (organization_uid can be derived from the token).

Hide Parameters

URL Parameters

environment_uidrequiredstring

Enter the environment_uid of the environment.

project_uidrequiredstring

Enter the project_uid of the project where the environments belong.

Headers

authorizationoptionalstring

Use a bearer token to authenticate if you're not using the authtoken header. Format: Bearer . If provided, the organization_uid header isn't required.

authtokenoptionalstring

Use an authentication token if the Authorization header isn't provided. **Requires the organization_uid header.** When using authtoken authentication, you must explicitly provide the organization_uid header. The organization_uid cannot be derived from project_uid for Launch REST APIs.

x-cs-api-versionoptionalstring

Enter the API version. Default is 1.0

organization_uidoptionalstring

⚠️ **REQUIRED when using authtoken authentication** - you must explicitly provide this header. Optional with Authorization Bearer token (organization_uid can be derived from the token).

Hide Parameters

URL Parameters

environment_uidrequiredstring

Enter the environment_uid of the environment that must be updated.

project_uidrequiredstring

Enter the project_uid of the project where the environments belong.

Headers

authorizationoptionalstring

Use a bearer token to authenticate if you're not using the authtoken header. Format: Bearer . If provided, the organization_uid header isn't required.

authtokenoptionalstring

Use an authentication token if the Authorization header isn't provided. **Requires the organization_uid header.** When using authtoken authentication, you must explicitly provide the organization_uid header. The organization_uid cannot be derived from project_uid for Launch REST APIs.

x-cs-api-versionoptionalstring

Enter the API version. Default is 1.0

organization_uidoptionalstring

⚠️ **REQUIRED when using authtoken authentication** - you must explicitly provide this header. Optional with Authorization Bearer token (organization_uid can be derived from the token).

Hide Parameters

URL Parameters

environment_uidrequiredstring

Enter the environment_uid of the environment that must be deleted.

project_uidrequiredstring

Enter the project_uid of the project where the environments belong.

Headers

authorizationoptionalstring

Use a bearer token to authenticate if you're not using the authtoken header. Format: Bearer . If provided, the organization_uid header isn't required.

authtokenoptionalstring

Use an authentication token if the Authorization header isn't provided. **Requires the organization_uid header.** When using authtoken authentication, you must explicitly provide the organization_uid header. The organization_uid cannot be derived from project_uid for Launch REST APIs.

x-cs-api-versionoptionalstring

Enter the API version. Default is 1.0

organization_uidoptionalstring

⚠️ **REQUIRED when using authtoken authentication** - you must explicitly provide this header. Optional with Authorization Bearer token (organization_uid can be derived from the token).

Hide Parameters

URL Parameters

environment_uidrequiredstring

Enter the environment_uid of the environment.

project_uidrequiredstring

Enter the project_uid of the project where the environments belong.

Headers

authorizationoptionalstring

Use a bearer token to authenticate if you're not using the authtoken header. Format: Bearer . If provided, the organization_uid header isn't required.

authtokenoptionalstring

Use an authentication token if the Authorization header isn't provided. **Requires the organization_uid header.** When using authtoken authentication, you must explicitly provide the organization_uid header. The organization_uid cannot be derived from project_uid for Launch REST APIs.

x-cs-api-versionoptionalstring

Enter the API version. Default is 1.0

organization_uidoptionalstring

⚠️ **REQUIRED when using authtoken authentication** - you must explicitly provide this header. Optional with Authorization Bearer token (organization_uid can be derived from the token).