Groups Api Attach Policy

Groups Api Attach Policy
Attach a Policy to a Group

Requires the ADMIN or SECURITY_OPERATOR role.

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

Security Group id

id example
1

Request Body

The Policy to attach and its stack rank.

AttachPolicyRequest of type(s) application/json
Required  

Show optional properties

{
    "policyId": 0,
    "stackRank": 0
}
{
    "policyId": 2,
    "stackRank": 2
}
integer As int64 As int64
policyId
Required  

Identifier of the Policy to attach. Required (POLICY_ID_REQUIRED); a Policy that does not exist is 404 POLICY_NOT_FOUND; one already attached is 409 POLICY_ALREADY_ATTACHED; a Group holds at most 20 Policies (GROUP_POLICY_LIMIT_EXCEEDED)

integer As int32 As int32
stackRank
Required  
Constraints: minimum: 1

Position of the Policy among the Group's Policies, 1 or more (INVALID_STACK_RANK otherwise). Policies are listed and compiled in ascending stackRank, so 1 is the highest priority

Authentication
This operation uses the following authentication methods.
Responses
201

201 Created successful response envelope. The created attachment

Returns SecurityGroupPolicyDto of type(s) application/json
{
    "securityGroupId": 1,
    "policyId": 2,
    "policyName": "Production Policy",
    "stackRank": 2,
    "groupCount": 1,
    "ruleCount": 6,
    "publishedVersion": 2,
    "boundAt": "2026-01-05T10:30:00Z",
    "boundBy": 2
}
integer As int64 As int64
securityGroupId
Required  

Identifier of the Group the Policy is attached to

integer As int64 As int64
policyId
Required  

Identifier of the attached Policy

string
policyName
Required  

Current name of the attached Policy

integer As int32 As int32
stackRank
Required  

1-based priority; 1 is the highest

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
publishedVersion
Required  

The Policy's published version; 0 means never published

string As date-time As date-time
boundAt
Required  

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

integer As int64 As int64
boundBy
Optional

Identifier of the user who attached the Policy, by attach or by a sync that added it. Null when no user is recorded


400

400 Bad Request: POLICY_ID_REQUIRED, INVALID_STACK_RANK, GROUP_POLICY_LIMIT_EXCEEDED 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: SECURITY_GROUP_NOT_FOUND or 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.


409

409 Conflict: POLICY_ALREADY_ATTACHED

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 POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"policyId":"integer","stackRank":"integer"}' https://{api_host}/api/v1/groups/{id}/policies