Policies Api Update Policy

Policies Api Update Policy
Update a Policy

Requires the ADMIN or SECURITY_OPERATOR role.

Request
URI
PUT
https://{api_host}/api/v1/policies/{id}
COPY
Path Parameters
integer
id
Required  

Policy id

id example
1

Request Body

The name and description to save for the Policy.

UpdatePolicyRequest of type(s) application/json
Required  

Show optional properties

{
    "name": "string"
}
{
    "name": "Staging Policy",
    "description": "Protections for pre-production staging hosts"
}
string
name
Required  
Constraints: minLength: 1 maxLength: 255

The new name, validated as on create; the Policy's own current name is not a duplicate

string
description
Optional
Constraints: maxLength: 2000

Replaces the description with the same limits as on create; absent or null clears it

Authentication
This operation uses the following authentication methods.
Responses
200

200 OK successful response envelope. The updated Policy

Returns PolicyDto of type(s) application/json
{
    "policyId": 3,
    "name": "Staging Policy",
    "description": "Protections for pre-production staging hosts",
    "createdBy": 1,
    "createdByUsername": "alice.example",
    "updatedBy": 1,
    "updatedByUsername": "alice.example",
    "groupCount": 0,
    "ruleCount": 0,
    "pendingGroupCount": 0,
    "publishedVersion": 0,
    "hasUnpublishedChanges": false,
    "createdAt": "2026-01-16T08:00:00Z",
    "updatedAt": "2026-01-16T08:10:00Z"
}
integer As int64 As int64
policyId
Required  

Identifier of the Policy, assigned by the server when the Policy is created

string
name
Required  

Policy name, stored trimmed, at most 255 characters, and different from every other Policy's name ignoring case

string
description
Optional

Free text, stored trimmed, at most 2,000 characters; a whitespace-only text is stored as an empty string. Null when none was given

integer As int64 As int64
createdBy
Optional

Identifier of the user who created the Policy. Null when no user is recorded

string
createdByUsername
Optional

Username of createdBy; absent when createdBy is absent or the user no longer exists

integer As int64 As int64
updatedBy
Optional

Identifier of the user who last edited the Policy's name or description (the creator until then). Null when no user is recorded

string
updatedByUsername
Optional

Username of updatedBy; absent when updatedBy is absent or the user no longer exists

integer As int64 As int64
groupCount
Required  

Number of Groups the Policy is attached to

integer As int64 As int64
ruleCount
Required  

Number of Rules attached to the Policy

integer As int64 As int64
pendingGroupCount
Required  

Number of attached Groups whose hasPendingChanges flag is set. Read it as 'N attached groups have unpublished changes', never as 'this policy changed'.

integer As int64 As int64
publishedVersion
Required  

Number of times the Policy has been published; 0 means never published

boolean
hasUnpublishedChanges
Required  

True when a Rule or attachment change has not been published to the Policy's snapshot

string As date-time As date-time
createdAt
Required  

When the Policy was created, as an ISO 8601 date-time with offset; never changes

string As date-time As date-time
updatedAt
Required  

When the Policy was last updated, as an ISO 8601 date-time with offset


400

400 Bad Request: INVALID_POLICY_NAME, DUPLICATE_POLICY_NAME or MALFORMED_REQUEST

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


401

401 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked

Returns Unauthenticated of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


403

403 Forbidden: FORBIDDEN or CSRF_ERROR. CSRF_ERROR when the X-XSRF-TOKEN header is missing or wrong on a POST, PUT, PATCH or DELETE (only POST /api/v1/auth/login is exempt, and a request without a valid session gets 401 UNAUTHENTICATED instead); PASSWORD_CHANGE_REQUIRED when the account must change its password first (only GET /api/v1/auth/session, POST /api/v1/auth/logout and POST /api/v1/auth/change-password are exempt); LICENSE_REQUIRED or LICENSE_EXPIRED while the license pool is restricted (no license, or expired past grace) (exempt: every route under /api/v1/auth, GET /api/v1/user/preferences, GET /api/v1/licensing/summary and POST /api/v1/licensing/licenses)

Returns ApiErrorResponse of type(s) application/json
{
    "errorCode": "string",
    "message": "string",
    "path": "string",
    "timestamp": "string",
    "reason": "string"
}
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


404

404 Not Found: POLICY_NOT_FOUND

Returns ApiErrorResponse of type(s) application/json
"ApiErrorResponse Object"
errorCode
Required  

Stable machine-readable error code. The known values are listed in ApiErrorCode; the set is not closed, so a client must tolerate an unlisted value.

string
message
Required  

Human-readable error description

string
path
Required  

Request URI path that produced the error

string As date-time As date-time
timestamp
Required  

Timestamp when the error occurred as an ISO 8601 date-time with offset

string
reason
Optional

A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.


Code Samples
COPY
                    curl -X PUT -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"name":"string"}' https://{api_host}/api/v1/policies/{id}