Skip to main content

Update Download Rule

Update a download rule by ID.

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. This endpoint supports partial updates. Omitted fields keep their current values. Remote repositories cannot use hide mode with CVE scan fields; use block for those rules.

PATCH https://api.repoflow.io/1/workspaces/<workspace-ref>/repositories/<repository-ref>/download-rules/<download-rule-id>

Path Parameters

workspace-refstringRequired

Workspace ID or name.

repository-refstringRequired

Repository ID or name.

download-rule-idstringRequired

Download rule ID (UUID).

Body

namestringOptional

Download rule name. If omitted, the current name is kept.

descriptionstring | nullOptional

Optional description.

isEnabledbooleanOptional

Whether the rule should be active. If omitted, the current enabled state is kept.

targetType"package" | "version"Optional

Rule target. If omitted, the existing target type is kept.

mode"block" | "hide"Optional

Rule action. If omitted, the current mode is kept. hide is rejected for remote repositories when ruleJson uses CVE scan fields.

ruleJsonobjectOptional

Rule conditions. If omitted, the current rule JSON is kept.

missingScanBehaviorOverride"wait_for_scan" | "deny_while_scanning" | "allow_while_scanning" | nullOptional

Rule-level behavior for rules that use CVE scan fields. If omitted, the current value is kept.

cveScanMaxAgeHoursnumber | nullOptional

Rule-level maximum accepted CVE scan age in hours. Use null to never expire existing scans for this rule. If omitted, the current value is kept.