Policies Api Sync Rules
Sets the Policy's attached Rules to exactly the listed ones (the Assign Rules flow). 409 RULE_RETIRED when the list adds a retired Built-in Rule the Policy does not already contain; keeping or removing an existing link to one is allowed. Nothing changes when the request is refused. Requires the ADMIN or SECURITY_OPERATOR role.
Policy id
3
The ids of the Rules to attach, in order. The list replaces the current attachments.
Show optional properties
{
"ruleIdsInOrder": [
{}
]
}
{
"ruleIdsInOrder": [
12,
7
]
}
The exact set of rules the Policy ends up with: sequence is assigned 1, 2, 3 and so on in this order. Rules not listed are detached, an empty list detaches all, and a repeated id keeps its first position. Required (RULE_IDS_REQUIRED); at most 500 entries, no null element (INVALID_RULE_ID), and every id must exist (404 RULE_NOT_FOUND); a retired Built-in Rule not already attached is refused
200 OK successful response envelope. The resulting attachments in order
[
{
"policyId": 3,
"ruleId": 12,
"ruleName": "Block Unapproved Scripts",
"ruleType": "PATH_FILE_CMD",
"action": "BLOCK",
"ruleRank": "CUSTOM_LOCAL",
"isBuiltIn": false,
"isEnabled": true,
"description": "Blocks scripts executed from the temporary directory",
"matchData": "{\"target_path\":\"/tmp/\",\"match_mode\":\"PREFIX\",\"allowed_ops\":[\"EXECUTE\"],\"is_directory_recursive\":true}",
"revision": 1,
"updatedAt": "2026-01-15T09:30:00Z",
"sequence": 1
},
{
"policyId": 3,
"ruleId": 7,
"ruleName": "Audit Shell Spawn",
"ruleType": "PATH_FILE_CMD",
"action": "AUDIT",
"ruleRank": "CUSTOM_LOCAL",
"isBuiltIn": false,
"isEnabled": true,
"description": "Records every shell started by a service account",
"matchData": "{\"process_path\":\"/bin/sh\",\"match_mode\":\"EXACT\",\"allowed_ops\":[\"EXECUTE\"]}",
"revision": 1,
"updatedAt": "2026-01-10T08:00:00Z",
"sequence": 2
}
]
A Rule attached to a Policy, in evaluation order.
400 Bad Request: RULE_IDS_REQUIRED, TOO_MANY_RULE_IDS, INVALID_RULE_ID, MALFORMED_REQUEST or POLICY_RULE_LIMIT_EXCEEDED. POLICY_RULE_LIMIT_EXCEEDED when the list holds more than 500 distinct Rule ids
{
"errorCode": "string",
"message": "string",
"path": "string",
"timestamp": "string",
"reason": "string"
}
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.
Human-readable error description
Request URI path that produced the error
Timestamp when the error occurred as an ISO 8601 date-time with offset
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 Unauthorized: UNAUTHENTICATED when the VTP_SESSION cookie is missing, unknown, expired or revoked
{
"errorCode": "string",
"message": "string",
"path": "string",
"timestamp": "string",
"reason": "string"
}
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.
Human-readable error description
Request URI path that produced the error
Timestamp when the error occurred as an ISO 8601 date-time with offset
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 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)
{
"errorCode": "string",
"message": "string",
"path": "string",
"timestamp": "string",
"reason": "string"
}
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.
Human-readable error description
Request URI path that produced the error
Timestamp when the error occurred as an ISO 8601 date-time with offset
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 Not Found: POLICY_NOT_FOUND or RULE_NOT_FOUND
"ApiErrorResponse Object"
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.
Human-readable error description
Request URI path that produced the error
Timestamp when the error occurred as an ISO 8601 date-time with offset
A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.
409 Conflict: RULE_RETIRED
"ApiErrorResponse Object"
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.
Human-readable error description
Request URI path that produced the error
Timestamp when the error occurred as an ISO 8601 date-time with offset
A finer code, present only where an endpoint documents it. The Rule Pack endpoints' PACK_ENTRY_INVALID carries the import core's code here.
curl -X PUT -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"ruleIdsInOrder":["integer"]}' https://{api_host}/api/v1/policies/{id}/rules