Sonatype User Tokens API

Use this REST API to manage user tokens.

Operations 8

GET /api/v2/userTokens #
DELETE /api/v2/userTokens/currentUser #
POST /api/v2/userTokens/currentUser #
GET /api/v2/userTokens/currentUser/createTime #
GET /api/v2/userTokens/currentUser/hasToken #
DELETE /api/v2/userTokens/purge #
DELETE /api/v2/userTokens/userCode/{userCode} #
GET /api/v2/userTokens/{username} #

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-user-tokens-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

sonatype-user-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sonatype Lifecycle Public REST Advanced Search User Tokens 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 manage user tokens.
  name: User Tokens
paths:
  /api/v2/userTokens:
    get:
      description: 'Use this method to retrieve user tokens created within a date range, in the supported IQ Server realms.


        Permissions required: Edit System Configuration and Users.'
      operationId: getUserTokensByCreatedBetweenAndRealmId
      parameters:
      - description: Enter the start date for the date range in `yyyy-mm-dd` format.
        in: query
        name: createdAfter
        schema:
          type: string
      - description: Enter the end date for the date range in `yyyy-mm-dd` format.
        in: query
        name: createdBefore
        schema:
          type: string
      - description: Enter the `realmId`. Possible values are `Internal`, `SAML` , `OAUTH2`, and `Crowd`.
        in: query
        name: realm
        schema:
          default: Internal
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ApiUserTokenDTO'
                type: array
          description: The response contains a list of user tokens, each containing a `userCode`, `username` and the name of the IQ server `realm`.
      tags:
      - User Tokens
  /api/v2/userTokens/currentUser:
    delete:
      description: 'Use this method to delete an existing user token for the currently logged in user.


        Permissions required: None'
      operationId: deleteCurrentUserToken
      responses:
        '204':
          description: User token deleted successfully.
      tags:
      - User Tokens
    post:
      description: 'Use this method to generate a user token for the currently logged in user.


        Permissions required: None'
      operationId: createUserToken
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUserTokenDTO'
          description: The response contains the generated user token consisting of `userCode`, `username` `passCode`, and the IQ Server `realm`.
      tags:
      - User Tokens
  /api/v2/userTokens/currentUser/createTime:
    get:
      description: 'Use this method to retrieve the creation time of the user token for the currently logged in user.


        Permissions required: None'
      operationId: getCurrentUserTokenCreateTime
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
          description: The response contains the token creation time in ISO format.
        '404':
          description: User token does not exist for the current user.
      tags:
      - User Tokens
  /api/v2/userTokens/currentUser/hasToken:
    get:
      description: 'Use this method to check if a user token has been issued to the logged in user.


        Permissions required: None '
      operationId: getUserTokenExistsForCurrentUser
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUserTokenExistsDTO'
          description: The response contains a `userTokenExists` field.
      tags:
      - User Tokens
  /api/v2/userTokens/purge:
    delete:
      description: 'Use this method to delete all existing LDAP user tokens.


        Permissions required: Edit System Configuration and Users'
      operationId: purgeUserTokens
      responses:
        '204':
          description: User tokens purged successfully.
      tags:
      - User Tokens
  /api/v2/userTokens/userCode/{userCode}:
    delete:
      description: 'Use this method to delete an existing user token by specifying the userCode.


        Permissions required: Edit System Configuration and Users'
      operationId: deleteUserTokenByUserCode
      parameters:
      - description: Enter the `userCode` to be deleted.
        in: path
        name: userCode
        required: true
        schema:
          type: string
      responses:
        '204':
          description: User token deleted successfully.
      tags:
      - User Tokens
  /api/v2/userTokens/{username}:
    get:
      description: 'Use this method to retrieve a user token by specifying a username and realmId.


        Permissions required: Edit System Configuration and Users'
      operationId: getUserTokenByUsernameAndRealmId
      parameters:
      - description: Enter the username.
        in: path
        name: username
        required: true
        schema:
          type: string
      - description: Enter the realmId. Possible values are `Internal`, `SAML` , `OAUTH2` , and `Crowd`.
        in: query
        name: realm
        schema:
          default: Internal
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUserTokenDTO'
          description: The response contains the `userCode`, `username` and the name of the IQ server `realm`.
      tags:
      - User Tokens
components:
  schemas:
    ApiUserTokenDTO:
      properties:
        createTime:
          type: string
        expirationDate:
          format: date-time
          type: string
        lastAccessTime:
          type: string
        passCode:
          type: string
        realm:
          type: string
        userCode:
          type: string
        username:
          type: string
      type: object
    ApiUserTokenExistsDTO:
      properties:
        userTokenExists:
          type: boolean
      type: object
  securitySchemes:
    BasicAuth:
      scheme: basic
      type: http
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http