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

# Delete an environment

> Deletes an environment and the version each tool serves there.

> [accordion] Details
>
> Tools built there, and every version, are kept.
>
> * A login, API key or webhook limited to it alone can be used nowhere, or gets no events, until it is edited. It is never widened.
>
> * Deleting the last environment besides production turns environments off. A login or key limited only to deleted environments still can be used nowhere until it is edited.
>
> * Production can't be deleted.
>
> * An API key or MCP URL limited to environments deletes only one of its own, and the last one besides production only when it may also be used in production, since that turns Protect production off.
>
> * An API key or connected agent can't delete an environment that turns off categories, sites or tools for them, which is refused with forbidden.
>
> * **Callers:** an API key, an MCP OAuth token or a Dashboard session.
>
> * **Permission:** `team:manage`; an API key also needs `team:manage`.
>
> * **Effect:** Removes or replaces something, and can't be undone.
>
> * **Errors:** [`environment_not_found`](https://docs.pomerado.ai/errors#environment_not_found), [`environments_unavailable`](https://docs.pomerado.ai/errors#environments_unavailable), and the [errors any request can get](https://docs.pomerado.ai/errors.md).


## OpenAPI

````yaml /api-reference/openapi.json delete /v1/environments/{key}
openapi: 3.1.0
info:
  title: Pomerado API
  version: '1'
  description: >-
    Run and build website tools, follow their jobs, and manage logins, API keys
    and webhooks. Authenticate with a Pomerado API key (pom_…), an MCP OAuth
    token or a Dashboard session as a Bearer token.
servers:
  - url: https://api.pomerado.ai
security: []
tags:
  - name: account
    x-group: Account
  - name: api_keys
    x-group: API keys
  - name: environments
    x-group: Environments
  - name: connected_apps
    x-group: Connected apps
  - name: usage
    x-group: Usage
  - name: quota
    x-group: Quota
  - name: spend_controls
    x-group: Spend controls
  - name: usage_alerts
    x-group: Usage alerts
  - name: usage_summary
    x-group: Usage summary
  - name: billing
    x-group: Billing
  - name: integrations
    x-group: Integrations
  - name: connect
    x-group: Connect
  - name: code
    x-group: Code
  - name: logins
    x-group: Saved logins
  - name: two_factor
    x-group: 2FA
  - name: login_access
    x-group: Login access
  - name: tools
    x-group: Tools
  - name: shapes
    x-group: Shapes
  - name: webhooks
    x-group: Webhooks
  - name: payer_profiles
    x-group: Payer profiles
  - name: payer_addresses
    x-group: Payer addresses
  - name: payment_methods
    x-group: Payment methods
  - name: runs
    x-group: Runs
  - name: builds
    x-group: Builds
  - name: jobs
    x-group: Jobs
  - name: suggestions
    x-group: Suggestions
  - name: audit
    x-group: Audit
  - name: files
    x-group: Files
  - name: team
    x-group: Team
  - name: sso
    x-group: Single sign-on
  - name: issue_reports
    x-group: Problem reports
paths:
  /v1/environments/{key}:
    delete:
      tags:
        - environments
      summary: Delete an environment
      description: Deletes an environment and the version each tool serves there.
      operationId: environments.delete
      parameters:
        - name: key
          in: path
          required: true
          description: a string matching the pattern ^[a-z](?:[a-z0-9-]{0,30}[a-z0-9])?$
          schema:
            type: string
      responses:
        '200':
          description: The team's environments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentList'
        '400':
          description: invalid_request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: unauthorized, reauthentication_required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: environment_not_allowed, forbidden, environments_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: environment_not_found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: server_busy
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: internal_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: temporarily_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    EnvironmentList:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Environment'
      additionalProperties: false
      description: The team's environments, production first; empty before it adds one
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - retryable
            - docs_url
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            docs_url:
              type: string
            details:
              type: object
              required: []
              properties: {}
              additionalProperties:
                $id: /schemas/unknown
          additionalProperties: false
      additionalProperties: false
    Environment:
      type: object
      required:
        - key
        - name
        - auto_repair
        - protected
        - daily_cap
        - created_at
      properties:
        key:
          type: string
          description: >-
            The fixed key the API's environment, the MCP URLs and Dashboard
            links carry
          examples:
            - staging
          pattern: ^[a-z](?:[a-z0-9-]{0,30}[a-z0-9])?$
        name:
          type: string
          examples:
            - Staging
        auto_repair:
          type: boolean
          description: >-
            Repair failed runs automatically. Always true for production, whose
            repairs always run
        protected:
          type: boolean
          description: >-
            Protect production: only Owners and Admins push, merge, roll back,
            publish, change or build there. Production only
        daily_cap:
          anyOf:
            - type: integer
              description: a number between 1 and 1000000000
              minimum: 1
              maximum: 1000000000
            - type: 'null'
          description: >-
            Tool calls a UTC day this environment's runs may make; null for
            none. At it, new runs here are refused with quota_exceeded
            (details.limit_source environment_cap) until the UTC day resets;
            runs already started finish, and builds never count. Your team's
            daily cap still counts these calls too, and whichever cap is lower
            refuses first. Always null for production, which the team's daily
            cap holds
        created_at:
          $ref: '#/components/schemas/Timestamp'
        off_categories:
          type: array
          items:
            type: string
            enum:
              - retail
              - travel
              - flights
              - events
              - dev
              - sales
              - real_estate
              - learning
              - job_boards
              - finance
              - groceries
              - services
              - dining
              - sports
              - health
              - suppliers
              - logistics
              - cars
              - government
              - news
              - marketing
              - business_tools
              - games
              - design
              - social
              - productivity
              - other
          description: >-
            The catalog categories turned off here for API keys and connected
            agents, in the catalog's order; empty for none
        off_sites:
          type: array
          items:
            type: string
          description: >-
            The sites turned off here, by domain, each with its subdomains;
            empty for none
        off_tools:
          type: array
          items:
            type: string
          description: The tools turned off here, by ID; empty for none
      additionalProperties: false
    Timestamp:
      type: string
      format: date-time
      description: An ISO 8601 timestamp in UTC
      examples:
        - '2026-10-05T18:30:00.000Z'
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

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