Create Retention Rule
Create a new retention rule in a repository. If you provide cron, the rule will be enabled on creation.
Allowed Roles: Workspace Admin or System Admin • Authentication Required • Local repositories only
Notes: If retention rules are disabled on the server, this endpoint returns 403. The server can also enforce a maximum number of rules per repository.
POST https://api.repoflow.io/1/workspaces/<workspace-ref>/repositories/<repository-ref>/retention-rules
Path Parameters
Workspace ID or name.
Repository ID or name.
Body
Retention rule name.
Retention rule description (defaults to empty string).
What this rule targets. Note: file rules can be disabled by server configuration.
Retention rule JSON (conditions + keepRules). The exact allowed fields depend on targetType.
Optional cron expression. When provided, the rule is enabled immediately (server enforces min/max schedule frequency).