Skip to main content
The Rules API enables advanced traffic routing based on user attributes, device characteristics, geographic location, and more. Rules are evaluated in priority order and support force redirects, percentage-based routing, and A/B experiments.

Rule types

Quickleap supports three types of rules:

Force redirect

Unconditionally redirects all matching traffic to a specific destination URL. When conditions are met, 100% of traffic is sent to the configured URL.
type: 'force'
action: {
  type: 'redirect',
  url: 'https://example.com/destination'
}

Percentage redirect

Redirects a percentage of matching traffic to an alternate destination. Useful for gradual rollouts or load distribution.
type: 'percentage'
action: {
  type: 'percentage_redirect',
  url: 'https://example.com/variant',
  percentage: 25
}

A/B experiment

Splits matching traffic across multiple variants with configurable percentages. Ideal for testing different destinations.
type: 'ab_experiment'
action: {
  type: 'ab_test',
  variants: [
    { name: 'Control', percentage: 50, url: 'https://example.com/a' },
    { name: 'Variant B', percentage: 50, url: 'https://example.com/b' }
  ]
}

Conditions and operators

Rules evaluate user attributes using conditions. Each condition consists of an attribute, operator, and value.

Condition logic

Multiple conditions can be combined using:
  • AND - All conditions must match
  • OR - At least one condition must match

Supported operators

Available attributes

Rules can match on these user attributes:

Rule evaluation

Rules are evaluated in priority order (lower numbers first). The first matching rule determines the redirect behavior:
  1. Rules are sorted by priority (ascending)
  2. Each rule’s conditions are evaluated against user attributes
  3. First rule where all conditions match (AND logic) or any condition matches (OR logic) is selected
  4. The rule’s action determines the final destination URL
  5. If no rules match, the default redirect URL is used

Rule status

Rules can have three statuses:
  • active - Rule is evaluated for incoming traffic
  • inactive - Rule exists but is not evaluated
  • draft - Rule is being created or modified

Endpoints

List rules

Get all rules for a redirect

Create rule

Create a new rule

Update rule

Update an existing rule

Delete rule

Delete a rule

Test rule

Test rule evaluation

Additional operations

Beyond the core CRUD operations, the Rules API supports:
  • Reorder rules - Change rule priorities
  • Toggle status - Switch between active/inactive/draft
  • Duplicate rule - Clone an existing rule
  • Get attributes - Fetch available attributes and operators
  • Get attribute values - Retrieve possible values from analytics
  • Get analytics - View rule hit counts and performance