Download OpenAPI specification:
API documentation for IAM Policies service
Retrieve a list of all actions for a specific product or for all products.
| product | string Product identifier to filter actions. |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/actions', qs: {product: 'SOME_STRING_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "action": "GetPolicy",
- "product": "iam",
- "service": "policies-api",
- "authenticationEnabled": true,
- "authorizationEnabled": true,
- "userTypes": [
- "root-user",
- "service-sa",
- "iam-user",
- "user-sa"
], - "methods": [
- "GET"
], - "pathRegex": "^\\/v\\d+\\/policies\\/([^\\/\\?]+)\\/*(?:\\?.*)?$",
- "resources": [
- "iam:policy"
], - "description": "",
- "docUrl": "",
- "conditionKeys": [ ],
- "label": "List"
}
]Retrieve a list of all IAM groups.
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = {method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/groups'}; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": "0e7d81af-175c-4273-8f2e-d97989bcbfaa",
- "name": "testgroup",
- "createdAt": 1720513021936
}
]Create a new group in the IAM or IDP system.
A group can include IAM users, service accounts, and attached policies.
The mode determines whether the group belongs to IAM (iam) or IDP (idp).
| Authorization required | string Example: Bearer iam_token Bearer token |
| name required | string Unique name of the group. |
| description | string Optional description of the group. |
| mode | string Enum: "iam" "idp" Determines which system the group belongs to:
|
| iamUsers | Array of strings <uuid> [ items <uuid > ] List of IAM user IDs to include in the group. |
| policies | Array of strings <uuid> [ items <uuid > ] List of policy IDs to attach to the group. |
{- "name": "testgroup",
- "description": "qqqqq",
- "mode": "iam",
- "iamUsers": [
- "b4a045ea-0605-431a-b549-a2b74e518fd9"
], - "policies": [
- "d065a9da-89c9-428b-9de1-4b4256f14dc3"
]
}{- "id": "0e7d81af-175c-4273-8f2e-d97989bcbfaa"
}Retrieve detailed information about a specific group, including its policies and IAM users.
| groupId required | string ID of the group to retrieve |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/groups/%7BgroupId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "id": "0e7d81af-175c-4273-8f2e-d97989bcbfaa",
- "name": "testgroup1",
- "description": "aaaaa",
- "mode": "iam",
- "root": 54549,
- "policies": [
- "0063bb82-5d21-40b4-b0cf-7888bec4ba66"
], - "iamUsers": [
- "41c6bffe-4077-45a3-95fc-f994e065f21d"
], - "createdAt": 1720513021936
}Update group information such as name or description.
| groupId required | string ID of the group to update |
| Authorization required | string Example: Bearer iam_token Bearer token |
| name required | string Unique name of the group. |
| description | string Optional description of the group. |
{- "name": "testgroup",
- "description": "qqqqq"
}Delete a group by its ID.
| groupId required | string ID of the group to delete |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'DELETE', url: 'https://iamapis.vngcloud.vn/policies-api/v1/groups/%7BgroupId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Retrieve a paginated list of policies associated with a specific group.
| groupId required | string ID of the group |
| name | string Filter policies by name |
| pageNumber required | integer Page number |
| pageSize required | integer Page size |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/groups/%7BgroupId%7D/policies', qs: { name: 'SOME_STRING_VALUE', pageNumber: 'SOME_INTEGER_VALUE', pageSize: 'SOME_INTEGER_VALUE' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "data": [
- {
- "id": "d065a9da-89c9-428b-9de1-4b4256f14dc3",
- "name": "vStorageHCM04FullAccess",
- "createdAt": 1739807153592
}
], - "pageSize": 10,
- "pageNumber": 0,
- "totalItems": 1,
- "totalPages": 1
}Attach an IAM user to a specific group.
| groupId required | string ID of the group |
| userId required | string ID of the IAM user |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'POST', url: 'https://iamapis.vngcloud.vn/policies-api/v1/groups/%7BgroupId%7D/iam-users/%7BuserId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Detach an IAM user from a specific group.
| groupId required | string ID of the group |
| userId required | string ID of the IAM user to remove |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'DELETE', url: 'https://iamapis.vngcloud.vn/policies-api/v1/groups/%7BgroupId%7D/iam-users/%7BuserId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Create a new IAM policy with specific statements and conditions. You may use the API '/v1/policies/compose-policy' to generate the correct 'statements'.
| Authorization required | string Example: Bearer iam_token Bearer token |
| name | string |
| description | string or null |
Array of objects |
{- "name": "testabcd",
- "description": null,
- "statements": [
- {
- "effect": "allow",
- "actions": [
- "iam:GetPolicy"
], - "resources": [
- "iam::1234:policy/*"
], - "condition": {
- "numberLessThan": {
- "epochTime": [
- "1761620940000"
]
}, - "numberGreaterThan": {
- "epochTime": [
- "1761621000000",
- "1761534600000"
]
}, - "numberGreaterThanOrEquals": {
- "epochTime": [
- "1761621000000"
]
}, - "numberLessThanOrEquals": {
- "epochTime": [
- "1761621060000"
]
}, - "stringEquals": {
- "resourceTag/abcd": [
- "efgh"
], - "requestTag/xyz": [
- "eee"
], - "tagKey": [
- "aaaaa"
]
}, - "stringNotEquals": {
- "resourceTag/addd": [
- "eeee"
], - "requestTag/eeee": [
- "dddd"
]
}
}
}
]
}{- "id": "12345678"
}Retrieve a paginated list of IAM policies filtered by name if provided.
| name | string Filter by policy name (optional) |
| pageNumber required | integer Page number for pagination |
| pageSize required | integer Number of items per page |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies', qs: { name: 'SOME_STRING_VALUE', pageNumber: 'SOME_INTEGER_VALUE', pageSize: 'SOME_INTEGER_VALUE' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "data": [
- {
- "id": "d065a9da-89c9-428b-9de1-4b4256f14dc3",
- "name": "vStorageHCM04FullAccess",
- "createdAt": 1739807153592
}
], - "pageSize": 10,
- "pageNumber": 0,
- "totalItems": 1,
- "totalPages": 1
}Retrieve detailed information about a specific IAM policy by its ID.
| id required | string The unique identifier of the IAM policy |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7Bid%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "id": "d065a9da-89c9-428b-9de1-4b4256f14dc3",
- "name": "vStorageHCM04FullAccess",
- "description": null,
- "root": 54549,
- "manager": "user",
- "scope": "public",
- "statements": [
- {
- "effect": "allow",
- "actions": [
- "vstorage:ListProjects",
- "vstorage:ListS3Keys",
- "vstorage:GetProject"
], - "resources": [
- "*"
]
}
], - "createdAt": 1739807153592
}Delete a specific IAM policy by its unique identifier.
| id required | string The unique identifier of the IAM policy |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'DELETE', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7Bid%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Update an existing IAM policy with new name, description, or statements. You may use the API '/v1/policies/compose-policy' to generate the correct 'statements'.
| id required | string The unique identifier of the IAM policy to update |
| Authorization required | string Example: Bearer iam_token Bearer token |
{- "name": "testabcd",
- "statements": [
- {
- "effect": "allow",
- "actions": [
- "iam:GetPolicy"
], - "resources": [
- "iam::1234:policy/*"
], - "condition": {
- "numberLessThan": {
- "epochTime": [
- "1761620940000"
]
}, - "numberGreaterThan": {
- "epochTime": [
- "1761621000000",
- "1761534600000"
]
}, - "numberGreaterThanOrEquals": {
- "epochTime": [
- "1761621000000"
]
}, - "numberLessThanOrEquals": {
- "epochTime": [
- "1761621060000"
]
}, - "stringEquals": {
- "resourceTag/abcd": [
- "efgh"
], - "requestTag/xyz": [
- "eee"
], - "tagKey": [
- "aaaaa"
]
}, - "stringNotEquals": {
- "resourceTag/addd": [
- "eeee"
], - "requestTag/eeee": [
- "dddd"
]
}
}
}
], - "description": null
}Retrieve a list of IAM user IDs that are currently attached to the specified policy.
| policyId required | string The unique identifier of the IAM policy |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/iam-users' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- "c88741c9-afb1-47cb-8425-8aa3edcd010f"
]Attach a specific IAM policy to an IAM user.
| policyId required | string The unique identifier of the policy |
| userId required | string The unique identifier of the IAM user |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'POST', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/iam-users/%7BuserId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Detach a specific IAM policy from an IAM user.
| policyId required | string The unique identifier of the policy |
| userId required | string The unique identifier of the IAM user |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'DELETE', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/iam-users/%7BuserId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Retrieve a list of service account IDs that are attached to a specific IAM policy.
| policyId required | string The unique identifier of the policy |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/service-accounts' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- "b552a77a-d018-418e-8709-38b9c12501bf"
]Attach the specified policy to a given service account.
| policyId required | string The unique identifier of the policy |
| saId required | string The unique identifier of the service account |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'POST', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/service-accounts/%7BsaId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Remove the specified policy from a given service account.
| policyId required | string The unique identifier of the policy |
| saId required | string The unique identifier of the service account |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'DELETE', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/service-accounts/%7BsaId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Retrieve a list of groups that have the specified policy attached.
| policyId required | string The unique identifier of the policy |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/groups' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": "0e7d81af-175c-4273-8f2e-d97989bcbfaa",
- "name": "testgroup",
- "description": "",
- "mode": "iam",
- "root": 54549,
- "policies": [
- "0063bb82-5d21-40b4-b0cf-7888bec4ba66"
], - "iamUsers": [
- "41c6bffe-4077-45a3-95fc-f994e065f21d"
], - "createdAt": 1720513021936
}
]Attach the specified policy to a given group.
| policyId required | string The ID of the policy to attach |
| groupId required | string The ID of the group to attach the policy to |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'POST', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/groups/%7BgroupId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Remove the specified policy from a given group.
| policyId required | string The ID of the policy to detach |
| groupId required | string The ID of the group to remove the policy from |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'DELETE', url: 'https://iamapis.vngcloud.vn/policies-api/v1/policies/%7BpolicyId%7D/groups/%7BgroupId%7D' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
Analyze and split IAM policy statements into more specific and valid sets of permissions.
| Authorization required | string Example: Bearer iam_token Bearer token |
[- {
- "effect": "allow",
- "actions": [
- "iam:ListPolicies",
- "iam:GetPolicy",
- "iam:CreatePolicy",
- "iam:UpdatePolicy",
- "iam:DeletePolicy",
- "iam:GetIamUser",
- "iam:GetServiceAccount"
], - "resources": [
- "iam::54549:policy/*",
- "iam::54549:iam-user/*",
- "iam::54549:service-account/*"
], - "condition": { }
}
][- {
- "effect": "allow",
- "actions": [
- "iam:ListPolicies",
- "iam:CreatePolicy"
], - "resources": [
- "*"
], - "condition": { }
}, - {
- "effect": "allow",
- "actions": [
- "iam:GetPolicy",
- "iam:UpdatePolicy",
- "iam:DeletePolicy"
], - "resources": [
- "iam::54549:policy/*"
], - "condition": { }
}, - {
- "effect": "allow",
- "actions": [
- "iam:GetIamUser"
], - "resources": [
- "iam::54549:iam-user/*"
], - "condition": { }
}, - {
- "effect": "allow",
- "actions": [
- "iam:GetServiceAccount"
], - "resources": [
- "iam::54549:service-account/*"
], - "condition": { }
}
]Retrieve a list of all available product identifiers.
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = {method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/products'}; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- "vmonitor",
- "iam",
- "vserver"
]Retrieve all resources or filter them by product.
| product | string Filter resources by product name. |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/resources', qs: {product: 'SOME_STRING_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": "iam:policy",
- "product": "iam",
- "name": "policy",
- "builder": {
- "format": "iam::_:policy/_",
- "placeholder": "_",
- "params": [
- {
- "key": "root",
- "builder": {
- "format": "_",
- "placeholder": "_",
- "params": [
- {
- "name": "Account ID",
- "type": "int"
}
]
}
}, - {
- "key": "id",
- "builder": {
- "format": "_",
- "placeholder": "_",
- "params": [
- {
- "name": "Policy ID",
- "type": "string"
}
]
}
}
]
}
}
]Retrieve all policies that are currently attached to a specific IAM user.
| userId required | string ID of the IAM user |
| name | string Example: name=FullAccessPolicy Filter policies by name (optional) |
| pageNumber required | integer Example: pageNumber=0 Page number for pagination |
| pageSize required | integer Example: pageSize=10 Number of items per page |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/user-attachments/iam-users/%7BuserId%7D/policies', qs: {name: 'FullAccessPolicy', pageNumber: '0', pageSize: '10'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "data": [
- {
- "id": "d065a9da-89c9-428b-9de1-4b4256f14dc3",
- "name": "vStorageHCM04FullAccess",
- "createdAt": 1739807153592
}
], - "pageSize": 10,
- "pageNumber": 0,
- "totalItems": 1,
- "totalPages": 1
}Retrieve all policies currently attached to a specific Service Account.
| userId required | string ID of the Service Account |
| name | string Example: name=StorageFullAccess Filter policies by name (optional) |
| pageNumber required | integer Example: pageNumber=0 Page number for pagination |
| pageSize required | integer Example: pageSize=10 Number of items per page |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/user-attachments/service-accounts/%7BuserId%7D/policies', qs: {name: 'StorageFullAccess', pageNumber: '0', pageSize: '10'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "data": [
- {
- "id": "d065a9da-89c9-428b-9de1-4b4256f14dc3",
- "name": "vStorageHCM04FullAccess",
- "createdAt": 1739807153592
}
], - "pageSize": 10,
- "pageNumber": 0,
- "totalItems": 1,
- "totalPages": 1
}Retrieve all IAM groups that the specified IAM User belongs to.
| userId required | string ID of the IAM User |
| Authorization required | string Example: Bearer iam_token Bearer token |
const request = require('request'); const options = { method: 'GET', url: 'https://iamapis.vngcloud.vn/policies-api/v1/user-attachments/iam-users/%7BuserId%7D/groups' }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": "5828d3f0-b7bc-4c31-885d-426aa6a73232",
- "name": "qqqqq",
- "description": "qqqqq",
- "mode": "iam",
- "root": 54549,
- "policies": [
- "d065a9da-89c9-428b-9de1-4b4256f14dc3"
], - "iamUsers": [
- "b4a045ea-0605-431a-b549-a2b74e518fd9"
], - "createdAt": 1761633521958
}
]