Snyk ContainerRegistryImportPolicy API

The ContainerRegistryImportPolicy API from Snyk — 3 operation(s) for containerregistryimportpolicy.

OpenAPI Specification

snyk-containerregistryimportpolicy-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Snyk AccessRequests ContainerRegistryImportPolicy API
  version: REST
servers:
- description: Snyk REST API
  url: https://api.snyk.io/rest
security:
- APIToken: []
- BearerAuth: []
tags:
- name: ContainerRegistryImportPolicy
paths:
  /orgs/{org_id}/container_import/{integration_id}/policy:
    delete:
      description: 'Delete a container registry import policy


        #### Required permissions


        - `Edit integrations (org.integration.edit)`'
      operationId: deleteContainerRegistryImportPolicy
      parameters:
      - $ref: '#/components/parameters/Version'
      - description: Org ID
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      - description: Container Registry Integration ID
        in: path
        name: integration_id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '204':
          $ref: '#/components/responses/204'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      summary: Delete a container registry import policy
      tags:
      - ContainerRegistryImportPolicy
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - 2023-10-11~experimental
      - '2025-09-17'
      x-snyk-api-resource: import_policy
      x-snyk-api-stability: ga
      x-snyk-api-version: '2025-09-17'
      x-stability-level: stable
    get:
      description: 'Get a container registry import policy


        #### Required permissions


        - `View integrations (org.integration.read)`'
      operationId: getContainerRegistryImportPolicy
      parameters:
      - $ref: '#/components/parameters/Version'
      - description: Org ID
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      - description: Container Registry Integration ID
        in: path
        name: integration_id
        required: true
        schema:
          format: uuid
          type: string
      - $ref: '#/components/parameters/StartingAfter'
      - $ref: '#/components/parameters/EndingBefore'
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    additionalProperties: false
                    properties:
                      attributes:
                        $ref: '#/components/schemas/ContainerRegistryImportPolicyAttributes'
                      id:
                        $ref: '#/components/schemas/IntegrationId'
                      type:
                        enum:
                        - container_registry_import_policy
                        type: string
                    required:
                    - type
                    type: object
                  jsonapi:
                    $ref: '#/components/schemas/JsonApi'
                  links:
                    $ref: '#/components/schemas/SelfLink'
                type: object
          description: Gets a container registry import policy successfully
          headers:
            deprecation:
              $ref: '#/components/headers/DeprecationHeader'
            snyk-request-id:
              $ref: '#/components/headers/RequestIdResponseHeader'
            snyk-version-lifecycle-stage:
              $ref: '#/components/headers/VersionStageResponseHeader'
            snyk-version-requested:
              $ref: '#/components/headers/VersionRequestedResponseHeader'
            snyk-version-served:
              $ref: '#/components/headers/VersionServedResponseHeader'
            sunset:
              $ref: '#/components/headers/SunsetHeader'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      summary: Get a container registry import policy
      tags:
      - ContainerRegistryImportPolicy
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - 2023-10-11~experimental
      - '2025-09-17'
      x-snyk-api-resource: import_policy
      x-snyk-api-stability: ga
      x-snyk-api-version: '2025-09-17'
      x-stability-level: stable
    patch:
      description: 'Update a container registry import policy


        #### Required permissions


        - `Edit integrations (org.integration.edit)`'
      operationId: updateContainerRegistryImportPolicy
      parameters:
      - $ref: '#/components/parameters/Version'
      - description: Org ID
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      - description: Container Registry Integration ID
        in: path
        name: integration_id
        required: true
        schema:
          format: uuid
          type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              additionalProperties: false
              properties:
                data:
                  additionalProperties: false
                  properties:
                    attributes:
                      $ref: '#/components/schemas/ContainerRegistryImportPolicyAttributes'
                    id:
                      $ref: '#/components/schemas/IntegrationId'
                    type:
                      enum:
                      - container_registry_import_policy
                      type: string
                  required:
                  - type
                  - attributes
                  type: object
              required:
              - data
              type: object
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    additionalProperties: false
                    properties:
                      attributes:
                        $ref: '#/components/schemas/ContainerRegistryImportPolicyAttributes'
                      id:
                        $ref: '#/components/schemas/IntegrationId'
                      type:
                        enum:
                        - container_registry_import_policy
                        type: string
                    required:
                    - type
                    type: object
                  jsonapi:
                    $ref: '#/components/schemas/JsonApi'
                  links:
                    $ref: '#/components/schemas/SelfLink'
                type: object
          description: Updated a container registry import policy successfully
          headers:
            deprecation:
              $ref: '#/components/headers/DeprecationHeader'
            location:
              $ref: '#/components/headers/LocationHeader'
            snyk-request-id:
              $ref: '#/components/headers/RequestIdResponseHeader'
            snyk-version-lifecycle-stage:
              $ref: '#/components/headers/VersionStageResponseHeader'
            snyk-version-requested:
              $ref: '#/components/headers/VersionRequestedResponseHeader'
            snyk-version-served:
              $ref: '#/components/headers/VersionServedResponseHeader'
            sunset:
              $ref: '#/components/headers/SunsetHeader'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      summary: Update a container registry import policy
      tags:
      - ContainerRegistryImportPolicy
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - 2023-10-11~experimental
      - '2025-09-17'
      x-snyk-api-resource: import_policy
      x-snyk-api-stability: ga
      x-snyk-api-version: '2025-09-17'
      x-stability-level: stable
    post:
      description: 'Create a container registry import policy


        #### Required permissions


        - `Edit integrations (org.integration.edit)`'
      operationId: createContainerRegistryImportPolicy
      parameters:
      - $ref: '#/components/parameters/Version'
      - description: Org ID
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      - description: Container Registry Integration ID
        in: path
        name: integration_id
        required: true
        schema:
          format: uuid
          type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              properties:
                data:
                  additionalProperties: false
                  properties:
                    attributes:
                      $ref: '#/components/schemas/ContainerRegistryImportPolicyAttributes'
                    type:
                      enum:
                      - container_registry_import_policy
                      type: string
                  required:
                  - type
                  - attributes
                  type: object
              required:
              - data
              type: object
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    additionalProperties: false
                    description: container registry import policy resource object
                    properties:
                      attributes:
                        $ref: '#/components/schemas/ContainerRegistryImportPolicyAttributes'
                      id:
                        $ref: '#/components/schemas/IntegrationId'
                      type:
                        enum:
                        - container_registry_import_policy
                        type: string
                    required:
                    - type
                    type: object
                  jsonapi:
                    $ref: '#/components/schemas/JsonApi'
                  links:
                    $ref: '#/components/schemas/SelfLink'
                type: object
          description: Created a container registry import policy successfully
          headers:
            deprecation:
              $ref: '#/components/headers/DeprecationHeader'
            location:
              $ref: '#/components/headers/LocationHeader'
            snyk-request-id:
              $ref: '#/components/headers/RequestIdResponseHeader'
            snyk-version-lifecycle-stage:
              $ref: '#/components/headers/VersionStageResponseHeader'
            snyk-version-requested:
              $ref: '#/components/headers/VersionRequestedResponseHeader'
            snyk-version-served:
              $ref: '#/components/headers/VersionServedResponseHeader'
            sunset:
              $ref: '#/components/headers/SunsetHeader'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      summary: Create a container registry import policy
      tags:
      - ContainerRegistryImportPolicy
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - 2023-10-11~experimental
      - '2025-09-17'
      x-snyk-api-resource: import_policy
      x-snyk-api-stability: ga
      x-snyk-api-version: '2025-09-17'
      x-stability-level: stable
  /orgs/{org_id}/container_import/{integration_id}/policy/dry_run:
    post:
      description: 'Creates an asynchronous dry run job to test a container registry import policy


        #### Required permissions


        - `Edit integrations (org.integration.edit)`'
      operationId: createContainerRegistryImportPolicyDryRun
      parameters:
      - $ref: '#/components/parameters/Version'
      - description: Org ID
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      - description: Container Registry Integration ID
        in: path
        name: integration_id
        required: true
        schema:
          format: uuid
          type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              properties:
                data:
                  additionalProperties: false
                  properties:
                    attributes:
                      $ref: '#/components/schemas/ContainerRegistryImportPolicyAttributes'
                    type:
                      enum:
                      - container_registry_import_policy
                      type: string
                  required:
                  - type
                  - attributes
                  type: object
              required:
              - data
              type: object
      responses:
        '202':
          content:
            application/vnd.api+json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    additionalProperties: false
                    description: dry run job resource object
                    properties:
                      attributes:
                        $ref: '#/components/schemas/DryRunJobCreationResponseAttributes'
                      id:
                        description: The dry run job ID
                        format: uuid
                        type: string
                      type:
                        enum:
                        - dry_run_job
                        type: string
                    required:
                    - id
                    - type
                    - attributes
                    type: object
                  jsonapi:
                    $ref: '#/components/schemas/JsonApi'
                  links:
                    $ref: '#/components/schemas/SelfLink'
                type: object
          description: Dry run job created successfully
          headers:
            content-location:
              description: A pointer to the newly created dry run job resource
              required: true
              schema:
                format: string
                type: string
            deprecation:
              $ref: '#/components/headers/DeprecationHeader'
            location:
              $ref: '#/components/headers/LocationHeader'
            snyk-request-id:
              $ref: '#/components/headers/RequestIdResponseHeader'
            snyk-version-lifecycle-stage:
              $ref: '#/components/headers/VersionStageResponseHeader'
            snyk-version-requested:
              $ref: '#/components/headers/VersionRequestedResponseHeader'
            snyk-version-served:
              $ref: '#/components/headers/VersionServedResponseHeader'
            sunset:
              $ref: '#/components/headers/SunsetHeader'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      summary: Create a dry run job for a container registry import policy
      tags:
      - ContainerRegistryImportPolicy
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - 2024-10-15~beta
      - '2025-09-17'
      x-snyk-api-resource: import_policy
      x-snyk-api-stability: ga
      x-snyk-api-version: '2025-09-17'
      x-stability-level: stable
  /orgs/{org_id}/container_import/{integration_id}/policy/dry_run/{job_id}:
    get:
      description: 'Retrieves the status and results of a dry run job


        #### Required permissions


        - `Edit integrations (org.integration.edit)`'
      operationId: getDryRunJob
      parameters:
      - $ref: '#/components/parameters/Version'
      - description: Org ID
        in: path
        name: org_id
        required: true
        schema:
          format: uuid
          type: string
      - description: Container Registry Integration ID
        in: path
        name: integration_id
        required: true
        schema:
          format: uuid
          type: string
      - description: Dry run job ID
        in: path
        name: job_id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    additionalProperties: false
                    description: dry run job resource object
                    properties:
                      attributes:
                        $ref: '#/components/schemas/DryRunJobResponseAttributes'
                      id:
                        description: The dry run job ID
                        format: uuid
                        type: string
                      type:
                        enum:
                        - dry_run_job
                        type: string
                    required:
                    - id
                    - type
                    - attributes
                    type: object
                  jsonapi:
                    $ref: '#/components/schemas/JsonApi'
                  links:
                    $ref: '#/components/schemas/SelfLink'
                type: object
          description: Dry run job retrieved successfully
          headers:
            deprecation:
              $ref: '#/components/headers/DeprecationHeader'
            snyk-request-id:
              $ref: '#/components/headers/RequestIdResponseHeader'
            snyk-version-lifecycle-stage:
              $ref: '#/components/headers/VersionStageResponseHeader'
            snyk-version-requested:
              $ref: '#/components/headers/VersionRequestedResponseHeader'
            snyk-version-served:
              $ref: '#/components/headers/VersionServedResponseHeader'
            sunset:
              $ref: '#/components/headers/SunsetHeader'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      summary: Get a dry run job
      tags:
      - ContainerRegistryImportPolicy
      x-snyk-api-lifecycle: released
      x-snyk-api-releases:
      - '2025-09-17'
      x-snyk-api-resource: import_policy
      x-snyk-api-stability: ga
      x-snyk-api-version: '2025-09-17'
      x-stability-level: stable
