> ## Documentation Index
> Fetch the complete documentation index at: https://docs.korve.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create

> Create a custom environment. The slug is derived from the name when omitted; "production" and "preview" are reserved for the implicit environments.



## OpenAPI

````yaml /openapi.json post /v1/orgs/{orgId}/projects/{projectId}/environments
openapi: 3.1.0
info:
  title: Korve API
  version: 0.1.0
  description: >-
    Typed control plane for deploying applications and explicitly provisioning
    their managed infrastructure.
servers:
  - url: https://api.korve.dev
security: []
paths:
  /v1/orgs/{orgId}/projects/{projectId}/environments:
    post:
      tags:
        - environments
      summary: Create
      description: >-
        Create a custom environment. The slug is derived from the name when
        omitted; "production" and "preview" are reserved for the implicit
        environments.
      operationId: environments.create
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          description: The organization's id (UUID) or slug — either form is accepted.
        - name: projectId
          in: path
          required: true
          schema:
            type: string
          description: The project's id (UUID) or slug — either form is accepted.
      requestBody:
        required: true
        x-korve-max-bytes: 1048576
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Display name, 1-100 characters.
                slug:
                  type: string
                  pattern: ^[a-z][a-z0-9-]{0,38}$
                  description: >-
                    Environment address, unique per project. Derived from the
                    name when omitted.
              required:
                - name
      responses:
        '201':
          description: Environment created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  slug:
                    type: string
                    pattern: ^[a-z][a-z0-9-]{0,38}$
                    description: Environment address — unique per project.
                  kind:
                    type: string
                    enum:
                      - production
                      - preview
                      - custom
                    description: >-
                      The implicit environments carry kind
                      "production"/"preview"; customer-created ones are
                      "custom".
                  createdAt:
                    type: string
                    format: date-time
                required:
                  - id
                  - name
                  - slug
                  - kind
                  - createdAt
        '402':
          description: Organization billing is not active.
        '404':
          description: No such project in this organization.
        '409':
          description: An environment with that slug already exists on this project.
        '422':
          description: Invalid name or slug — or a reserved slug ("production"/"preview").
      security:
        - apiKey: []
        - session: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: korve_api_key
    session:
      type: apiKey
      in: cookie
      name: korve.session_token

````