ValidatePolicy - Access Analyzer


Requests the validation of a policy and returns a list of findings. The findings help you identify issues and provide actionable recommendations to resolve the issue and enable you to author functional policies that meet security best practices.

Request Syntax

POST /policy/validation?maxResults=maxResults&nextToken=nextToken HTTP/1.1 Content-type: application/json { "locale": "string", "policyDocument": "string", "policyType": "string" }

URI Request Parameters

The request uses the following URI parameters.


The maximum number of results to return in the response.


A token used for pagination of results returned.

Request Body

The request accepts the following data in JSON format.


The locale to use for localizing the findings.

Type: String

Valid Values: DE | EN | ES | FR | IT | JA | KO | PT_BR | ZH_CN | ZH_TW

Required: No


The JSON policy document to use as the content for the policy.

Type: String

Required: Yes


The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups. They also include service-control policies (SCPs) that are attached to an AWS organization, organizational unit (OU), or an account.

Resource policies grant permissions on AWS resources. Resource policies include trust policies for IAM roles and bucket policies for S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or S3 bucket policy.

Type: String


Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "findings": [ { "findingDetails": "string", "findingType": "string", "issueCode": "string", "learnMoreLink": "string", "locations": [ { "path": [ { "index": number, "key": "string", "substring": { "length": number, "start": number }, "value": "string" } ], "span": { "end": { "column": number, "line": number, "offset": number }, "start": { "column": number, "line": number, "offset": number } } } ] } ], "nextToken": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The list of findings in a policy returned by Access Analyzer based on its suite of policy checks.

Type: Array of ValidatePolicyFinding objects


A token used for pagination of results returned.

Type: String


For information about the errors that are common to all actions, see Common Errors.


You do not have sufficient access to perform this action.

HTTP Status Code: 403


Internal server error.

HTTP Status Code: 500


Throttling limit exceeded error.

HTTP Status Code: 429


Validation exception error.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: