Help Center> Organizations> API Reference> API> Others> Querying Effective Policies
Updated on 2024-03-15 GMT+08:00

Querying Effective Policies

Function

This API is used to query the effective policy of a specific type for the specified account. This API cannot be used to query the information about service control policies. This API can be called only from the organization's management account or a delegated administrator account.

URI

GET /v1/organizations/entities/effective-policies

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

entity_id

Yes

String

Unique ID of an account. Currently, the effective policy of the root and organizational units cannot be queried.

Maximum: 100

policy_type

Yes

String

Name of a policy type. Currently, the value tag_policy is available.

Enumeration values:

  • tag_policy

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Security-Token

No

String

Security token (session token) of your temporary security credentials. If a temporary security credential is used, this header is required.

Minimum: 1

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

last_updated_at

String

Time when the effective policy is mostly updated.

policy_content

String

Content of the effective policy.

Minimum: 0

Maximum: 20000

policy_type

String

Name of a policy type. Currently, the value tag_policy is available.

Enumeration values:

  • tag_policy

entity_id

String

Unique ID of the root, OU, or account.

Maximum: 100

Example Requests

Querying effective policies

POST https://{hostname}/v1/organizations/entities/effective-policies

Example Responses

Status code: 200

Successful.

{
  "last_updated_at" : "2023-01-11T11:00:00Z",
  "policy_content" : "{\"tags\":{\"color\":{\"tag_value\":[],\"tag_key\":\"Color\",\"enforced_for\":[\"iam:policy\"]},\"key_string\":{\"tag_value\":[\"AA\",\"BB\",\"cc\"],\"tag_key\":\"key_String\",\"enforced_for\":[\"iam:policy\"]},\"project\":{\"tag_value\":[\"Maintenance\",\"Escalations\"],\"tag_key\":\"Project\"}}}",
  "policy_type" : "tag_policy",
  "entity_id" : "c2acfcdf5fc7461a88f20094963e56c8"
}

Status Codes

Status Code

Description

200

Successful.

Error Codes

See Error Codes.