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

# Create a new environment

> An endpoint for creating a new environment



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml post /v1/projects/{projectId}/environments
openapi: 3.1.0
info:
  title: Maia Public REST API
  version: '1.0'
servers:
  - description: EU1
    url: https://eu1.api.matillion.com/dpc
  - description: US1
    url: https://us1.api.matillion.com/dpc
security:
  - bearerAuth: []
tags:
  - description: Manage Schedules
    name: Schedules
  - description: Manage Connections
    name: Connections
  - description: Operations for managing Project Variables
    name: Project Variables
  - description: Manage Pipelines
    name: Pipelines
  - description: Review pipelines against quality rules
    name: Pipeline Quality Review
  - description: Execute tests within a project
    name: Test Execution
  - description: Manage your AI agent tasks
    name: AI Agent Tasks
  - description: SCIM endpoints for user/group permission management
    name: Directory Integration
  - description: Publish shared pipeline artifacts
    name: Shared Pipeline Artifacts
  - description: Manage Repositories
    name: Repositories
  - description: Report on Credit Consumption
    name: Consumption
  - description: Manage Artifacts
    name: Artifacts
  - description: Operations for data lineage and governance
    name: Data Lineage
  - description: Manage Streaming Pipelines
    name: Streaming Pipelines
  - description: Execute a pipeline
    name: Pipeline Execution
  - description: ''
    name: Environments
  - description: ''
    name: Projects
  - description: Manage Agents
    name: Agents
  - description: Operations for managing Environment-level Overrides of Project Variables
    name: Project Variable Environment Overrides
  - description: Query audit events
    name: Audit Events
  - description: Connector Profiles
    name: Connectors
paths:
  /v1/projects/{projectId}/environments:
    post:
      tags:
        - Environments
      summary: Create a new environment
      description: An endpoint for creating a new environment
      operationId: create_1
      parameters:
        - in: path
          name: projectId
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            examples:
              Redshift Environment:
                description: Redshift Environment
                value:
                  name: development-env
                  displayName: An environment for testing new features
                  description: An optional description
                  defaultAgentId: 0a9f9866-24e6-43ab-8f3c-71089f407241
                  defaultUserAccessLevel: admin
                  defaultConnections:
                    DWH:
                      redshift: my-dwh-connection
                  connectionOverrides:
                    - connectionName: my-dwh-connection
                      connectionProperties:
                        url:
                          value: >-
                            redshift-cluster-abc.abcdefghi99z.eu-west-1.redshift.amazonaws.com
                        username:
                          value: rs-username
                        port:
                          value: '5439'
                        defaultDatabase:
                          value: testing
                        useSsl:
                          value: 'true'
                        defaultSchema:
                          value: public
                        defaultStorageLocation:
                          value: my-s3-bucket
                        password:
                          secretName: redshift-secret-name
                          secretKey: key-for-password
              Snowflake Environment:
                description: Snowflake Environment
                value:
                  name: development-env
                  displayName: An environment for testing new features
                  description: An optional description
                  defaultAgentId: 0a9f9866-24e6-43ab-8f3c-71089f407241
                  defaultUserAccessLevel: admin
                  defaultConnections:
                    DWH:
                      snowflake: my-dwh-connection
                  connectionOverrides:
                    - connectionName: my-dwh-connection
                      connectionProperties:
                        account:
                          value: aa1111.eu-central-1
                        username:
                          value: SNOWFLAKE_USER
                        defaultRole:
                          value: SNOWFLAKE_ROLE
                        defaultWarehouse:
                          value: SNOWFLAKE_WAREHOUSE
                        defaultDatabase:
                          value: SNOWFLAKE_DATABASE
                        defaultSchema:
                          value: SNOWFLAKE_SCHEMA
                        privateKey:
                          secretName: snowflake-private-key-secret-name
                        passphrase:
                          secretName: optional-secret-name-for-encrypted-keys
              Snowflake Environment with Cloud Platform Credentials:
                description: Snowflake Environment with Cloud Platform Credentials
                value:
                  name: development-env
                  displayName: An environment for testing new features
                  description: An optional description
                  defaultAgentId: 0a9f9866-24e6-43ab-8f3c-71089f407241
                  defaultUserAccessLevel: admin
                  defaultConnections:
                    DWH:
                      snowflake: my-dwh-connection
                    CLOUD_PLATFORM:
                      aws: my-aws-connection
                      gcp: my-gcp-connection
                      azure: my-azure-connection
                  connectionOverrides:
                    - connectionName: my-dwh-connection
                      connectionProperties:
                        account:
                          value: aa1111.eu-central-1
                        username:
                          value: SNOWFLAKE_USER
                        defaultRole:
                          value: SNOWFLAKE_ROLE
                        defaultWarehouse:
                          value: SNOWFLAKE_WAREHOUSE
                        defaultDatabase:
                          value: SNOWFLAKE_DATABASE
                        defaultSchema:
                          value: SNOWFLAKE_SCHEMA
                        privateKey:
                          secretName: snowflake-private-key-secret-name
                    - connectionName: my-aws-connection
                      connectionProperties:
                        credentialSecretName: aws-platform-credentials
                    - connectionName: my-gcp-connection
                      connectionProperties:
                        credentialSecretName: gcp-platform-credentials
                    - connectionName: my-azure-connection
                      connectionProperties:
                        credentialSecretName: azure-platform-credentials
            schema:
              $ref: '#/components/schemas/CreateEnvironmentRequest'
        required: true
      responses:
        '200':
          description: Environment configuration remains unchanged since last update
        '201':
          description: Environment has been created
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Wrong request parameters used
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Project not Found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Invalid agent ID
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unexpected error occurred
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Gateway timeout
components:
  schemas:
    CreateEnvironmentRequest:
      type: object
      properties:
        connectionOverrides:
          type: array
          description: Connection overrides for the environment
          items:
            $ref: '#/components/schemas/ConnectionOverride'
          maxItems: 200
          minItems: 1
        defaultAgentId:
          type: string
          description: The UUID of the default agent for this environment
        defaultConnections:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: string
          description: The default connections for the new environment
        defaultUserAccessLevel:
          type: string
          description: The default role project users will have on the environment
          examples:
            - default
            - admin
            - runner
            - readOnly
            - noAccess
        description:
          type: string
          description: The description of the new environment
          example: My new Environment
          maxLength: 1000
          minLength: 0
        displayName:
          description: The display name of the new environment
          example: Environment 1
        inheritProjectDefaults:
          type: boolean
          description: >-
            Determines whether the environment inherits the project's default
            settings
        name:
          type: string
          description: The name of the new environment
          example: Environment-1
          minLength: 1
      required:
        - connectionOverrides
        - defaultAgentId
        - defaultConnections
        - defaultUserAccessLevel
        - name
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            type: string
    ConnectionOverride:
      type: object
      properties:
        connectionName:
          type: string
          description: The name of the connection to override
          maxLength: 255
          minLength: 1
        connectionProperties:
          type: object
          additionalProperties: {}
          description: The connection properties for the connection override
      required:
        - connectionName
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: a valid bearer token
      scheme: bearer
      type: http

````