Sonatype Nexus Repository Cleanup policies API

The Cleanup policies API from Sonatype Nexus Repository — 3 operation(s) for cleanup policies.

Operations 5

GET /v1/cleanup-policies Get a list of existing policies #
POST /v1/cleanup-policies Create a new policy #
GET /v1/cleanup-policies/{name} Get a policy by name #
DELETE /v1/cleanup-policies/{name} Delete cleanup policy #
PUT /v1/cleanup-policies/{policyName} Update existing policy #

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-cleanup-policies-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-cleanup-policies-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nexus Repository Manager REST Cleanup policies API
  version: 3.97.2-02
servers:
- url: /service/rest
tags:
- name: Cleanup policies
paths:
  /v1/cleanup-policies:
    get:
      tags:
      - Cleanup policies
      summary: Get a list of existing policies
      operationId: listCleanupPolicies
      responses:
        '200':
          description: The list of existing policies
    post:
      tags:
      - Cleanup policies
      summary: Create a new policy
      operationId: createCleanupPolicies
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CleanupPolicyResourceXO'
        required: true
      responses:
        '400':
          description: Given payload has invalid data
        '409':
          description: Given policy name already exists
        '201':
          description: Policy was successfully created
  /v1/cleanup-policies/{name}:
    get:
      tags:
      - Cleanup policies
      summary: Get a policy by name
      operationId: getCleanupPolicies
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Policy if exists
    delete:
      tags:
      - Cleanup policies
      summary: Delete cleanup policy
      operationId: deleteCleanupPolicies
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      responses:
        '404':
          description: The policy with the given name not found
        '204':
          description: Given policy successfully deleted
  /v1/cleanup-policies/{policyName}:
    put:
      tags:
      - Cleanup policies
      summary: Update existing policy
      operationId: updateCleanupPolicies
      parameters:
      - name: policyName
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CleanupPolicyResourceXO'
        required: true
      responses:
        '400':
          description: Given payload has invalid data
        '404':
          description: Given policy name does not exist
        '204':
          description: Policy was successfully updated
components:
  schemas:
    CleanupPolicyResourceXO:
      required:
      - format
      - name
      type: object
      properties:
        notes:
          type: string
          description: description
        criteriaLastBlobUpdated:
          type: integer
          description: component age (Components published over “x” days ago (e.g 1-999))
          format: int64
        criteriaLastDownloaded:
          type: integer
          description: component usage (Components downloaded in “x” amount of days (e.g 1-999))
          format: int64
        criteriaReleaseType:
          type: string
          description: release type (Remove components that are of the following release type:)
          enum:
          - RELEASES
          - PRERELEASES
          - RELEASES_AND_PRERELEASES
        criteriaAssetRegex:
          type: string
          description: asset name matcher (Remove components that have at least one asset name matching the following regular expression pattern:)
        retain:
          minimum: 1
          type: integer
          description: keep the latest "x" number of versions
          format: int32
        repositories:
          type: array
          description: Repositories to attach this policy to. When provided on update, replaces the existing attachment set.
          items:
            type: string
            description: Repositories to attach this policy to. When provided on update, replaces the existing attachment set.
        name:
          maxLength: 255
          minLength: 0
          pattern: ^[a-zA-Z0-9\-]{1}[a-zA-Z0-9_\-\.]*$
          type: string
          description: policy name
        format:
          minLength: 1
          type: string
          description: repository format