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

> Replace the application access policy. Each successful mutation increments its version.



## OpenAPI

````yaml /openapi.json put /v1/orgs/{orgId}/projects/{projectId}/access
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}/access:
    put:
      tags:
        - appAccess
      summary: Update Policy
      description: >-
        Replace the application access policy. Each successful mutation
        increments its version.
      operationId: appAccess.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:
                mode:
                  type: string
                  enum:
                    - public
                    - authenticated
                    - organization
                    - invite_only
                previewMode:
                  type: string
                  enum:
                    - inherit
                    - public
                    - authenticated
                    - organization
                    - invite_only
                environmentOverrides:
                  type: array
                  items:
                    type: object
                    additionalProperties: false
                    properties:
                      environment:
                        type: string
                      mode:
                        type: string
                        enum:
                          - public
                          - authenticated
                          - organization
                          - invite_only
                    required:
                      - environment
                      - mode
                  maxItems: 100
              required:
                - mode
                - previewMode
                - environmentOverrides
      responses:
        '200':
          description: Updated policy.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  mode:
                    type: string
                    enum:
                      - public
                      - authenticated
                      - organization
                      - invite_only
                  previewMode:
                    type: string
                    enum:
                      - inherit
                      - public
                      - authenticated
                      - organization
                      - invite_only
                    description: >-
                      Access for pull-request previews. Inherit uses the project
                      mode.
                  environmentOverrides:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        environment:
                          type: string
                        mode:
                          type: string
                          enum:
                            - public
                            - authenticated
                            - organization
                            - invite_only
                      required:
                        - environment
                        - mode
                  version:
                    type: integer
                    minimum: 1
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                  enforcement:
                    type: object
                    additionalProperties: false
                    properties:
                      status:
                        type: string
                        enum:
                          - ready
                          - provisioning
                          - unavailable
                      reason:
                        type:
                          - string
                          - 'null'
                    required:
                      - status
                      - reason
                required:
                  - mode
                  - previewMode
                  - environmentOverrides
                  - version
                  - createdAt
                  - updatedAt
                  - enforcement
        '404':
          description: No such project or access resource in this organization.
        '409':
          description: An environment appears more than once.
        '422':
          description: Unknown environment or invalid policy.
      security:
        - apiKey: []
        - session: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: korve_api_key
    session:
      type: apiKey
      in: cookie
      name: korve.session_token

````