Groups Api Sync Policies
Sets the Group's attached Policies to exactly the listed ones, adding, removing and reordering in one call (the Assign Policies flow). Requires the ADMIN or SECURITY_OPERATOR role.
Security Group id
1
The ids of the Policies to attach, in stack order. The list replaces the current attachments.
Show optional properties
{
"policyIdsInOrder": [
{}
]
}
{
"policyIdsInOrder": [
1,
2
]
}
The exact set of Policies the Group ends up with, highest priority first: stackRank is assigned 1, 2, 3 and so on in this order. Policies not listed are detached, an empty list detaches all, and a repeated id keeps its first position. Required (POLICY_IDS_REQUIRED); at most 500 entries (TOO_MANY_POLICY_IDS), no null element (INVALID_POLICY_ID), at most 20 distinct Policies (GROUP_POLICY_LIMIT_EXCEEDED), and every id must exist (404 POLICY_NOT_FOUND)
200 OK successful response envelope. The resulting attachments in order
[
{
"securityGroupId": 1,
"policyId": 1,
"policyName": "Baseline Policy",
"stackRank": 1,
"groupCount": 2,
"ruleCount": 14,
"publishedVersion": 3,
"boundAt": "2026-01-02T09:30:00Z",
"boundBy": 1
},
{
"securityGroupId": 1,
"policyId": 2,
"policyName": "Production Policy",
"stackRank": 2,
"groupCount": 1,
"ruleCount": 6,
"publishedVersion": 2,
"boundAt": "2026-01-05T10:30:00Z",
"boundBy": 2
}
]
A Policy attached to a Group, in priority order.
400 Bad Request: POLICY_IDS_REQUIRED, TOO_MANY_POLICY_IDS, INVALID_POLICY_ID, GROUP_POLICY_LIMIT_EXCEEDED or MALFORMED_REQUEST
{
"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: SECURITY_GROUP_NOT_FOUND or POLICY_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.
curl -X PUT -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"policyIdsInOrder":["integer"]}' https://{api_host}/api/v1/groups/{id}/policies