Sonatype · Capability

Sonatype Lifecycle Public REST API — Component Labels

Sonatype Lifecycle Public REST API — Component Labels. 6 operations. Lead operation: Component Labels. Self-contained Naftiko capability covering one Sonatype business surface.

Run with Naftiko SonatypeComponent Labels

What You Can Do

GET
Getlabels — Use this method to retrieve the details for component labels for an application, organization or a repository.
/v1/api/v2/labels/{ownertype}/{ownerid}
POST
Addlabel — Use this method to create and assign a component label to an application, organization or repository.
/v1/api/v2/labels/{ownertype}/{ownerid}
PUT
Updatelabel — Use this method to update an existing component label for an application, organization or repository.
/v1/api/v2/labels/{ownertype}/{ownerid}
GET
Getapplicablelabels — Use this method to retrieve all component labels that are applicable to the specified application, organization or repository.
/v1/api/v2/labels/{ownertype}/{ownerid}/applicable
GET
Getapplicablecontexts — Use this method to retrieve the hierarchy of owners (applications, organizations, repositories) in which the label can be applied.
/v1/api/v2/labels/{ownertype}/{ownerid}/applicable/context/{labelid}
DELETE
Deletelabel — Use this method to delete an existing component label.
/v1/api/v2/labels/{ownertype}/{ownerid}/{labelid}

MCP Tools

use-this-method-retrieve-details

Use this method to retrieve the details for component labels for an application, organization or a repository.

read-only idempotent
use-this-method-create-and

Use this method to create and assign a component label to an application, organization or repository.

use-this-method-update-existing

Use this method to update an existing component label for an application, organization or repository.

idempotent
use-this-method-retrieve-all

Use this method to retrieve all component labels that are applicable to the specified application, organization or repository.

read-only idempotent
use-this-method-retrieve-hierarchy

Use this method to retrieve the hierarchy of owners (applications, organizations, repositories) in which the label can be applied.

read-only idempotent
use-this-method-delete-existing

Use this method to delete an existing component label.

idempotent

Capability Spec

