Create Download Rule
Create a download rule for a repository. Download rules can block a matching download or hide matching package metadata from clients. See the Download Rules feature guide for concepts and supported rule JSON.
Allowed Roles: Workspace Admin or System Admin • Authentication Required • Local or remote repositories only
Notes: Requires the Download Rules feature (Pro self-hosted plan or higher); otherwise this endpoint returns 403. The server can enforce a maximum number of download rules per repository. Supported fields and operators depend on the repository type and package format. Remote repositories cannot use hide mode with CVE scan fields; use block for those rules.
POST https://api.repoflow.io/1/workspaces/<workspace-ref>/repositories/<repository-ref>/download-rules
Path Parameters
Workspace ID or name.
Repository ID or name.
Body
Download rule name.
Optional description.
Whether the rule should be active.
Rule target. Recommended; when omitted, the server infers it from ruleJson when possible.
block denies matching downloads. hide removes matching items from metadata and direct requests. hide is rejected for remote repositories when ruleJson uses CVE scan fields.
Rule conditions. Supports condition leaves and and, or, not groups.
Optional per-rule override for rules that use CVE scan fields.
Rule-level maximum accepted CVE scan age in hours. Use null to never expire existing scans for this rule.