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

# Create an alert rule

> Creates an alert rule from a registered template. Supply the template id; rule_type, network, and runner_id are copied from it (not supplied).



## OpenAPI

````yaml /api-reference/platform-api.json post /v1/risk/alert-rules
openapi: 3.0.0
info:
  title: Range Platform API
  description: >-
    The Range Platform API for workspace management, counterparties, and
    operational tooling.
  version: 1.7.13
  contact: {}
servers:
  - url: https://api.range.org
    description: Range API Server
security:
  - Authorization: []
  - Authorization: []
tags:
  - name: Address Information
    description: Get information about a crypto address.
  - name: Transfer Enrichments
    description: Attach workspace-scoped notes and categories to transfers.
  - name: Counterparties
    description: Manage external entities, their addresses, bank accounts, and documents.
paths:
  /v1/risk/alert-rules:
    post:
      tags:
        - Alert Rules
      summary: Create an alert rule
      description: >-
        Creates an alert rule from a registered template. Supply the template
        id; rule_type, network, and runner_id are copied from it (not supplied).
      operationId: createRule
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAlertRuleDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertRuleDto'
components:
  schemas:
    CreateAlertRuleDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The id of the template this rule instantiates. The template supplies
            the rule_type, network, runner_id, severity, and trigger.
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        name:
          type: string
          maxLength: 255
          description: Display name for the rule.
          example: High gas on eth
        severity:
          type: string
          maxLength: 255
          description: Severity override. Defaults to the matched template severity.
          example: high
        parameters:
          type: object
          description: >-
            User-supplied parameter values, as a `{ field: value }` object. A
            `[{ field, value }]` array or single-element wrapper is also
            accepted and normalized to an object on write.
          additionalProperties: true
        trigger:
          type: string
          description: Trigger override. Defaults to the matched template trigger.
          enum:
            - BLOCK
            - TICK
      required:
        - id
        - name
    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:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Authorization method required to allow user to access the api endpoints.

````