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

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

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

Retrieves the repository policy for the specified repository.

## Headers

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

## Request body

- GetRepositoryPolicyRequest
  - `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 with the policy to retrieve.

## Response `200`

Success

- GetRepositoryPolicyResponse
  - `registryId` string — The registry ID associated with the request.
  - `repositoryName` string — The repository name associated with the request.
  - `policyText` string — The JSON repository policy text associated with the repository.

## Other responses

- `480` — ServerException
- `481` — InvalidParameterException
- `482` — RepositoryNotFoundException
- `483` — RepositoryPolicyNotFoundException

---

[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)
