---
title: "POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview"
method: POST
path: "/#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview"
---

# POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview

`POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview`

Starts a preview of a lifecycle policy for the specified repository. This allows you to see the results before associating the lifecycle policy with the repository.

## Headers

- `X-Amz-Target` 'AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview', required

## Request body

- StartLifecyclePolicyPreviewRequest
  - `registryId` string — The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
  - `repositoryName` string, required — The name of the repository to be evaluated.
  - `lifecyclePolicyText` string — The policy to be evaluated against. If you do not specify a policy, the current policy for the repository is used.

## Response `200`

Success

- StartLifecyclePolicyPreviewResponse
  - `registryId` string — The registry ID associated with the request.
  - `repositoryName` string — The repository name associated with the request.
  - `lifecyclePolicyText` string — The JSON repository policy text.
  - `status` 'IN_PROGRESS' | 'COMPLETE' | 'EXPIRED' | 'FAILED' — The status of the lifecycle policy preview request.

## Other responses

- `480` — ServerException
- `481` — InvalidParameterException
- `482` — RepositoryNotFoundException
- `483` — LifecyclePolicyNotFoundException
- `484` — LifecyclePolicyPreviewInProgressException

---

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