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

# Update Notification Rule

> Updates an existing notification rule. All fields are optional.



## OpenAPI

````yaml PATCH /apps/{appId}/notification-rules/{ruleId}
openapi: 3.1.0
info:
  title: Vela API
  description: Event ingestion, schema management, and notification rules for Vela.
  version: 1.0.0
  contact:
    name: Vela Support
    email: support@vela.dev
servers:
  - url: https://api.vela.dev/v1
    description: Production
  - url: http://localhost:3000/v1
    description: Local development
security:
  - clientSecret: []
paths:
  /apps/{appId}/notification-rules/{ruleId}:
    patch:
      tags:
        - Notification Rules
      summary: Update Notification Rule
      description: Updates an existing notification rule. All fields are optional.
      operationId: update-notification-rule
      parameters:
        - $ref: '#/components/parameters/AppId'
        - name: ruleId
          in: path
          required: true
          description: Notification rule identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New display name
                eventName:
                  type: string
                  description: New event name to watch
                conditions:
                  type: array
                  description: Updated conditions array
                  items:
                    $ref: '#/components/schemas/RuleCondition'
                actions:
                  type: array
                  description: Updated actions array
                  items:
                    $ref: '#/components/schemas/RuleAction'
                enabled:
                  type: boolean
                  description: Enable or disable the rule
            example:
              enabled: false
      responses:
        '200':
          description: Updated rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationRule'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - clientSecret: []
components:
  parameters:
    AppId:
      name: appId
      in: path
      required: true
      description: App UUID or slug
      schema:
        type: string
      example: order-service
  schemas:
    RuleCondition:
      type: object
      required:
        - id
        - field
        - operator
        - value
      properties:
        id:
          type: string
          description: Condition identifier
        field:
          type: string
          description: Event data field to evaluate
        operator:
          type: string
          enum:
            - equals
            - not_equals
            - greater_than
            - less_than
            - contains
            - starts_with
          description: Comparison operator
        value:
          description: Value to compare against
          oneOf:
            - type: string
            - type: number
    RuleAction:
      type: object
      required:
        - id
        - destinationId
        - channel
      properties:
        id:
          type: string
          description: Action identifier
        destinationId:
          type: string
          description: Destination identifier
        channel:
          type: string
          enum:
            - slack
            - discord
            - email
          description: Delivery channel
        target:
          type:
            - string
            - 'null'
          description: Channel-specific target
        enabled:
          type: boolean
          default: true
    NotificationRule:
      type: object
      properties:
        id:
          type: string
          description: Rule identifier
        appId:
          type: string
          format: uuid
        name:
          type: string
          description: Rule display name
        eventName:
          type: string
          description: Event name to watch
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
          description: Conditions to evaluate (empty = trigger on all)
        actions:
          type: array
          items:
            $ref: '#/components/schemas/RuleAction'
          description: Delivery actions
        enabled:
          type: boolean
        lastTriggeredAt:
          type:
            - string
            - 'null'
          format: date-time
        triggerCount:
          type: integer
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        error:
          type: string
        message:
          type: string
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 404
            error: Not Found
            message: Resource not found
  securitySchemes:
    clientSecret:
      type: http
      scheme: bearer
      description: 'Client secret for management API access. Format: `vela_cs_...`'

````