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

# Change an environment's settings

> Changes an environment's settings: auto_repair and daily_cap on any environment but production, and protected on production only.

> [accordion] Details
>
> An absent field stays.
>
> * auto\_repair: production's repairs always run.
>
> * daily\_cap: tool calls a UTC day this environment's runs may make, or null to remove it. A change holds from the next run. At the cap, new runs here are refused with quota\_exceeded (details.limit\_source environment\_cap) until the UTC day resets, and runs already started finish. Only runs count; builds never do. Your team's daily cap still counts these calls too, and whichever cap is lower refuses first. Production has none: your team's daily cap holds it.
>
> * protected: with it on, only Owners and Admins push, merge or roll back into production, publish from the Code editor, request a change or build there. Automatic repairs still publish.
>
> * An API key or MCP URL limited to environments changes only its own environments' settings, and production's only when it may be used there.
>
> * off\_categories, off\_sites and off\_tools, on any environment: catalog categories, sites by domain (each with its subdomains) and single tools that API keys and connected agents working here don't find, and whose builds and runs here are refused with environment\_turned\_off. A key with no environments works in production. A team without environments sets production's lists alone, which leaves environments off. Each list you send replaces this environment's own. An API key or connected agent may only add entries: leaving one out is refused with forbidden. People on the Dashboard are never held by them.
>
> * **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), [`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}/settings
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}/settings:
    patch:
      tags:
        - environments
      summary: Change an environment's settings
      description: >-
        Changes an environment's settings: auto_repair and daily_cap on any
        environment but production, and protected on production only.
      operationId: environments.update_settings
      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: false
        content:
          application/json:
            schema:
              type: object
              required: []
              properties:
                auto_repair:
                  type: boolean
                protected:
                  type: boolean
                daily_cap:
                  anyOf:
                    - type: integer
                      description: a number between 1 and 1000000000
                      minimum: 1
                      maximum: 1000000000
                    - type: 'null'
                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: >-
                    Catalog categories to turn off, such as flights: API keys
                    and connected agents working here don't find their sites'
                    tools, and their builds and runs there are refused
                  examples:
                    - - flights
                  maxItems: 27
                off_sites:
                  type: array
                  items:
                    type: string
                    description: >-
                      a string matching the pattern
                      ^(?=.{1,253}$)(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?$
                    pattern: >-
                      ^(?=.{1,253}$)(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?$
                  description: >-
                    Sites to turn off by domain, such as delta.com, up to 200:
                    no scheme, path or port. A domain covers its subdomains and
                    tools built there later
                  examples:
                    - - delta.com
                  maxItems: 200
                off_tools:
                  type: array
                  items:
                    $ref: '#/components/schemas/tool_id'
                  description: >-
                    Tools to turn off by ID, up to 500, such as a site's buy
                    tool while its search tool stays on
                  maxItems: 500
              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, forbidden, environments_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: environment_not_found
          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:
    tool_id:
      type: string
      description: 'a tool ID: tool_ and 32 lowercase hex digits'
      examples:
        - tool_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190
    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.