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

# Create environment

> Create a new environment.



## OpenAPI

````yaml https://cloud.laravel.com/api-docs/api.json post /applications/{application}/environments
openapi: 3.1.0
info:
  title: Laravel Cloud
  version: 0.0.1
servers:
  - url: https://cloud.laravel.com/api
security:
  - http: []
tags:
  - name: Applications
  - name: Environments
  - name: Domains
  - name: Commands
  - name: Deployments
  - name: Instances
  - name: Email
  - name: Background Processes
  - name: Database Clusters
  - name: Databases
  - name: Database Snapshots
  - name: Database Restores
  - name: Object Storage Buckets
  - name: Bucket Keys
  - name: Caches
  - name: WebSocket Clusters
  - name: WebSocket Applications
  - name: Dedicated Clusters
  - name: Edge Networks
  - name: Secrets
  - name: Usage
  - name: Meta
  - name: Databases (Legacy)
paths:
  /applications/{application}/environments:
    post:
      tags:
        - Environments
      summary: Create environment
      description: Create a new environment.
      operationId: public.applications.environments.store
      parameters:
        - name: application
          in: path
          required: true
          description: The application identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEnvironmentRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    CreateEnvironmentRequest:
      type: object
      properties:
        build_command:
          type:
            - string
            - 'null'
          description: >-
            Optional build command. Omit it or send null to skip the build
            command for a static website.
          maxLength: 2000
        branch:
          type: string
        name:
          type: string
          pattern: ^[A-Za-z0-9 _-]+$
          minLength: 1
          maxLength: 40
        cluster_id:
          type:
            - string
            - 'null'
          description: >-
            The identifier of a dedicated cluster to deploy to. Only fill it if
            your organization has a dedicated cluster and you want to use it for
            this environment.
        edge_network_id:
          type:
            - string
            - 'null'
          description: >-
            The identifier of the edge network the environment should be created
            in. Only fill it if your organization has a dedicated edge network
            and you want to use it for this environment. Defaults to the edge
            network preferred by your organization.
      required:
        - branch
        - name
      title: CreateEnvironmentRequest
  responses:
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      description: The Bearer Token generated on the Cloud UI.
      scheme: bearer
      bearerFormat: bearer

````