Sonatype · Capability

Sonatype Lifecycle Public REST API — Source Control

Sonatype Lifecycle Public REST API — Source Control. 8 operations. Lead operation: Source Control. Self-contained Naftiko capability covering one Sonatype business surface.

Run with Naftiko SonatypeSource Control

What You Can Do

DELETE
Deleteusermappings — Use this method to delete existing SCM user mappings for an organization.
/v1/api/v2/sourcecontrol/automaticroleassignment/usermappings/{organizationid}
POST
Addusermappings — Use this method to apply user mappings from SCM (GitHub) to Lifecycle. The user mappings will be inherited by all child organizations and applications in the organization hierarchy. If a user mapping for an organization already exists, it w
/v1/api/v2/sourcecontrol/automaticroleassignment/usermappings/{organizationid}
GET
Getusermappingsbyowner — Use this method to retrieve SCM user mappings for an organization or application.
/v1/api/v2/sourcecontrol/automaticroleassignment/usermappings/{ownertype}/{internalownerid}
POST
Automaticroleassignment — Use this method to automatically grant the supplied role to all contributors of a repository on a given application.
/v1/api/v2/sourcecontrol/automaticroleassignment/{publicid}
DELETE
Deletesourcecontrol — Use this method to delete a SCM setting for the specified ownerType/ownerId.
/v1/api/v2/sourcecontrol/{ownertype}/{internalownerid}
GET
Getsourcecontrol1 — Use this method to retrieve the source control configuration settings for an organization or an application.
/v1/api/v2/sourcecontrol/{ownertype}/{internalownerid}
POST
Addsourcecontrol — Use this method to create a source control configuration setting.
/v1/api/v2/sourcecontrol/{ownertype}/{internalownerid}
PUT
Updatesourcecontrol — Use this method to update an existing SCM setting.
/v1/api/v2/sourcecontrol/{ownertype}/{internalownerid}

MCP Tools

use-this-method-delete-existing

Use this method to delete existing SCM user mappings for an organization.

idempotent
use-this-method-apply-user

Use this method to apply user mappings from SCM (GitHub) to Lifecycle. The user mappings will be inherited by all child organizations and applications in the organization hierarchy. If a user mapping for an organization already exists, it w

use-this-method-retrieve-scm

Use this method to retrieve SCM user mappings for an organization or application.

read-only idempotent
use-this-method-automatically-grant

Use this method to automatically grant the supplied role to all contributors of a repository on a given application.

use-this-method-delete-scm

Use this method to delete a SCM setting for the specified ownerType/ownerId.

idempotent
use-this-method-retrieve-source

Use this method to retrieve the source control configuration settings for an organization or an application.

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

Use this method to create a source control configuration setting.

use-this-method-update-existing

Use this method to update an existing SCM setting.

idempotent

Capability Spec

