Skip to main content
A link in Middlewr is a programmable endpoint, not just a redirect. Every link can run a rule engine that evaluates conditions, splits traffic, and transforms the response — all at the edge. A link consists of:
  • Destination URL — The default URL visitors are redirected to (used as fallback when no rules match)
  • Short Code — A unique slug that identifies the link (auto-generated or custom)
  • Domain — The custom domain used for the link URL
  • Link Type — redirect for standard links, rules for links with automation logic
  • Rule Graph — A visual rule graph defining conditions, splits, transforms, and destinations
  • Tags — Color-coded labels for organization and filtering
  • Metadata — Title, description, and OG image for social previews
Links can also be password-protected or scheduled with activation and expiration dates.

Rule Engine

The rule engine is the core of Middlewr. It processes every click through a compiled decision tree at Cloudflare’s edge. The flow:
  1. You build a rule graph visually in the flow editor (conditions, splits, transforms, destinations)
  2. On save, the API compiles the graph to a flat decision tree (~250 bytes for a typical graph)
  3. The compiled tree is stored in Cloudflare KV alongside the link data
  4. On every click, the edge worker evaluates the tree against the request context and returns the matched destination
Rule graphs support eight node types:

Workspaces

Workspaces are the core unit of organization. Everything — links, domains, rules, tags, team members, and analytics — belongs to a workspace.
  • Each workspace has its own set of links, domains, and team members
  • You can create multiple workspaces for different brands, clients, or campaigns
  • Billing is per-workspace, so each workspace can have its own plan
  • Team members can be invited with specific roles and permissions

Domains

Custom domains let you use your own brand in link URLs. Each domain:
  • Requires a CNAME DNS record pointing to Middlewr
  • Gets automatic SSL certificate provisioning
  • Is powered by Cloudflare’s global edge network for fast redirects
  • Can be shared across all links in a workspace

Tags

Tags are color-coded labels that help you organize and filter links. Use them for:
  • Campaign names (e.g., summer-2026, black-friday)
  • Channels (e.g., email, social, paid-ads)
  • Rule configurations (e.g., geo-routed, ab-test)
  • Any custom categorization

Analytics

Middlewr tracks every click in real-time, including which rule branch was evaluated. Analytics data includes: Analytics are available at both the workspace level (aggregate) and individual link level, with per-branch breakdowns for rule-engine links.

Team & Permissions

Middlewr uses a role-based access control system:
  • Owner — Full access, can transfer ownership and manage billing
  • Admin — Can manage members, links, domains, and settings
  • Editor — Can create and edit links, rules, tags, and view analytics
  • Viewer — Read-only access to links and analytics
Team members are invited via email with a specific role. Invitations can be revoked before they are accepted.

API Keys

Two types of API keys are available for programmatic access:
  • User API Keys — Scoped to your user account, access all your workspaces
  • Workspace API Keys — Scoped to a specific workspace, ideal for integrations
Both types use Bearer token authentication and have the same permissions as the user or workspace role that created them.