Microsoft Purview · Capability

Microsoft Purview Records Management API — Retention Labels

Microsoft Purview Records Management API — Retention Labels. 5 operations. Lead operation: Microsoft Purview List retention labels. Self-contained Naftiko capability covering one Microsoft Purview business surface.

Run with Naftiko Microsoft PurviewRetention Labels

What You Can Do

GET
Listretentionlabels — Microsoft Purview List retention labels
/v1/security/labels/retentionlabels
POST
Createretentionlabel — Microsoft Purview Create a retention label
/v1/security/labels/retentionlabels
GET
Getretentionlabel — Microsoft Purview Get a retention label
/v1/security/labels/retentionlabels/{retentionlabelid}
PATCH
Updateretentionlabel — Microsoft Purview Update a retention label
/v1/security/labels/retentionlabels/{retentionlabelid}
DELETE
Deleteretentionlabel — Microsoft Purview Delete a retention label
/v1/security/labels/retentionlabels/{retentionlabelid}

MCP Tools

microsoft-purview-list-retention-labels

Microsoft Purview List retention labels

read-only idempotent
microsoft-purview-create-retention-label

Microsoft Purview Create a retention label

microsoft-purview-get-retention-label

Microsoft Purview Get a retention label

read-only idempotent
microsoft-purview-update-retention-label

Microsoft Purview Update a retention label

idempotent
microsoft-purview-delete-retention-label

Microsoft Purview Delete a retention label

idempotent

Capability Spec

records-management-retention-labels.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Microsoft Purview Records Management API — Retention Labels
  description: 'Microsoft Purview Records Management API — Retention Labels. 5 operations. Lead operation: Microsoft Purview
    List retention labels. Self-contained Naftiko capability covering one Microsoft Purview business surface.'
  tags:
  - Microsoft Purview
  - Retention Labels
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    MICROSOFT_PURVIEW_API_KEY: MICROSOFT_PURVIEW_API_KEY
capability:
  consumes:
  - type: http
    namespace: records-management-retention-labels
    baseUri: https://graph.microsoft.com/v1.0
    description: Microsoft Purview Records Management API — Retention Labels business capability. Self-contained, no shared
      references.
    resources:
    - name: security-labels-retentionLabels
      path: /security/labels/retentionLabels
      operations:
      - name: listretentionlabels
        method: GET
        description: Microsoft Purview List retention labels
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: $top
          in: query
          type: integer
        - name: $skip
          in: query
          type: integer
        - name: $filter
          in: query
          type: string
        - name: $select
          in: query
          type: string
        - name: $orderby
          in: query
          type: string
        - name: $expand
          in: query
          type: string
          description: Expand related entities (e.g., retentionEventType, descriptors)
      - name: createretentionlabel
        method: POST
        description: Microsoft Purview Create a retention label
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: security-labels-retentionLabels-retentionLabelId
      path: /security/labels/retentionLabels/{retentionLabelId}
      operations:
      - name: getretentionlabel
        method: GET
        description: Microsoft Purview Get a retention label
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: retentionLabelId
          in: path
          type: string
          required: true
        - name: $expand
          in: query
          type: string
      - name: updateretentionlabel
        method: PATCH
        description: Microsoft Purview Update a retention label
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: retentionLabelId
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deleteretentionlabel
        method: DELETE
        description: Microsoft Purview Delete a retention label
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: retentionLabelId
          in: path
          type: string
          required: true
    authentication:
      type: bearer
      token: '{{env.MICROSOFT_PURVIEW_API_KEY}}'
  exposes:
  - type: rest
    namespace: records-management-retention-labels-rest
    port: 8080
    description: REST adapter for Microsoft Purview Records Management API — Retention Labels. One Spectral-compliant resource
      per consumed operation, prefixed with /v1.
    resources:
    - path: /v1/security/labels/retentionlabels
      name: security-labels-retentionlabels
      description: REST surface for security-labels-retentionLabels.
      operations:
      - method: GET
        name: listretentionlabels
        description: Microsoft Purview List retention labels
        call: records-management-retention-labels.listretentionlabels
        with:
          $top: rest.$top
          $skip: rest.$skip
          $filter: rest.$filter
          $select: rest.$select
          $orderby: rest.$orderby
          $expand: rest.$expand
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createretentionlabel
        description: Microsoft Purview Create a retention label
        call: records-management-retention-labels.createretentionlabel
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/security/labels/retentionlabels/{retentionlabelid}
      name: security-labels-retentionlabels-retentionlabelid
      description: REST surface for security-labels-retentionLabels-retentionLabelId.
      operations:
      - method: GET
        name: getretentionlabel
        description: Microsoft Purview Get a retention label
        call: records-management-retention-labels.getretentionlabel
        with:
          retentionLabelId: rest.retentionLabelId
          $expand: rest.$expand
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updateretentionlabel
        description: Microsoft Purview Update a retention label
        call: records-management-retention-labels.updateretentionlabel
        with:
          retentionLabelId: rest.retentionLabelId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deleteretentionlabel
        description: Microsoft Purview Delete a retention label
        call: records-management-retention-labels.deleteretentionlabel
        with:
          retentionLabelId: rest.retentionLabelId
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: records-management-retention-labels-mcp
    port: 9090
    transport: http
    description: MCP adapter for Microsoft Purview Records Management API — Retention Labels. One tool per consumed operation,
      routed inline through this capability's consumes block.
    tools:
    - name: microsoft-purview-list-retention-labels
      description: Microsoft Purview List retention labels
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: records-management-retention-labels.listretentionlabels
      with:
        $top: tools.$top
        $skip: tools.$skip
        $filter: tools.$filter
        $select: tools.$select
        $orderby: tools.$orderby
        $expand: tools.$expand
      outputParameters:
      - type: object
        mapping: $.
    - name: microsoft-purview-create-retention-label
      description: Microsoft Purview Create a retention label
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: records-management-retention-labels.createretentionlabel
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: microsoft-purview-get-retention-label
      description: Microsoft Purview Get a retention label
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: records-management-retention-labels.getretentionlabel
      with:
        retentionLabelId: tools.retentionLabelId
        $expand: tools.$expand
      outputParameters:
      - type: object
        mapping: $.
    - name: microsoft-purview-update-retention-label
      description: Microsoft Purview Update a retention label
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: records-management-retention-labels.updateretentionlabel
      with:
        retentionLabelId: tools.retentionLabelId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: microsoft-purview-delete-retention-label
      description: Microsoft Purview Delete a retention label
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: records-management-retention-labels.deleteretentionlabel
      with:
        retentionLabelId: tools.retentionLabelId
      outputParameters:
      - type: object
        mapping: $.