---
title: "GET /policy/generation/{jobId}"
method: GET
path: "/policy/generation/{jobId}"
---

# GET /policy/generation/{jobId}

`GET /policy/generation/{jobId}`

Retrieves the policy that was generated using <code>StartPolicyGeneration</code>.

## Path parameters

- `jobId` string, required

## Query parameters

- `includeResourcePlaceholders` boolean
- `includeServiceLevelTemplate` boolean

## Response `200`

Success

- GetGeneratedPolicyResponse
  - `jobDetails` object, required — A <code>GeneratedPolicyDetails</code> object that contains details about the generated policy.
    - `jobId` string, required — The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code> operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code> to retrieve the generated policies or used with <code>CancelPolicyGeneration</code> to cancel the policy generation request.
    - `status` 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'CANCELED', required — The status of the job request.
    - `startedOn` string, date-time, required — A timestamp of when the job was started.
    - `completedOn` string, date-time — A timestamp of when the job was completed.
    - `jobError` object — The job error for the policy generation request.
      - `code` 'AUTHORIZATION_ERROR' | 'RESOURCE_NOT_FOUND_ERROR' | 'SERVICE_QUOTA_EXCEEDED_ERROR' | 'SERVICE_ERROR', required — The job error code.
      - `message` string, required — Specific information about the error. For example, which service quota was exceeded or which resource was not found.
  - `generatedPolicyResult` object, required — A <code>GeneratedPolicyResult</code> object that contains the generated policies and associated details.
    - `properties` unknown, required
    - `generatedPolicies` GeneratedPolicy[] — The text to use as the content for the new policy. The policy is created using the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html">CreatePolicy</a> action.
      - `policy` string, required — The text to use as the content for the new policy. The policy is created using the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html">CreatePolicy</a> action.

## Other responses

- `480` — ValidationException
- `481` — InternalServerException
- `482` — ThrottlingException
- `483` — AccessDeniedException

---

[API](https://skmtc.net/aws/apis/accessanalyzer.md) · [All operations](https://skmtc.net/aws/apis/accessanalyzer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/accessanalyzer/versions/d729b5bbb9cd/schema)
