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.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Identity & Access Management BC-620.20

Operations 6

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/v2/roles List custom roles · Get roles #
Ask an LLM
“Which custom roles exist in IQ?”
“What permissions do each of my roles cover?”
Tell an agent
List all custom roles.
Show every role with its permissions.
POST /api/v2/roles Create a custom role · Add role #
Ask an LLM
“How do I create a new custom role with specific permissions?”
“Can I make a role that is built-in?”
Tell an agent
Create a role named {name} with permissions {permissionCategories}.
Add a custom role {name} described as {description}.
GET /api/v2/roles/new Get a role creation template · Get template for new role #
Ask an LLM
“What permissions can I assign when creating a role?”
“Which permission categories are available for a new role?”
Tell an agent
Get the template for a new role.
Show the available permission categories for a role.
DELETE /api/v2/roles/{roleId} Delete a custom role · Delete role #
Ask an LLM
“How do I delete a custom role?”
“Can I remove a role I no longer need?”
Tell an agent destructive · confirm first
Delete role {roleId}.
Remove custom role {roleId}.
GET /api/v2/roles/{roleId} Get a role's details · Get role by id #
Ask an LLM
“What permissions does a specific role have?”
“Can I look up a role by its ID?”
Tell an agent
Get role {roleId}.
Show the permissions of role {roleId}.
PUT /api/v2/roles/{roleId} Update a custom role · Update role #
Ask an LLM
“How do I change the permissions of an existing role?”
“Can I rename a custom role?”
Tell an agent
Update role {roleId} with permissions {permissionCategories}.
Rename existing role {roleId} to {name}.

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/sonatype:sonatype-roles-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

sonatype-roles-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sonatype Roles API
  version: '1.0'
  description: 'Operations tagged Roles across 2 of this provider''s published API definitions: sonatype-lifecycle-openapi.yml, sonatype-iq-openapi.yml. Each path carries the servers of the definition it was published in.'
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
      summary: Get roles
      x-summary-source: derived
    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
      summary: Add role
      x-summary-source: derived
  /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
      summary: Get template for new role
      x-summary-source: derived
  /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
      summary: Delete role
      x-summary-source: derived
    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
      summary: Get role by id
      x-summary-source: derived
    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
      summary: Update role
      x-summary-source: derived
components:
  schemas:
    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
    ApiRoleDTO:
      properties:
        builtIn:
          type: boolean
        description:
          type: string
        id:
          type: string
        name:
          type: string
        permissionCategories:
          items:
            $ref: '#/components/schemas/ApiPermissionCategoryDTO'
          type: array
      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
x-refined-from:
- sonatype-lifecycle-openapi.yml
- sonatype-iq-openapi.yml