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

# Update Policy

> Create or replace the maintenance policy. Automatic execution is restricted to an exact operation allowlist and read or write risk; elevated-risk actions still require approval.



## OpenAPI

````yaml /openapi.json put /v1/orgs/{orgId}/projects/{projectId}/maintenance/policy
openapi: 3.1.0
info:
  title: Korve API
  version: 0.1.0
  description: >-
    Typed control plane for deploying applications and explicitly provisioning
    their managed infrastructure.
servers:
  - url: https://api.korve.dev
security: []
paths:
  /v1/orgs/{orgId}/projects/{projectId}/maintenance/policy:
    put:
      tags:
        - projectMaintenance
      summary: Update Policy
      description: >-
        Create or replace the maintenance policy. Automatic execution is
        restricted to an exact operation allowlist and read or write risk;
        elevated-risk actions still require approval.
      operationId: projectMaintenance.updatePolicy
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          description: The organization's id (UUID) or slug — either form is accepted.
        - name: projectId
          in: path
          required: true
          schema:
            type: string
          description: The project's id (UUID) or slug — either form is accepted.
      requestBody:
        required: true
        x-korve-max-bytes: 1048576
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                enabled:
                  type: boolean
                schedule:
                  type: string
                  enum:
                    - hourly
                    - daily
                    - weekly
                categories:
                  type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    enum:
                      - reliability
                environments:
                  type: array
                  minItems: 1
                  maxItems: 25
                  items:
                    type: string
                    minLength: 1
                    maxLength: 39
                autoRemediation:
                  type: object
                  additionalProperties: false
                  properties:
                    enabled:
                      type: boolean
                    maximumRisk:
                      type: string
                      enum:
                        - read
                        - write
                      description: >-
                        Hard ceiling for unattended actions. Dangerous and
                        destructive actions always require a human decision.
                    allowedOperationIds:
                      type: array
                      maxItems: 100
                      items:
                        type: string
                        minLength: 3
                        maxLength: 160
                    maxActionsPerRun:
                      type: integer
                      minimum: 1
                      maximum: 25
                  required:
                    - enabled
                    - maximumRisk
                    - allowedOperationIds
                    - maxActionsPerRun
                expectedVersion:
                  type:
                    - integer
                    - 'null'
                  minimum: 1
              required:
                - enabled
                - schedule
                - categories
                - environments
                - autoRemediation
                - expectedVersion
      responses:
        '200':
          description: Updated maintenance policy.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  enabled:
                    type: boolean
                  schedule:
                    type: string
                    enum:
                      - hourly
                      - daily
                      - weekly
                  categories:
                    type: array
                    minItems: 1
                    maxItems: 1
                    items:
                      type: string
                      enum:
                        - reliability
                  environments:
                    type: array
                    minItems: 1
                    maxItems: 25
                    items:
                      type: string
                      minLength: 1
                      maxLength: 39
                  autoRemediation:
                    type: object
                    additionalProperties: false
                    properties:
                      enabled:
                        type: boolean
                      maximumRisk:
                        type: string
                        enum:
                          - read
                          - write
                        description: >-
                          Hard ceiling for unattended actions. Dangerous and
                          destructive actions always require a human decision.
                      allowedOperationIds:
                        type: array
                        maxItems: 100
                        items:
                          type: string
                          minLength: 3
                          maxLength: 160
                      maxActionsPerRun:
                        type: integer
                        minimum: 1
                        maximum: 25
                    required:
                      - enabled
                      - maximumRisk
                      - allowedOperationIds
                      - maxActionsPerRun
                  version:
                    type: integer
                    minimum: 1
                  updatedBy:
                    type: string
                    minLength: 1
                    maxLength: 160
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                required:
                  - enabled
                  - schedule
                  - categories
                  - environments
                  - autoRemediation
                  - version
                  - updatedBy
                  - createdAt
                  - updatedAt
        '409':
          description: The submitted policy version is stale.
      security:
        - apiKey: []
        - session: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: korve_api_key
    session:
      type: apiKey
      in: cookie
      name: korve.session_token

````