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

# Update an Alert Rule

> Partially updates a rule. Only the supplied fields change.



## OpenAPI

````yaml patch /v1/risk/alert-rules/{rule_id}
openapi: 3.0.0
info:
  title: Range Risk API
  description: The Range Risk API for risk assessment of crypto addresses.
  version: 1.7.11
  contact: {}
servers:
  - url: https://api.range.org
    description: Range API Server
security:
  - Authorization: []
tags:
  - name: Risk
    description: Get risk information about a crypto address.
  - name: Risk v2
    description: >-
      Address risk assessment, workspace configuration, and signals catalogue
      (API v2).
  - name: Simulator
    description: Simulate a transaction on a network.
  - name: Alert Templates
    description: Browse alert rule templates available to the workspace.
  - name: Alert Rules
    description: Create and manage workspace alert rules.
  - name: Alert Events
    description: List and retrieve fired alert events.
  - name: Channels
    description: Configure alert delivery channels.
paths:
  /v1/risk/alert-rules/{rule_id}:
    patch:
      tags:
        - Alert Rules
      summary: Update an alert rule
      description: >-
        Partially updates a rule. Only the supplied fields change. Changing
        `parameters` bumps the rule's `version` and archives the previous
        version. To change channels, use PUT /:rule_id/channels.
      operationId: patchRule
      parameters:
        - name: rule_id
          required: true
          in: path
          description: The alert rule id.
          schema:
            type: string
            example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchAlertRuleDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertRuleDto'
components:
  schemas:
    PatchAlertRuleDto:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
          description: Display name for the rule.
          example: High gas on eth
        severity:
          type: string
          maxLength: 255
          description: Severity label for the rule.
          example: high
        enabled:
          type: boolean
          description: Whether the rule is enabled.
          example: true
        parameters:
          type: object
          description: >-
            Replacement parameter values, as a `{ field: value }` object (arrays
            are normalized to an object on write). Changing this bumps the
            rule's version and archives the previous version.
          additionalProperties: true
    AlertRuleDto:
      type: object
      properties:
        id:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        workspace_id:
          type: string
          example: workspace-123
        name:
          type: string
          nullable: true
          example: High gas on eth
        rule_type:
          type: string
          example: GasPressure
        network:
          type: string
          nullable: true
          example: eth
        severity:
          type: string
          example: high
        parameters:
          type: object
          additionalProperties: true
          example:
            threshold: 90
        trigger:
          type: string
          enum:
            - BLOCK
            - TICK
          example: BLOCK
        enabled:
          type: boolean
          example: true
        version:
          type: number
          description: Incremented each time the rule parameters change. Starts at 1.
          example: 1
        subscribed_channels:
          example:
            - alert_channel_id: 44444444-4444-4444-4444-444444444445
              min_severity: null
          type: array
          items:
            $ref: '#/components/schemas/SubscribedChannelDto'
        runner_id:
          type: string
          nullable: true
          example: alert-runner-eth-v2
        created_at:
          type: string
          example: '2026-05-14T12:00:00.000Z'
        updated_at:
          type: string
          example: '2026-05-14T12:00:00.000Z'
        alert_template:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/AlertTemplateDto'
      required:
        - id
        - workspace_id
        - rule_type
        - severity
        - parameters
        - trigger
        - enabled
        - version
        - subscribed_channels
        - created_at
        - updated_at
    SubscribedChannelDto:
      type: object
      properties:
        alert_channel_id:
          type: string
          example: 44444444-4444-4444-4444-444444444445
        min_severity:
          nullable: true
          enum:
            - info
            - low
            - medium
            - high
            - critical
          type: string
          example: null
      required:
        - alert_channel_id
    AlertTemplateDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the alert rule template.
          example: '1'
        type:
          type: string
          description: Internal rule type identifier used by the alert engine.
          example: large_transfer
        label:
          type: string
          description: Short display name for the template.
          example: Large Transfer
        description:
          type: string
          description: >-
            Message template sent when the rule fires. Supports `{{variable}}`
            placeholders.
          example: A large transfer was detected on {{network}}
        network:
          type: string
          description: Network slug this template targets.
          example: eth
        severity:
          type: string
          description: Risk severity of alerts produced by this template.
          example: high
          enum:
            - low
            - medium
            - high
        tags:
          description: Categorisation tags for filtering and discovery.
          example:
            - defi
            - transfer
          type: array
          items:
            type: string
        trigger:
          type: string
          description: Whether the template is evaluated per block or per tick.
          enum:
            - BLOCK
            - TICK
          example: BLOCK
        parameters:
          description: >-
            Parameters the user must supply when creating an alert rule from
            this template.
          type: array
          items:
            $ref: '#/components/schemas/RuleParameterDto'
      required:
        - id
        - type
        - label
        - description
        - network
        - severity
        - tags
        - trigger
        - parameters
    RuleParameterDto:
      type: object
      properties:
        label:
          type: string
          description: Human-readable label for this parameter.
          example: Wallet
        description:
          type: string
          description: Description of what value to provide.
          example: The address to monitor
        field:
          type: string
          description: Field key used when creating an alert rule from this template.
          example: address
        field_type:
          type: string
          description: Expected value type (e.g. "Address", "Amount").
          example: Address
        optional:
          type: boolean
          description: Whether this parameter is optional.
          example: false
      required:
        - label
        - description
        - field
        - field_type
        - optional
  securitySchemes:
    Authorization:
      scheme: bearer
      bearerFormat: API Key
      description: 'Use Authorization: Bearer <api-key>'
      type: http

````