Sonatype Nexus Repository Security management: user tokens API

The Security management: user tokens API from Sonatype Nexus Repository — 2 operation(s) for security management: user tokens.

Operations 4

GET /v1/security/user-tokens/tokens List user tokens or look up a token owner by nameCode #
GET /v1/security/user-tokens Show if the user token capability is enabled or not #
PUT /v1/security/user-tokens Update security user tokens #
DELETE /v1/security/user-tokens Delete security user tokens #

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/nexus:nexus-security-management-user-tokens-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. See our Privacy Policy and Terms.

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

OpenAPI Specification

nexus-security-management-user-tokens-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: 'Nexus Repository Manager REST Security management: user…'
  version: 3.97.2-02
servers:
- url: /service/rest
tags:
- name: 'Security management: user tokens'
paths:
  /v1/security/user-tokens/tokens:
    get:
      tags:
      - 'Security management: user tokens'
      summary: List user tokens or look up a token owner by nameCode
      description: 'Without ''nameCode'': lists all tokens with optional realm/userId filters and pagination. Returns metadata only — passCode is never returned. With ''nameCode'': switches to single-token lookup mode. Returns a single UserTokenXO (200) if the nameCode exists (expired tokens included), or 404 if not found. The userId, includeExpired, skip, and limit parameters are ignored in lookup mode.'
      operationId: listSecurityUserTokensTokens
      parameters:
      - name: realm
        in: query
        description: Filter by realm (optional). Also acts as a realm constraint in nameCode lookup mode.
        schema:
          type: string
      - name: userId
        in: query
        description: Filter by user ID (optional). Ignored when 'nameCode' is provided.
        schema:
          type: string
      - name: nameCode
        in: query
        description: Look up the token owner by nameCode. When present, the endpoint resolves a single token and returns 404 if not found. Expired tokens are always included in lookup results.
        schema:
          type: string
      - name: includeExpired
        in: query
        description: 'Include expired tokens in list results (default: false). Ignored in nameCode lookup mode — expired tokens are always included.'
        schema:
          type: boolean
      - name: skip
        in: query
        description: 'Number of items to skip for pagination (default: 0). Ignored in lookup mode.'
        schema:
          type: integer
          format: int32
      - name: limit
        in: query
        description: 'Maximum number of items to return (default: 25, max: 100). Ignored in lookup mode.'
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Success. In list mode (no 'nameCode' param) returns UserTokenListXO. In lookup mode ('nameCode' present) returns a single UserTokenXO.
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/UserTokenListXO'
                - $ref: '#/components/schemas/UserTokenXO'
        '400':
          description: Invalid request parameters, or user token capability is disabled.
        '403':
          description: Insufficient privileges to view or audit user tokens.
        '404':
          description: No user token found with the given nameCode. Only returned when 'nameCode' is provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleApiResponse'
        '500':
          description: Unexpected server error. Please try again later.
  /v1/security/user-tokens:
    get:
      tags:
      - 'Security management: user tokens'
      summary: Show if the user token capability is enabled or not
      operationId: listSecurityUserTokens
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokensApiModel'
    put:
      tags:
      - 'Security management: user tokens'
      operationId: updateSecurityUserTokens
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserTokensApiModel'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTokensApiModel'
      summary: Update security user tokens
      x-summary-source: derived
    delete:
      tags:
      - 'Security management: user tokens'
      operationId: deleteSecurityUserTokens
      responses:
        '200':
          description: successful operation
          content:
            application/json: {}
      summary: Delete security user tokens
      x-summary-source: derived
components:
  schemas:
    UserTokensApiModel:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether or not User Tokens feature is enabled
        protectContent:
          type: boolean
          description: Additionally require user tokens for repository authentication
        expirationEnabled:
          type: boolean
          description: Enable user tokens expiration
        expirationDays:
          maximum: 999
          minimum: 1
          type: integer
          description: Set user token expiration days (E.g., 1-999)
          format: int32
          example: 30
    UserTokenXO:
      required:
      - created
      - nameCode
      type: object
      properties:
        userId:
          type: string
        realm:
          type: string
        nameCode:
          type: string
        passCode:
          type: string
        created:
          type: string
          format: date-time
        expires:
          type: string
          format: date-time
        isExpired:
          type: boolean
        createdByUserId:
          type: string
        createdByRealm:
          type: string
      xml:
        name: userToken
    UserTokenListXO:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/UserTokenXO'
        continuationToken:
          type: string
      xml:
        name: userTokenList
    SimpleApiResponse:
      type: object
      properties:
        status:
          type: integer
          format: int32
        message:
          type: string
        data:
          type: object