Sonatype Role Memberships API

Use this REST API to manage authorizations for users or user groups. You can view existing role assignments and grant or revoke user authorization on organizations, applications and repositories.

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 10

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/roleMemberships/{ownerType} List global or repository role memberships · Get role memberships global or repository container #
Ask an LLM
“Who holds the administrator role across the whole organization?”
“Can I see every user and group with a role on all repositories?”
Tell an agent
List role memberships for owner type {ownerType}.
Show who has which roles globally or across all repositories.
PUT /api/v2/roleMemberships/{ownerType}/role/{roleId}/members Replace all members of a role globally · Set bulk role members global or repository container #
Ask an LLM
“How do I replace every member of a role across the organization at once?”
“Is there an atomic way to overwrite a role's membership list globally?”
Tell an agent
Replace all members of role {roleId} for owner type {ownerType}.
Set the membership list of role {roleId} globally to these users.
DELETE /api/v2/roleMemberships/{ownerType}/role/{roleId}/{memberType}/{memberName} Revoke a role from a user or group globally · Revoke role membership global or repository container #
Ask an LLM
“How do I take a user's role away across the whole organization?”
“Can I remove a single user from a role globally?”
Tell an agent destructive · confirm first
Revoke role {roleId} from {memberType} {memberName} globally.
Remove {memberType} {memberName} from role {roleId} for owner type {ownerType}.
PUT /api/v2/roleMemberships/{ownerType}/role/{roleId}/{memberType}/{memberName} Grant a role to a user or group globally · Grant role membership global or repository container #
Ask an LLM
“How do I give a user or group a role across the whole organization?”
“Can I add a single user to a role globally without touching the others?”
Tell an agent
Grant role {roleId} to {memberType} {memberName} globally.
Add {memberType} {memberName} to role {roleId} for owner type {ownerType}.
GET /api/v2/roleMemberships/{ownerType}/roles List role memberships across the platform · Get bulk role memberships global or repository container #
Ask an LLM
“Who holds each role across all organizations?”
“Can I see role memberships for a single repository container?”
Tell an agent
List all role memberships for {ownerType} owners.
Show every role, its members and description in {ownerType}.
GET /api/v2/roleMemberships/{ownerType}/{internalOwnerId} List role memberships for an application or organization · Get role memberships application or organization #
Ask an LLM
“Who holds which roles in a specific application or organization?”
“Can I see a single application's role assignments?”
Tell an agent
List role memberships for {ownerType} {internalOwnerId}.
Show who has what role in application or organization {internalOwnerId}.
PUT /api/v2/roleMemberships/{ownerType}/{internalOwnerId}/role/{roleId}/members Replace the members of a role · Set bulk role members non global #
Ask an LLM
“How do I replace everyone on a role at once?”
“Is there an atomically-cleared role membership set?”
Tell an agent
Replace the members of {ownerType} role {roleId} in {internalOwnerId} with this list.
Set all members of role {roleId} for {ownerType} owner {internalOwnerId}.
DELETE /api/v2/roleMemberships/{ownerType}/{internalOwnerId}/role/{roleId}/{memberType}/{memberName} Revoke a role from a user or group in an app or org · Revoke role membership application or organization #
Ask an LLM
“How do I take a user's role away in one application?”
“Can I remove a group from a role on a single organization?”
Tell an agent destructive · confirm first
Revoke role {roleId} from {memberType} {memberName} in {ownerType} {internalOwnerId}.
Remove {memberType} {memberName} from role {roleId} on {ownerType} {internalOwnerId}.
PUT /api/v2/roleMemberships/{ownerType}/{internalOwnerId}/role/{roleId}/{memberType}/{memberName} Grant a role to a user or group in an app or org · Grant role membership application or organization #
Ask an LLM
“How do I give a user a role in one application?”
“Can I add a group to a role on a single organization?”
Tell an agent
Grant role {roleId} to {memberType} {memberName} in {ownerType} {internalOwnerId}.
Add {memberType} {memberName} to role {roleId} on {ownerType} {internalOwnerId}.
GET /api/v2/roleMemberships/{ownerType}/{internalOwnerId}/roles List full role memberships for an app or org · Get bulk role memberships non global #
Ask an LLM
“What roles are held by whom in a specific application, with full details?”
“Can I get role names, descriptions and member info for one organization?”
Tell an agent
List full role memberships for {ownerType} {internalOwnerId}.
Show every role and its members for application {internalOwnerId}.

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-role-memberships-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-role-memberships-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sonatype Role Memberships API
  version: '1.0'
  description: 'Operations tagged Role Memberships 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: 'Use this REST API to manage authorizations for users or user groups.


    You can view existing role assignments and grant or revoke user authorization on organizations, applications and repositories.'
  name: Role Memberships
