> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
title: "Create an environment"
description: "Create a custom environment beyond the four defaults, for example a per-feature preview environment."
method: "POST"
endpoint: "/api/v1/environments"
order: 3
last_verified: 2026-07-27
---

<ApiEndpoint
  method="POST"
  endpoint="/api/v1/environments"
  description="Create a custom environment beyond the four defaults, for example a per-feature preview environment."
>
  <section>
    ### Body parameters

    <ApiAttribute name="name" type="string" description="The environment's name, e.g. qa." required={true} />
    <ApiAttribute name="project_id" type="string" description="The owning project's UUID." required={true} />
  </section>

  <section>
    ### Request example

    <MultiLanguageCodeBlock
      languages={["bash", "javascript"]}
      value={[
        {
          language: 'bash',
          code: `curl -X POST https://api.agnt5.com/api/v1/environments \\
  -H "X-API-KEY: {api_key}" \\
  -H "Content-Type: application/json" \\
  -d '{"name": "qa", "project_id": "b6f1a3e2-9c4d-4f7a-8e2b-1a2b3c4d5e6f"}'`
        },
        {
          language: 'javascript',
          code: `fetch('https://api.agnt5.com/api/v1/environments', {
  method: 'POST',
  headers: { 'X-API-KEY': apiKey, 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'qa', project_id: projectId })
})`
        }
      ]}
    />
  </section>
</ApiEndpoint>
