Amazon ECR Ecr Repository Policy API

The Ecr Repository Policy API from Amazon ECR — 3 operation(s) for ecr repository policy.

Operations 3

POST /#DeleteRepositoryPolicy Delete Repository Policy #
POST /#GetRepositoryPolicy Get Repository Policy #
POST /#SetRepositoryPolicy Set Repository Policy #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-ecr:amazon-ecr-repository-policy-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-ecr-repository-policy-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Amazon Elastic Container Registry Repository Policy API
  version: '2015-09-21'
  description: Generated from AWS's published Smithy model for Amazon Elastic Container Registry. 3 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://api.ecr.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
tags:
- name: Repository Policy
paths:
  /#DeleteRepositoryPolicy:
    post:
      operationId: DeleteRepositoryPolicy
      summary: Delete Repository Policy
      description: Deletes the repository policy associated with the specified repository.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DeleteRepositoryPolicyResponse'
              example:
                policyText: '{ ... }'
                repositoryName: ubuntu
                registryId: 012345678901
        '400':
          description: InvalidParameterException; RepositoryNotFoundException; RepositoryPolicyNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidParameterException'
        '500':
          description: ServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServerException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryPolicy
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/DeleteRepositoryPolicyRequest'
            example:
              repositoryName: ubuntu
      tags:
      - Repository Policy
  /#GetRepositoryPolicy:
    post:
      operationId: GetRepositoryPolicy
      summary: Get Repository Policy
      description: Retrieves the repository policy for the specified repository.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/GetRepositoryPolicyResponse'
              example:
                policyText: "{\n  \"Version\" : \"2008-10-17\",\n  \"Statement\" : [ {\n    \"Sid\" : \"new statement\",\n    \"Effect\" : \"Allow\",\n    \"Principal\" : {\n     \"AWS\" : \"arn:aws:iam::012345678901:role/CodeDeployDemo\"\n    },\n\"Action\" : [ \"ecr:GetDownloadUrlForLayer\", \"ecr:BatchGetImage\", \"ecr:BatchCheckLayerAvailability\" ]\n } ]\n}"
                repositoryName: ubuntu
                registryId: 012345678901
        '400':
          description: InvalidParameterException; RepositoryNotFoundException; RepositoryPolicyNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidParameterException'
        '500':
          description: ServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServerException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/GetRepositoryPolicyRequest'
            example:
              repositoryName: ubuntu
      tags:
      - Repository Policy
  /#SetRepositoryPolicy:
    post:
      operationId: SetRepositoryPolicy
      summary: Set Repository Policy
      description: Applies a repository policy to the specified repository to control access permissions. For more information, see Amazon ECR Repository policies in the Amazon Elastic Container Registry User Guide.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/SetRepositoryPolicyResponse'
        '400':
          description: InvalidParameterException; RepositoryNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidParameterException'
        '500':
          description: ServerException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServerException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/SetRepositoryPolicyRequest'
      tags:
      - Repository Policy
components:
  schemas:
    ServerException:
      type: object
      properties:
        message:
          type: string
          description: The error message associated with the exception.
    SetRepositoryPolicyResponse:
      type: object
      properties:
        registryId:
          type: string
          description: The registry ID associated with the request.
        repositoryName:
          type: string
          description: The repository name associated with the request.
        policyText:
          type: string
          description: The JSON repository policy text applied to the repository.
    SetRepositoryPolicyRequest:
      type: object
      properties:
        registryId:
          type: string
          description: 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:
          type: string
          description: The name of the repository to receive the policy.
        policyText:
          type: string
          description: The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.
        force:
          type: boolean
          description: If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs.
      required:
      - repositoryName
      - policyText
    DeleteRepositoryPolicyResponse:
      type: object
      properties:
        registryId:
          type: string
          description: The registry ID associated with the request.
        repositoryName:
          type: string
          description: The repository name associated with the request.
        policyText:
          type: string
          description: The JSON repository policy that was deleted from the repository.
    InvalidParameterException:
      type: object
      properties:
        message:
          type: string
          description: The error message associated with the exception.
    DeleteRepositoryPolicyRequest:
      type: object
      properties:
        registryId:
          type: string
          description: The Amazon Web Services account ID associated with the registry that contains the repository policy to delete. If you do not specify a registry, the default registry is assumed.
        repositoryName:
          type: string
          description: The name of the repository that is associated with the repository policy to delete.
      required:
      - repositoryName
    GetRepositoryPolicyResponse:
      type: object
      properties:
        registryId:
          type: string
          description: The registry ID associated with the request.
        repositoryName:
          type: string
          description: The repository name associated with the request.
        policyText:
          type: string
          description: The JSON repository policy text associated with the repository.
    GetRepositoryPolicyRequest:
      type: object
      properties:
        registryId:
          type: string
          description: 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:
          type: string
          description: The name of the repository with the policy to retrieve.
      required:
      - repositoryName
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: ecr
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/582e55931c45b944739742a2c1620b6026dd2d13/models/ecr/service/2015-09-21/ecr-2015-09-21.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)