Sonatype Roles API

Roles provide sets of permissions that grant access to the functionality in the user interface, through integrations, and when using REST APIs. Permissions are granted by assigning users or groups to the system roles or at the various levels in the organizational hierarchy: root organization, repository managers, and applications and organizations. Use this REST API to manage roles.

OpenAPI Specification

sonatype-roles-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Sonatype Lifecycle Public REST Advanced Search Roles 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: 'Roles provide sets of permissions that grant access to the functionality in the user interface, through integrations, and when using REST APIs.


    Permissions are granted by assigning users or groups to the system roles or at the various levels in the organizational hierarchy: root organization, repository managers, and applications and organizations.


    Use this REST API to manage roles.'
  name: Roles
paths:
  /api/v2/roles:
    get:
      description: 'Use this method to view the role IDs, role names and descriptions.


        Permissions required: View All Roles'
      operationId: getRoles
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoleListDTO'
          description: The response contains the role IDs, role names and descriptions.
      tags:
      - Roles
    post:
      description: 'Use this method to create a new custom role with specified permissions.


        Permissions required: Edit Roles'
      operationId: addRole
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiRoleDTO'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoleDTO'
          description: The role was created successfully. The response contains the created role details.
      tags:
      - Roles
  /api/v2/roles/new:
    get:
      description: 'Use this method to retrieve a template for creating a new custom role, including all available permissions that can be assigned.


        Permissions required: Edit Roles'
      operationId: getTemplateForNewRole
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoleDTO'
          description: The response contains a role template with available permissions.
      tags:
      - Roles
  /api/v2/roles/{roleId}:
    delete:
      description: 'Use this method to delete a custom role.


        Permissions required: Edit Roles'
      operationId: deleteRole
      parameters:
      - in: path
        name: roleId
        required: true
        schema:
          type: string
      responses:
        '204':
          description: The role was deleted successfully.
      tags:
      - Roles
    get:
      description: 'Use this method to retrieve details for a specific role, including its permissions.


        Permissions required: View All Roles'
      operationId: getRoleById
      parameters:
      - in: path
        name: roleId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoleDTO'
          description: The response contains the role details including permissions.
      tags:
      - Roles
    put:
      description: 'Use this method to update an existing custom role and its permissions.


        Permissions required: Edit Roles'
      operationId: updateRole
      parameters:
      - in: path
        name: roleId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiRoleDTO'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoleDTO'
          description: The role was updated successfully. The response contains the updated role details.
      tags:
      - Roles
components:
  schemas:
    ApiRoleDTO:
      properties:
        builtIn:
          type: boolean
        description:
          type: string
        id:
          type: string
        name:
          type: string
        permissionCategories:
          items:
            $ref: '#/components/schemas/ApiPermissionCategoryDTO'
          type: array
      type: object
    ApiPermissionDTO:
      properties:
        allowed:
          type: boolean
        description:
          type: string
        displayName:
          type: string
        id:
          enum:
          - CONFIGURE_SYSTEM
          - EDIT_ROLES
          - VIEW_ROLES
          - ACCESS_AUDIT_LOG
          - WAIVE_POLICY_VIOLATIONS
          - CHANGE_LICENSES
          - CHANGE_SECURITY_VULNERABILITIES
          - MANAGE_PROPRIETARY
          - CLAIM_COMPONENT
          - WRITE
          - READ
          - EDIT_ACCESS_CONTROL
          - EVALUATE_APPLICATION
          - EVALUATE_COMPONENT
          - ADD_APPLICATION
          - MANAGE_AUTOMATIC_APPLICATION_CREATION
          - MANAGE_AUTOMATIC_SCM_CONFIGURATION
          - LEGAL_REVIEWER
          - CREATE_PULL_REQUESTS
          type: string
      type: object
    ApiPermissionCategoryDTO:
      properties:
        displayName:
          type: string
        permissions:
          items:
            $ref: '#/components/schemas/ApiPermissionDTO'
          type: array
      type: object
    ApiRoleListDTO:
      properties:
        roles:
          items:
            $ref: '#/components/schemas/ApiRoleDTO'
          type: array
      type: object
  securitySchemes:
    BasicAuth:
      scheme: basic
      type: http
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http