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

# Delete environment

> Soft-deletes a custom environment and marks its active publication as unpublished. The environment name becomes available again for re-creation.



## OpenAPI

````yaml DELETE /environment/{id}
openapi: 3.0.1
info:
  title: Tela API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tela.com
security: []
paths:
  /environment/{id}:
    delete:
      tags:
        - Environment
      summary: Delete environment
      description: >
        Soft-deletes a custom environment and marks its active publication as
        unpublished. The environment name

        becomes available again for re-creation.


        System environments (`production`) cannot be deleted (`400`). If any
        application of the canvas still

        targets the environment by name, the request fails with `409` and
        `details.apps` lists the blocking

        applications (`id`, `title`, `key`).
      operationId: deleteEnvironment
      parameters:
        - name: id
          in: path
          required: true
          description: Environment ID
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: Environment deleted
        '400':
          description: System environments cannot be deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/EnvironmentUnauthorized'
        '403':
          $ref: '#/components/responses/EnvironmentForbidden'
        '404':
          $ref: '#/components/responses/EnvironmentNotFound'
        '409':
          description: Environment is used by applications; `details.apps` lists them
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Error: {}
  responses:
    EnvironmentUnauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    EnvironmentForbidden:
      description: The key does not have the required role or access to the canvas' project
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    EnvironmentNotFound:
      description: Canvas or environment not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or UUID

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.