Update Policy

JFrog REST APIs

Content Type
REST API

Description: Updates an existing lifecycle policy. PUT is a full update—send the complete desired state (including mode, action, scope, and rule IDs).

Usage: PUT https://{{artifactory-host}}/unifiedpolicy/api/v1/policies/{policyId}

Consumes: application/json

Path Parameters:

Name

Type

Required

Description

policyId

string

Yes

Policy identifier.

Request Body

Field

Type

Required

Description

name

string

Yes

Updated policy name.

description

string

No

Updated description.

enabled

boolean

Yes

Whether the policy is active.

mode

string

Yes

block or warning.

action

object

Yes

Lifecycle action governed by the policy.

action.type

string

Yes

Action type (e.g., certify_to_gate).

action.stage.key

string

Yes

Lifecycle stage key.

action.stage.gate

string

Yes

Lifecycle gate (entry, exit, release).

scope

object

Yes

Policy scope (project or application).

scope.type

string

Yes

project or application.

scope.project_keys

array[string]

No

Projects to include (for project scope).

scope.application_keys

array[string]

No

Applications to include (for application scope).

scope.application_labels

array[object]

No

Label filters (key, value).

rule_ids

array[string]

Yes

IDs of rules enforced by this policy.

Sample Request

PUT 'https://{host}.jfrog.io/unifiedpolicy/api/v1/policies/policy-1001'
Content-Type: application/json
Authorization: Bearer <token>

{
  "name": "Prod Sec Policy (Warnings First)",
  "description": "Warn on High+, block later",
  "enabled": true,
  "mode": "warning",
  "action": { "type": "certify_to_gate", "stage": { "key": "production", "gate": "entry" } },
  "scope": { "type": "project", "project_keys": ["my-project"] },
  "rule_ids": ["rule-12345"]
}

Sample Response

{
  "id": "policy-1001",
  "name": "Prod Sec Policy (Warnings First)",
  "enabled": true,
  "mode": "warning",
  "action": { "type": "certify_to_gate", "stage": { "key": "production", "gate": "entry" } },
  "scope": { "type": "project", "project_keys": ["my-project"] },
  "rule_ids": ["rule-12345"],
  "created_at": "2025-10-09T10:30:00Z",
  "created_by": "admin",
  "updated_at": "2025-10-09T11:00:00Z",
  "updated_by": "admin"
}

Status Codes

Code

Description

200

Policy updated successfully

400

Bad Request (validation error)

401

Unauthorized

403

Forbidden

404

Policy not found

409

Conflict (e.g., invalid rule references)

500

Internal Server Error