paths:
  /api/v2/roleMemberships/{ownerType}:
    get:
      description: 'Use this method to retrieve all users and roles globally or for all repositories.


        Permissions required: Edit system configuration and users for a global context or view IQ elements for a non-global context'
      operationId: getRoleMembershipsGlobalOrRepositoryContainer
      parameters:
      - description: Enter the value for ownerType. Using `global` will return the users and groups who have been assigned the administrator role.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - repository_container
          - global
          pattern: global|repository_container
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoleMemberMappingListDTO'
          description: The response contains all role Ids and the corresponding users/user groups assigned to them, for the ownerType specified. It also includes members who inherit a role based on the organization hierarchy.
      tags:
      - Role Memberships
      summary: Get role memberships global or repository container
      x-summary-source: derived
  /api/v2/roleMemberships/{ownerType}/role/{roleId}/members:
    put:
      description: 'Use this method to set all members for a specific role in the global or repository container context. This operation atomically replaces all existing members for the role with the provided list.


        Permissions required: Edit system configuration and users for a global context or edit access control for a non-global context'
      operationId: setBulkRoleMembersGlobalOrRepositoryContainer
      parameters:
      - description: Enter the ownerType.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - repository_container
          - global
          pattern: global|repository_container
          type: string
      - description: 'Enter the roleId for the role whose members should be set.


          Use the Roles REST API for roleIds and descriptions.'
        in: path
        name: roleId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/ApiMemberWithDetailsDTO'
              type: array
        description: List of members to assign to this role. Provide an empty list to remove all members.
        required: true
      responses:
        '204':
          description: The role membership has been successfully updated with the provided members.
      tags:
      - Role Memberships
      summary: Set bulk role members global or repository container
      x-summary-source: derived
  /api/v2/roleMemberships/{ownerType}/role/{roleId}/{memberType}/{memberName}:
    delete:
      description: 'Use this method to revoke roles globally or on all repositories.


        Permissions required: Edit system configuration and users for a global context or view IQ elements for a non-global context'
      operationId: revokeRoleMembershipGlobalOrRepositoryContainer
      parameters:
      - description: Enter the value for ownerType. Using `global` will revoke the administrator role.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - repository_container
          - global
          pattern: global|repository_container
          type: string
      - description: Enter the roleId for the role to be revoked.
        in: path
        name: roleId
        required: true
        schema:
          type: string
      - description: Enter the value for memberType, to specify a user or a user group.
        in: path
        name: memberType
        required: true
        schema:
          enum:
          - USER
          - GROUP
          pattern: (?i:user|group)
          type: string
      - description: Enter the value for memberName. This can be a username or group name depending upon the value of memberType above.
        in: path
        name: memberName
        required: true
        schema:
          type: string
      responses:
        '204':
          description: The specified role has been revoked from the user or user group.
      tags:
      - Role Memberships
      summary: Revoke role membership global or repository container
      x-summary-source: derived
    put:
      description: 'Use this method to grant a role to a user or user group globally or on all repositories.


        Permissions required: Edit system configuration and users for a global context or edit access control for a non-global context'
      operationId: grantRoleMembershipGlobalOrRepositoryContainer
      parameters:
      - description: Enter the value for the ownerType for which you want to grant the role.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - repository_container
          - global
          pattern: global|repository_container
          type: string
      - description: 'Enter the roleId for the role to be granted.


          Use the Roles REST API for roleIds and descriptions.'
        in: path
        name: roleId
        required: true
        schema:
          type: string
      - description: Enter the value for memberType, to specify a user or a user group.
        in: path
        name: memberType
        required: true
        schema:
          enum:
          - USER
          - GROUP
          pattern: (?i:user|group)
          type: string
      - description: Enter the value for memberName. This can be a username or group name depending upon the value of memberType above.
        in: path
        name: memberName
        required: true
        schema:
          type: string
      responses:
        '204':
          description: The specified role has been granted to the users or user groups on the given context.
      tags:
      - Role Memberships
      summary: Grant role membership global or repository container
      x-summary-source: derived
  /api/v2/roleMemberships/{ownerType}/roles:
    get:
      description: 'Use this method to retrieve all role memberships for global or repository container context with full details including role names, descriptions, and member information.


        Permissions required: Edit system configuration and users for a global context or view IQ elements for a non-global context'
      operationId: getBulkRoleMembershipsGlobalOrRepositoryContainer
      parameters:
      - description: Enter the value for ownerType.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - repository_container
          - global
          pattern: global|repository_container
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiApplicableMembershipMappingsDTO'
          description: The response contains all roles with their members. Also includes a flag indicating whether group search is enabled.
      tags:
      - Role Memberships
      summary: Get bulk role memberships global or repository container
      x-summary-source: derived
  /api/v2/roleMemberships/{ownerType}/{internalOwnerId}:
    get:
      description: 'Use this method to retrieve the users, user groups and the corresponding role Ids.


        Permissions required: Edit system configuration and users for a global context or view IQ elements for a non-global context'
      operationId: getRoleMembershipsApplicationOrOrganization
      parameters:
      - description: Enter the ownerType for which you want to retrieve users and their role Ids.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - application
          - organization
          pattern: application|organization
          type: string
      - description: Enter the corresponding id for the ownerType specified above.
        in: path
        name: internalOwnerId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRoleMemberMappingListDTO'
          description: The response contains the assigned role Ids, users and user groups for the application or organization requested. It also includes members who inherit a role based on the organization hierarchy.
      tags:
      - Role Memberships
      summary: Get role memberships application or organization
      x-summary-source: derived
  /api/v2/roleMemberships/{ownerType}/{internalOwnerId}/role/{roleId}/members:
    put:
      description: 'Use this method to set all members for a specific role. This operation atomically replaces all existing members for the role with the provided list.


        Permissions required: Edit access control'
      operationId: setBulkRoleMembersNonGlobal
      parameters:
      - description: Enter the ownerType for which you want to set role members.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - application
          - organization
          - repository_manager
          - repository
          pattern: application|organization|repository_manager|repository
          type: string
      - description: Enter the id associated with the ownerType specified above. For applications, use the public ID. For organizations, repositories, and repository managers, use the internal ID.
        in: path
        name: internalOwnerId
        required: true
        schema:
          type: string
      - description: 'Enter the roleId for the role whose members should be set.


          Use the Roles REST API for roleIds and descriptions.'
        in: path
        name: roleId
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/ApiMemberWithDetailsDTO'
              type: array
        description: List of members to assign to this role. Provide an empty list to remove all members.
        required: true
      responses:
        '204':
          description: The role membership has been successfully updated with the provided members.
      tags:
      - Role Memberships
      summary: Set bulk role members non global
      x-summary-source: derived
  /api/v2/roleMemberships/{ownerType}/{internalOwnerId}/role/{roleId}/{memberType}/{memberName}:
    delete:
      description: 'Use this method to revoke a role from a user or user group, on a specific application or organization.


        Permissions required: Edit access control'
      operationId: revokeRoleMembershipApplicationOrOrganization
      parameters:
      - description: Enter the value for the ownerType for which you want to revoke the role. Using `global` will revoke the administrator role.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - application
          - organization
          pattern: application|organization
          type: string
      - description: Enter the internalId associated with the ownerType specified above.
        in: path
        name: internalOwnerId
        required: true
        schema:
          type: string
      - description: Enter the roleId for the role to be revoked.
        in: path
        name: roleId
        required: true
        schema:
          type: string
      - description: Enter the value for memberType, to specify a user or a user group.
        in: path
        name: memberType
        required: true
        schema:
          enum:
          - USER
          - GROUP
          pattern: (?i:user|group)
          type: string
      - description: Enter the value for memberName. This can be a username or group name depending upon the value of memberType above.
        in: path
        name: memberName
        required: true
        schema:
          type: string
      responses:
        '204':
          description: The specified role has been revoked from the user or user group
      tags:
      - Role Memberships
      summary: Revoke role membership application or organization
      x-summary-source: derived
    put:
      description: 'Use this method to grant a role to a user or user group for the specified application or organization.


        Permissions required: Edit access control'
      operationId: grantRoleMembershipApplicationOrOrganization
      parameters:
      - description: Enter the value for the ownerType for which you want to grant the role.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - application
          - organization
          pattern: application|organization
          type: string
      - description: Enter the value for the internalId associated with the ownerType specified above.
        in: path
        name: internalOwnerId
        required: true
        schema:
          type: string
      - description: 'Enter the roleId for the role to be granted.


          Use the Roles REST API for roleIds and descriptions.'
        in: path
        name: roleId
        required: true
        schema:
          type: string
      - description: Enter the value for memberType, to specify a user or a user group.
        in: path
        name: memberType
        required: true
        schema:
          enum:
          - USER
          - GROUP
          pattern: (?i:user|group)
          type: string
      - description: Enter the value for memberName. This can be a username or group name depending upon the value of memberType above.
        in: path
        name: memberName
        required: true
        schema:
          type: string
      - description: 'If true, attempts to validate if the specified user or group exists before assigning the role.

          If false or omitted, the request behaves as before (no validation check).'
        in: query
        name: validateMember
        schema:
          default: false
          type: boolean
      responses:
        '204':
          description: The specified roleId has been has been granted to the user or user group for the requested context.
      tags:
      - Role Memberships
      summary: Grant role membership application or organization
      x-summary-source: derived
  /api/v2/roleMemberships/{ownerType}/{internalOwnerId}/roles:
    get:
      description: 'Use this method to retrieve all role memberships with full details including role names, descriptions, and member information organized by owner (for inheritance display).


        Permissions required: Edit system configuration and users for a global context or view IQ elements for a non-global context'
      operationId: getBulkRoleMembershipsNonGlobal
      parameters:
      - description: Enter the ownerType for which you want to retrieve role memberships.
        in: path
        name: ownerType
        required: true
        schema:
          enum:
          - application
          - organization
          - repository_manager
          - repository
          pattern: application|organization|repository_manager|repository
          type: string
      - description: Enter the corresponding id for the ownerType specified above. For applications, use the public ID. For organizations, repositories, and repository managers, use the internal ID.
        in: path
        name: internalOwnerId
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiApplicableMembershipMappingsDTO'
          description: 'The response contains all roles with their members organized by owner, including inherited members from parent organizations or repository hierarchies. Also includes a flag indicating whether group search is

            enabled.'
      tags:
      - Role Memberships
      summary: Get bulk role memberships non global
      x-summary-source: derived
