Sonatype Policies API

Use this REST API to retrieve details on all existing policies in your instance of Lifecycle.

OpenAPI Specification

sonatype-policies-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Sonatype Lifecycle Public REST Advanced Search Policies API
  version: 1.201.0-02
  description: Use the Advanced Search REST API to perform searches on Lifecycle application scan reports.
security:
- BasicAuth: []
  BearerAuth: []
tags:
- description: Use this REST API to retrieve details on all existing policies in your instance of Lifecycle.
  name: Policies
paths:
  /api/v2/policies:
    get:
      description: 'Use this method to retrieve all existing policies.


        Permissions required: View IQ Elements'
      operationId: getPolicies
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPolicyListDTO'
          description: The response contains a `policies` object which contains a list of:<ul><li>`id` is the policyId. It can be used in the GET method for endpoint /api/v2/policyViolations to retrieve policy violations for the policy, and other similar operations.</li><li>`name` is the name of the policy.</li><li>`ownerType` is the ownerType.</li><li>`ownerId` is the internal id associated with the ownerType.</li><li>`threatLevel` is the threat level that is set for this policy.</li><li>`policyType` indicates the type for the policy. Values can be `Security`, `License`, `Quality` or `Other`.</li>
      tags:
      - Policies
components:
  schemas:
    ApiPolicyListDTO:
      properties:
        policies:
          items:
            $ref: '#/components/schemas/ApiPolicyDTO'
          type: array
      type: object
    ApiPolicyDTO:
      properties:
        id:
          type: string
        name:
          type: string
        ownerId:
          type: string
        ownerType:
          enum:
          - APPLICATION
          - ORGANIZATION
          - REPOSITORY_CONTAINER
          - REPOSITORY_MANAGER
          - REPOSITORY
          type: string
        policyType:
          type: string
        threatLevel:
          format: int32
          type: integer
      type: object
  securitySchemes:
    BasicAuth:
      scheme: basic
      type: http
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http