lifecycle-source-control.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Sonatype Lifecycle Public REST API — Source Control
  description: 'Sonatype Lifecycle Public REST API — Source Control. 8 operations. Lead operation: Source Control. Self-contained
    Naftiko capability covering one Sonatype business surface.'
  tags:
  - Sonatype
  - Source Control
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SONATYPE_API_KEY: SONATYPE_API_KEY
capability:
  consumes:
  - type: http
    namespace: lifecycle-source-control
    baseUri: ''
    description: Sonatype Lifecycle Public REST API — Source Control business capability. Self-contained, no shared references.
    resources:
    - name: api-v2-sourceControl-automaticRoleAssignment-userMappings-organizationId
      path: /api/v2/sourceControl/automaticRoleAssignment/userMappings/{organizationId}
      operations:
      - name: deleteusermappings
        method: DELETE
        description: Use this method to delete existing SCM user mappings for an organization.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: organizationId
          in: path
          type: string
          description: Enter the organizationId.
          required: true
      - name: addusermappings
        method: POST
        description: Use this method to apply user mappings from SCM (GitHub) to Lifecycle. The user mappings will be inherited
          by all child organizations and applications in the organization hierarchy. If a user mapping for an organization
          already exists, it w
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: organizationId
          in: path
          type: string
          description: Enter the organizationId. Use `ROOT_ORGANIZATION_ID` for the root organization
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-v2-sourceControl-automaticRoleAssignment-userMappings-ownerType-internalOwne
      path: /api/v2/sourceControl/automaticRoleAssignment/userMappings/{ownerType}/{internalOwnerId}
      operations:
      - name: getusermappingsbyowner
        method: GET
        description: Use this method to retrieve SCM user mappings for an organization or application.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Enter the value for ownerType.
          required: true
        - name: internalOwnerId
          in: path
          type: string
          description: Enter the value for internal ownerId.
          required: true
    - name: api-v2-sourceControl-automaticRoleAssignment-publicId
      path: /api/v2/sourceControl/automaticRoleAssignment/{publicId}
      operations:
      - name: automaticroleassignment
        method: POST
        description: Use this method to automatically grant the supplied role to all contributors of a repository on a given
          application.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicId
          in: path
          type: string
          description: Enter the public applicationId for automatic role assignment.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-v2-sourceControl-ownerType-internalOwnerId
      path: /api/v2/sourceControl/{ownerType}/{internalOwnerId}
      operations:
      - name: deletesourcecontrol
        method: DELETE
        description: Use this method to delete a SCM setting for the specified ownerType/ownerId.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Enter the value for ownerType.
          required: true
        - name: internalOwnerId
          in: path
          type: string
          description: Enter the value for internal ownerId.
          required: true
      - name: getsourcecontrol1
        method: GET
        description: Use this method to retrieve the source control configuration settings for an organization or an application.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Enter the value for ownerType.
          required: true
        - name: internalOwnerId
          in: path
          type: string
          description: Enter the value for internal ownerId. Use ROOT_ORGANIZATION_ID for the root organization
          required: true
      - name: addsourcecontrol
        method: POST
        description: Use this method to create a source control configuration setting.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Enter the value for ownerType.
          required: true
        - name: internalOwnerId
          in: path
          type: string
          description: Enter the value for internal ownerId. Use ROOT_ORGANIZATION_ID for root organization.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: updatesourcecontrol
        method: PUT
        description: Use this method to update an existing SCM setting.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: Enter the value for ownerType.
          required: true
        - name: internalOwnerId
          in: path
          type: string
          description: Enter the internal ownerId. Use ROOT_ORGANIZATION_ID for the root organization.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    authentication:
      type: bearer
      token: '{{env.SONATYPE_API_KEY}}'
  exposes:
  - type: rest
    namespace: lifecycle-source-control-rest
    port: 8080
    description: REST adapter for Sonatype Lifecycle Public REST API — Source Control. One Spectral-compliant resource per
      consumed operation, prefixed with /v1.
    resources:
    - path: /v1/api/v2/sourcecontrol/automaticroleassignment/usermappings/{organizationid}
      name: api-v2-sourcecontrol-automaticroleassignment-usermappings-organizationid
      description: REST surface for api-v2-sourceControl-automaticRoleAssignment-userMappings-organizationId.
      operations:
      - method: DELETE
        name: deleteusermappings
        description: Use this method to delete existing SCM user mappings for an organization.
        call: lifecycle-source-control.deleteusermappings
        with:
          organizationId: rest.organizationId
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: addusermappings
        description: Use this method to apply user mappings from SCM (GitHub) to Lifecycle. The user mappings will be inherited
          by all child organizations and applications in the organization hierarchy. If a user mapping for an organization
          already exists, it w
        call: lifecycle-source-control.addusermappings
        with:
          organizationId: rest.organizationId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/sourcecontrol/automaticroleassignment/usermappings/{ownertype}/{internalownerid}
      name: api-v2-sourcecontrol-automaticroleassignment-usermappings-ownertype-internalowne
      description: REST surface for api-v2-sourceControl-automaticRoleAssignment-userMappings-ownerType-internalOwne.
      operations:
      - method: GET
        name: getusermappingsbyowner
        description: Use this method to retrieve SCM user mappings for an organization or application.
        call: lifecycle-source-control.getusermappingsbyowner
        with:
          ownerType: rest.ownerType
          internalOwnerId: rest.internalOwnerId
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/sourcecontrol/automaticroleassignment/{publicid}
      name: api-v2-sourcecontrol-automaticroleassignment-publicid
      description: REST surface for api-v2-sourceControl-automaticRoleAssignment-publicId.
      operations:
      - method: POST
        name: automaticroleassignment
        description: Use this method to automatically grant the supplied role to all contributors of a repository on a given
          application.
        call: lifecycle-source-control.automaticroleassignment
        with:
          publicId: rest.publicId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/sourcecontrol/{ownertype}/{internalownerid}
      name: api-v2-sourcecontrol-ownertype-internalownerid
      description: REST surface for api-v2-sourceControl-ownerType-internalOwnerId.
      operations:
      - method: DELETE
        name: deletesourcecontrol
        description: Use this method to delete a SCM setting for the specified ownerType/ownerId.
        call: lifecycle-source-control.deletesourcecontrol
        with:
          ownerType: rest.ownerType
          internalOwnerId: rest.internalOwnerId
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: getsourcecontrol1
        description: Use this method to retrieve the source control configuration settings for an organization or an application.
        call: lifecycle-source-control.getsourcecontrol1
        with:
          ownerType: rest.ownerType
          internalOwnerId: rest.internalOwnerId
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: addsourcecontrol
        description: Use this method to create a source control configuration setting.
        call: lifecycle-source-control.addsourcecontrol
        with:
          ownerType: rest.ownerType
          internalOwnerId: rest.internalOwnerId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatesourcecontrol
        description: Use this method to update an existing SCM setting.
        call: lifecycle-source-control.updatesourcecontrol
        with:
          ownerType: rest.ownerType
          internalOwnerId: rest.internalOwnerId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: lifecycle-source-control-mcp
    port: 9090
    transport: http
    description: MCP adapter for Sonatype Lifecycle Public REST API — Source Control. One tool per consumed operation, routed
      inline through this capability's consumes block.
    tools:
    - name: use-this-method-delete-existing
      description: Use this method to delete existing SCM user mappings for an organization.
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: lifecycle-source-control.deleteusermappings
      with:
        organizationId: tools.organizationId
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-apply-user
      description: Use this method to apply user mappings from SCM (GitHub) to Lifecycle. The user mappings will be inherited
        by all child organizations and applications in the organization hierarchy. If a user mapping for an organization already
        exists, it w
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: lifecycle-source-control.addusermappings
      with:
        organizationId: tools.organizationId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-retrieve-scm
      description: Use this method to retrieve SCM user mappings for an organization or application.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: lifecycle-source-control.getusermappingsbyowner
      with:
        ownerType: tools.ownerType
        internalOwnerId: tools.internalOwnerId
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-automatically-grant
      description: Use this method to automatically grant the supplied role to all contributors of a repository on a given
        application.
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: lifecycle-source-control.automaticroleassignment
      with:
        publicId: tools.publicId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-delete-scm
      description: Use this method to delete a SCM setting for the specified ownerType/ownerId.
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: lifecycle-source-control.deletesourcecontrol
      with:
        ownerType: tools.ownerType
        internalOwnerId: tools.internalOwnerId
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-retrieve-source
      description: Use this method to retrieve the source control configuration settings for an organization or an application.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: lifecycle-source-control.getsourcecontrol1
      with:
        ownerType: tools.ownerType
        internalOwnerId: tools.internalOwnerId
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-create-source
      description: Use this method to create a source control configuration setting.
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: lifecycle-source-control.addsourcecontrol
      with:
        ownerType: tools.ownerType
        internalOwnerId: tools.internalOwnerId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-update-existing
      description: Use this method to update an existing SCM setting.
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: lifecycle-source-control.updatesourcecontrol
      with:
        ownerType: tools.ownerType
        internalOwnerId: tools.internalOwnerId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.