> ## 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.

# Rename an environment

> Changes an environment's name.

> [accordion] Details
>
> Its key stays, so MCP URLs, API calls and scripts that name it keep working. Production can't be renamed. An API key or MCP URL limited to environments renames only its own.
>
> * **Callers:** an API key, an MCP OAuth token or a Dashboard session.
> * **Permission:** `team:manage`; an API key also needs `team:manage`.
> * **Effect:** Creates or changes something.
> * **Errors:** [`environment_not_found`](https://docs.pomerado.ai/errors#environment_not_found), [`environment_exists`](https://docs.pomerado.ai/errors#environment_exists), [`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 patch /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}:
    patch:
      tags:
        - environments
      summary: Rename an environment
      description: Changes an environment's name.
      operationId: environments.rename
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: a string at most 40 character(s) long
                  minLength: 1
                  maxLength: 40
              additionalProperties: false
      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, environments_unavailable, forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: environment_not_found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: environment_exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: request_too_large
          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.