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

# Create Environment

> Create a new environment in the Metoro platform.



## OpenAPI

````yaml /api-reference/openapi.yaml post /environments/create
openapi: 3.0.0
info:
  description: API for managing Metoro environments, alerts, and dashboards.
  license:
    name: Proprietary
    url: https://metoro.io/terms
  title: Metoro API
  version: 1.0.0
servers:
  - description: Production API server
    url: https://us-east.metoro.io/api/v1
  - description: Demo API server
    url: https://demo.us-east.metoro.io/api/v1
security: []
paths:
  /environments/create:
    post:
      tags:
        - Environments
      summary: Create Environment
      description: Create a new environment in the Metoro platform.
      operationId: createEnvironment
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEnvironmentRequest'
        description: Environment to create
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEnvironmentResponse'
          description: Environment created successfully
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error
      security:
        - bearerAuth: []
components:
  schemas:
    CreateEnvironmentRequest:
      description: Request to create a new environment
      example:
        environment:
          name: my-environment
      properties:
        environment:
          $ref: '#/components/schemas/Environment'
      required:
        - environment
      type: object
    CreateEnvironmentResponse:
      description: Response for creating a new environment
      example:
        token: eyJ...
      properties:
        name:
          description: Name of the environment that was created
          type: string
        token:
          description: Token to send allow sending of data to Metoro
          type: string
      required:
        - name
        - token
      type: object
    Error:
      example:
        error: 'Invalid alert configuration: missing required field'
      properties:
        error:
          description: Error message describing what went wrong
          type: string
      required:
        - error
      type: object
    Environment:
      description: Environment object
      example:
        name: my-environment
      properties:
        name:
          description: Name of the environment
          type: string
      required:
        - name
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````