components:
  schemas:
    DryRunJobCreationResponseAttributes:
      description: Attributes for a dry run job creation response
      properties:
        status:
          description: The current status of the dry run job
          enum:
          - pending
          - running
          - completed
          - failed
          type: string
      required:
      - status
      type: object
    ActualVersion:
      description: Resolved API version
      example: '2026-03-25'
      pattern: ^((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?)$
      type: string
    JsonApi:
      additionalProperties: false
      example:
        version: '1.0'
      properties:
        version:
          description: Version of the JSON API specification this server supports.
          example: '1.0'
          pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)$
          type: string
      required:
      - version
      type: object
    ContainerRegistryImportPolicyAttributes:
      additionalProperties: false
      properties:
        policy:
          $ref: '#/components/schemas/ContainerRegistryPolicy'
      required:
      - policy
      type: object
    QueryVersion:
      description: Requested API version
      example: '2026-03-25'
      pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
      type: string
    RepositoryGroup:
      description: A repository with its matching tags grouped together
      properties:
        repository:
          description: The repository name
          type: string
        tags:
          items:
            $ref: '#/components/schemas/ImageTag'
          type: array
      required:
      - repository
      - tags
      type: object
    ImageTag:
      description: A tag within a repository
      properties:
        observed_at:
          description: When the image was first observed
          format: date-time
          type: string
        tag:
          description: The tag name
          type: string
      required:
      - tag
      type: object
    IntegrationId:
      description: Container Registry Integration ID
      example: 365764ee-8a87-491a-9c9f-ad816f1238df
      format: uuid
      type: string
    ContainerRegistryPolicy:
      description: A policy
      properties:
        delete_images:
          description: Delete images no longer matching the policy. False by default.
          type: boolean
        import_policy:
          $ref: '#/components/schemas/PolicyComponent'
        name:
          type: string
        schedule_frequency_hours:
          description: The frequency of the import policy in hours.
          minimum: 2
          type: integer
      required:
      - name
      - import_policy
      type: object
    ErrorDocument:
      additionalProperties: false
      example:
        errors:
        - detail: Permission denied for this resource
          status: '403'
        jsonapi:
          version: '1.0'
      properties:
        errors:
          example:
          - detail: Permission denied for this resource
            status: '403'
          items:
            additionalProperties: false
            example:
              detail: Not Found
              status: '404'
            properties:
              code:
                description: An application-specific error code, expressed as a string value.
                example: entity-not-found
                type: string
              detail:
                description: A human-readable explanation specific to this occurrence of the problem.
                example: 'The request was missing these required fields: ...'
                type: string
              id:
                description: A unique identifier for this particular occurrence of the problem.
                example: f16c31b5-6129-4571-add8-d589da9be524
                format: uuid
                type: string
              links:
                additionalProperties: false
                description: A link that leads to further details about this particular occurrance of the problem.
                example:
                  about: https://example.com/about_this_error
                properties:
                  about:
                    example: https://example.com/api/resource
                    oneOf:
                    - description: A string containing the link’s URL.
                      example: https://example.com/api/resource
                      type: string
                    - additionalProperties: false
                      example:
                        href: https://example.com/api/resource
                      properties:
                        href:
                          description: A string containing the link’s URL.
                          example: https://example.com/api/resource
                          type: string
                        meta:
                          additionalProperties: true
                          description: Free-form object that may contain non-standard information.
                          example:
                            key1: value1
                            key2:
                              sub_key: sub_value
                            key3:
                            - array_value1
                            - array_value2
                          type: object
                      required:
                      - href
                      type: object
                type: object
              meta:
                additionalProperties: true
                example:
                  key: value
                type: object
              source:
                additionalProperties: false
                example:
                  pointer: /data/attributes
                properties:
                  parameter:
                    description: A string indicating which URI query parameter caused the error.
                    example: param1
                    type: string
                  pointer:
                    description: A JSON Pointer [RFC6901] to the associated entity in the request document.
                    example: /data/attributes
                    type: string
                type: object
              status:
                description: The HTTP status code applicable to this problem, expressed as a string value.
                example: '400'
                pattern: ^[45]\d\d$
                type: string
              title:
                description: A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
                example: Bad request
                type: string
            required:
            - status
            - detail
            type: object
          minItems: 1
          type: array
        jsonapi:
          additionalProperties: false
          example:
            version: '1.0'
          properties:
            version:
              description: Version of the JSON API specification this server supports.
              example: '1.0'
              pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)$
              type: string
          required:
          - version
          type: object
      required:
      - jsonapi
      - errors
      type: object
    PolicyComponent:
      description: A component policy, an overall policy is made up of one or more component policies combined in various ways.
      properties:
        name:
          type: string
        policy:
          type: object
        sub_policies:
          items:
            type: object
          type: array
        type:
          type: string
      required:
      - name
      - type
      type: object
    SelfLink:
      additionalProperties: false
      example:
        self: https://example.com/api/this_resource
      properties:
        self:
          $ref: '#/components/schemas/LinkProperty'
      type: object
    DryRunPolicyResult:
      description: The results of a dry run policy execution
      properties:
        images_to_delete:
          description: List of images grouped by repositories that would be deleted based on the policy rules (only populated when delete_images is enabled)
          items:
            $ref: '#/components/schemas/RepositoryGroup'
          type: array
        images_to_import:
          description: List of images grouped by repositories that would be imported based on the policy rules
          items:
            $ref: '#/components/schemas/RepositoryGroup'
          type: array
        total_images_processed:
          description: Total number of images that were evaluated during the policy test, including both matching and non-matching images
          type: integer
      required:
      - images_to_import
      - images_to_delete
      - total_images_processed
      type: object
    DryRunJobResponseAttributes:
      description: Attributes for a dry run job response
      properties:
        completed_at:
          description: When the job completed processing (only present when status is completed or failed)
          format: date-time
          type: string
        error_message:
          description: Error message if the job failed (only present when status is failed)
          type: string
        policy:
          $ref: '#/components/schemas/ContainerRegistryPolicy'
        result:
          $ref: '#/components/schemas/DryRunPolicyResult'
        started_at:
          description: When the job started processing (only present when status is running, completed, or failed)
          format: date-time
          type: string
        status:
          description: The current status of the dry run job
          enum:
          - pending
          - running
          - completed
          - failed
          type: string
      required:
      - status
      - policy
      type: object
    LinkProperty:
      example: https://example.com/api/resource
      oneOf:
      - description: A string containing the link’s URL.
        example: https://example.com/api/resource
        type: string
      - additionalProperties: false
        example:
          href: https://example.com/api/resource
        properties:
          href:
            description: A string containing the link’s URL.
            example: https://example.com/api/resource
            type: string
          meta:
            additionalProperties: true
            description: Free-form object that may contain non-standard information.
            example:
              key1: value1
              key2:
                sub_key: sub_value
              key3:
              - array_value1
              - array_value2
            type: object
        required:
        - href
        type: object
  parameters:
    EndingBefore:
      description: Return the page of results immediately before this cursor
      example: v1.eyJpZCI6IjExMDAifQo=
      in: query
      name: ending_before
      schema:
        type: string
    StartingAfter:
      description: Return the page of results immediately after this cursor
      example: v1.eyJpZCI6IjEwMDAifQo=
      in: query
      name: starting_after
      schema:
        type: string
    Version:
      description: The requested version of the endpoint to process the request
      example: '2026-03-25'
      in: query
      name: version
      required: true
      schema:
        $ref: '#/components/schemas/QueryVersion'
    Limit:
      description: Number of results to return per page
      example: 10
      in: query
      name: limit
      schema:
        default: 10
        format: int32
        maximum: 100
        minimum: 10
        multipleOf: 10
        type: integer
  headers:
    SunsetHeader:
      description: 'A header containing the date of when the underlying endpoint will be removed. This header is only present if the endpoint has been deprecated. For information purposes only. Returned as a date in the format: YYYY-MM-DD'
      example: '2021-08-02'
      schema:
        format: date
        type: string
    VersionRequestedResponseHeader:
      description: A header containing the version of the endpoint requested by the caller.
      example: '2026-03-25'
      schema:
        $ref: '#/components/schemas/QueryVersion'
    VersionServedResponseHeader:
      description: A header containing the version of the endpoint that was served by the API.
      example: '2026-03-25'
      schema:
        $ref: '#/components/schemas/ActualVersion'
    VersionStageResponseHeader:
      description: 'A header containing the version stage of the endpoint. This stage describes the guarantees s

# --- truncated at 32 KB (38 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/snyk/refs/heads/main/openapi/snyk-containerregistryimportpolicy-api-openapi.yml