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

# Update Policy Rule

> Partially update a policy rule.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/policies/{rule_id}
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/policies/{rule_id}:
    patch:
      tags:
        - v1
        - protected
        - policies
      summary: Update Policy Rule
      description: Partially update a policy rule.
      operationId: update_policy_rule_v1_policies__rule_id__patch
      parameters:
        - in: path
          name: rule_id
          required: true
          schema:
            format: uuid
            title: Rule Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyRuleUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyRuleResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    PolicyRuleUpdateRequest:
      additionalProperties: false
      description: Request body for partially updating a policy rule.
      properties:
        condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Condition
        effect:
          anyOf:
            - $ref: '#/components/schemas/PolicyEffect'
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Params
        priority:
          anyOf:
            - type: integer
            - type: 'null'
          title: Priority
        subject_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subject Id
        subject_type:
          anyOf:
            - $ref: '#/components/schemas/PolicySubjectType'
            - type: 'null'
        target:
          anyOf:
            - type: string
            - type: 'null'
          title: Target
      title: PolicyRuleUpdateRequest
      type: object
    PolicyRuleResponse:
      description: Serialized policy rule returned to clients.
      properties:
        condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Condition
        effect:
          $ref: '#/components/schemas/PolicyEffect'
        enabled:
          title: Enabled
          type: boolean
        id:
          title: Id
          type: string
        params:
          additionalProperties: true
          title: Params
          type: object
        priority:
          title: Priority
          type: integer
        subject_id:
          title: Subject Id
          type: string
        subject_type:
          $ref: '#/components/schemas/PolicySubjectType'
        target:
          title: Target
          type: string
      required:
        - id
        - enabled
        - priority
        - subject_type
        - subject_id
        - target
        - effect
        - params
      title: PolicyRuleResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PolicyEffect:
      description: What a rule does when it applies.
      enum:
        - allow
        - deny
        - cap
        - approval
        - safety
        - egress
      title: PolicyEffect
      type: string
    PolicySubjectType:
      description: The kind of subject a rule binds to.
      enum:
        - workspace
        - agent
        - user
        - group
      title: PolicySubjectType
      type: string
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````