components:
  schemas:
    ApiRoleMemberMappingDTO:
      properties:
        members:
          items:
            $ref: '#/components/schemas/ApiMemberDTO'
          type: array
        roleId:
          type: string
      type: object
    ApiApplicableMembershipMappingsDTO:
      properties:
        groupSearchEnabled:
          type: boolean
        membersByRole:
          items:
            $ref: '#/components/schemas/ApiRoleWithMembersByOwnerDTO'
          type: array
      type: object
    ApiRoleWithMembersByOwnerDTO:
      properties:
        membersByOwner:
          items:
            $ref: '#/components/schemas/ApiMembersByOwnerDTO'
          type: array
        roleDescription:
          type: string
        roleId:
          type: string
        roleName:
          type: string
      type: object
    ApiMemberDTO:
      properties:
        ownerId:
          type: string
        ownerType:
          type: string
        type:
          enum:
          - USER
          - GROUP
          type: string
        userOrGroupName:
          type: string
      type: object
    ApiMemberWithDetailsDTO:
      properties:
        displayName:
          type: string
        email:
          type: string
        internalName:
          type: string
        realm:
          type: string
        type:
          enum:
          - USER
          - GROUP
          type: string
      type: object
    ApiMembersByOwnerDTO:
      properties:
        members:
          items:
            $ref: '#/components/schemas/ApiMemberWithDetailsDTO'
          type: array
        ownerId:
          type: string
        ownerName:
          type: string
        ownerType:
          type: string
      type: object
    ApiRoleMemberMappingListDTO:
      properties:
        memberMappings:
          items:
            $ref: '#/components/schemas/ApiRoleMemberMappingDTO'
          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