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

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

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

Checks the availability of one or more image layers in a repository.

When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped.

This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the `docker` CLI to pull, tag, and push images.

## Headers

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

## Request body

- BatchCheckLayerAvailabilityRequest
  - `registryId` string — The Amazon Web Services account ID associated with the registry that contains the image layers to check. If you do not specify a registry, the default registry is assumed.
  - `repositoryName` string, required — The name of the repository that is associated with the image layers to check.
  - `layerDigests` BatchedOperationLayerDigest[], required — The digests of the image layers to check.

## Response `200`

Success

- BatchCheckLayerAvailabilityResponse
  - `layers` Layer[] — A list of image layer objects corresponding to the image layer references in the request.
    - `layerDigest` string — The <code>sha256</code> digest of the image layer.
    - `layerAvailability` 'AVAILABLE' | 'UNAVAILABLE' — The availability status of the image layer.
    - `layerSize` integer — The size, in bytes, of the image layer.
    - `mediaType` string — The media type of the layer, such as <code>application/vnd.docker.image.rootfs.diff.tar.gzip</code> or <code>application/vnd.oci.image.layer.v1.tar+gzip</code>.
  - `failures` LayerFailure[] — Any failures associated with the call.
    - `layerDigest` string — The layer digest associated with the failure.
    - `failureCode` 'InvalidLayerDigest' | 'MissingLayerDigest' — The failure code associated with the failure.
    - `failureReason` string — The reason for the failure.

## Other responses

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

---

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