lifecycle-component-labels.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Sonatype Lifecycle Public REST API — Component Labels
  description: 'Sonatype Lifecycle Public REST API — Component Labels. 6 operations. Lead operation: Component Labels. Self-contained
    Naftiko capability covering one Sonatype business surface.'
  tags:
  - Sonatype
  - Component Labels
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SONATYPE_API_KEY: SONATYPE_API_KEY
capability:
  consumes:
  - type: http
    namespace: lifecycle-component-labels
    baseUri: ''
    description: Sonatype Lifecycle Public REST API — Component Labels business capability. Self-contained, no shared references.
    resources:
    - name: api-v2-labels-ownerType-ownerId
      path: /api/v2/labels/{ownerType}/{ownerId}
      operations:
      - name: getlabels
        method: GET
        description: Use this method to retrieve the details for component labels for an application, organization or a repository.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Select the `ownerType` for which you want to retrieve the component label information.
          required: true
        - name: ownerId
          in: path
          type: string
          description: Enter the id of the application, organization or the repository.
          required: true
        - name: inherit
          in: query
          type: boolean
          description: Set to `true` to retrieve inherited component labels.
      - name: addlabel
        method: POST
        description: Use this method to create and assign a component label to an application, organization or repository.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Select the ownerType to which the label will be assigned.
          required: true
        - name: ownerId
          in: path
          type: string
          description: Enter the id for the selected ownerType.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: updatelabel
        method: PUT
        description: Use this method to update an existing component label for an application, organization or repository.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Select the ownerType for which the label will be updated.
          required: true
        - name: ownerId
          in: path
          type: string
          description: Enter the id for the selected ownerType.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-v2-labels-ownerType-ownerId-applicable
      path: /api/v2/labels/{ownerType}/{ownerId}/applicable
      operations:
      - name: getapplicablelabels
        method: GET
        description: Use this method to retrieve all component labels that are applicable to the specified application, organization
          or repository.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Select the ownerType to retrieve the component label information for.
          required: true
        - name: ownerId
          in: path
          type: string
          description: Enter the id for the application, organization or repository
          required: true
    - name: api-v2-labels-ownerType-ownerId-applicable-context-labelId
      path: /api/v2/labels/{ownerType}/{ownerId}/applicable/context/{labelId}
      operations:
      - name: getapplicablecontexts
        method: GET
        description: Use this method to retrieve the hierarchy of owners (applications, organizations, repositories) in which
          the label can be applied.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Select the ownerType.
          required: true
        - name: ownerId
          in: path
          type: string
          description: Enter the ownerId
          required: true
        - name: labelId
          in: path
          type: string
          description: Enter the labelId
          required: true
    - name: api-v2-labels-ownerType-ownerId-labelId
      path: /api/v2/labels/{ownerType}/{ownerId}/{labelId}
      operations:
      - name: deletelabel
        method: DELETE
        description: Use this method to delete an existing component label.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Select the ownerType for which the label will be deleted.
          required: true
        - name: ownerId
          in: path
          type: string
          description: Enter the id for the selected ownerType.
          required: true
        - name: labelId
          in: path
          type: string
          description: Enter the id for the label to be deleted.
          required: true
    authentication:
      type: bearer
      token: '{{env.SONATYPE_API_KEY}}'
  exposes:
  - type: rest
    namespace: lifecycle-component-labels-rest
    port: 8080
    description: REST adapter for Sonatype Lifecycle Public REST API — Component Labels. One Spectral-compliant resource per
      consumed operation, prefixed with /v1.
    resources:
    - path: /v1/api/v2/labels/{ownertype}/{ownerid}
      name: api-v2-labels-ownertype-ownerid
      description: REST surface for api-v2-labels-ownerType-ownerId.
      operations:
      - method: GET
        name: getlabels
        description: Use this method to retrieve the details for component labels for an application, organization or a repository.
        call: lifecycle-component-labels.getlabels
        with:
          ownerType: rest.ownerType
          ownerId: rest.ownerId
          inherit: rest.inherit
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: addlabel
        description: Use this method to create and assign a component label to an application, organization or repository.
        call: lifecycle-component-labels.addlabel
        with:
          ownerType: rest.ownerType
          ownerId: rest.ownerId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatelabel
        description: Use this method to update an existing component label for an application, organization or repository.
        call: lifecycle-component-labels.updatelabel
        with:
          ownerType: rest.ownerType
          ownerId: rest.ownerId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/labels/{ownertype}/{ownerid}/applicable
      name: api-v2-labels-ownertype-ownerid-applicable
      description: REST surface for api-v2-labels-ownerType-ownerId-applicable.
      operations:
      - method: GET
        name: getapplicablelabels
        description: Use this method to retrieve all component labels that are applicable to the specified application, organization
          or repository.
        call: lifecycle-component-labels.getapplicablelabels
        with:
          ownerType: rest.ownerType
          ownerId: rest.ownerId
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/labels/{ownertype}/{ownerid}/applicable/context/{labelid}
      name: api-v2-labels-ownertype-ownerid-applicable-context-labelid
      description: REST surface for api-v2-labels-ownerType-ownerId-applicable-context-labelId.
      operations:
      - method: GET
        name: getapplicablecontexts
        description: Use this method to retrieve the hierarchy of owners (applications, organizations, repositories) in which
          the label can be applied.
        call: lifecycle-component-labels.getapplicablecontexts
        with:
          ownerType: rest.ownerType
          ownerId: rest.ownerId
          labelId: rest.labelId
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/labels/{ownertype}/{ownerid}/{labelid}
      name: api-v2-labels-ownertype-ownerid-labelid
      description: REST surface for api-v2-labels-ownerType-ownerId-labelId.
      operations:
      - method: DELETE
        name: deletelabel
        description: Use this method to delete an existing component label.
        call: lifecycle-component-labels.deletelabel
        with:
          ownerType: rest.ownerType
          ownerId: rest.ownerId
          labelId: rest.labelId
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: lifecycle-component-labels-mcp
    port: 9090
    transport: http
    description: MCP adapter for Sonatype Lifecycle Public REST API — Component Labels. One tool per consumed operation, routed
      inline through this capability's consumes block.
    tools:
    - name: use-this-method-retrieve-details
      description: Use this method to retrieve the details for component labels for an application, organization or a repository.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: lifecycle-component-labels.getlabels
      with:
        ownerType: tools.ownerType
        ownerId: tools.ownerId
        inherit: tools.inherit
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-create-and
      description: Use this method to create and assign a component label to an application, organization or repository.
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: lifecycle-component-labels.addlabel
      with:
        ownerType: tools.ownerType
        ownerId: tools.ownerId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-update-existing
      description: Use this method to update an existing component label for an application, organization or repository.
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: lifecycle-component-labels.updatelabel
      with:
        ownerType: tools.ownerType
        ownerId: tools.ownerId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-retrieve-all
      description: Use this method to retrieve all component labels that are applicable to the specified application, organization
        or repository.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: lifecycle-component-labels.getapplicablelabels
      with:
        ownerType: tools.ownerType
        ownerId: tools.ownerId
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-retrieve-hierarchy
      description: Use this method to retrieve the hierarchy of owners (applications, organizations, repositories) in which
        the label can be applied.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: lifecycle-component-labels.getapplicablecontexts
      with:
        ownerType: tools.ownerType
        ownerId: tools.ownerId
        labelId: tools.labelId
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-delete-existing
      description: Use this method to delete an existing component label.
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: lifecycle-component-labels.deletelabel
      with:
        ownerType: tools.ownerType
        ownerId: tools.ownerId
        labelId: tools.labelId
      outputParameters:
      - type: object
        mapping: $.