Microsoft Purview Classification Rules API

The Classification Rules API from Microsoft Purview — 4 operation(s) for classification rules.

GitHub OpenAPI
Business capability
Data Governance Management BC-610.10

Operations 10

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

PUT /scan/classificationrules/{classificationRuleName} Create or replace a classification rule · Microsoft Purview Create or replace a classification rule #
Ask an LLM
“How do I define a custom classification rule for scanning?”
“Can I overwrite an existing classification rule with a new definition?”
Tell an agent
Create classification rule {rule} of kind {kind}.
Replace classification rule {rule} with properties {props}.
GET /scan/classificationrules/{classificationRuleName} Get a classification rule · Microsoft Purview Get a classification rule #
Ask an LLM
“How is a specific custom classification rule configured?”
“Can I see the kind and properties of one classification rule by name?”
Tell an agent
Show me classification rule {rule}.
Get the definition of the {rule} classification rule.
DELETE /scan/classificationrules/{classificationRuleName} Delete a classification rule · Microsoft Purview Delete a classification rule #
Ask an LLM
“Can I remove a custom classification rule I no longer want applied?”
“What is the way to drop a classification rule from my account?”
Tell an agent destructive · confirm first
Delete classification rule {rule}.
Remove the {rule} classification rule from the account.
GET /scan/classificationrules List classification rules · Microsoft Purview List classification rules #
Ask an LLM
“Which classification rules are defined in my Purview account?”
“What custom classifications does our scanner know about?”
Tell an agent
List all classification rules in the account.
List classification rules using API version {version}.
GET /classificationrules/{classificationRuleName} Classification rules get #
PUT /classificationrules/{classificationRuleName} Classification rules create or replace #
DELETE /classificationrules/{classificationRuleName} Classification rules delete #
GET /classificationrules Classification rules list #
GET /classificationrules/{classificationRuleName}/versions Classification rules list versions by rule name #
POST /classificationrules/{classificationRuleName}/versions/{classificationRuleVersion}:tag Classification rules tag classification version #

Documentation

📖
Documentation
https://learn.microsoft.com/en-us/rest/api/purview/
📖
Authentication
https://learn.microsoft.com/en-us/purview/tutorial-using-rest-apis
📖
GettingStarted
https://learn.microsoft.com/en-us/purview/data-gov-api-create-assets
📖
Authentication
https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow
📖
GettingStarted
https://learn.microsoft.com/en-us/purview/legacy/how-to-purview-custom-lineage-api-user-guide
📖
GettingStarted
https://learn.microsoft.com/en-us/purview/legacy/tutorial-metadata-policy-collections-apis
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/purview/unified-catalog-api-overview
📖
Authentication
https://learn.microsoft.com/en-us/purview/data-gov-api-rest-data-plane
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/purview/unified-catalog-data-quality
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/security-ediscovery-apioverview?view=graph-rest-1.0
📖
Authentication
https://learn.microsoft.com/en-us/graph/security-ediscovery-appauthsetup
📖
GettingStarted
https://learn.microsoft.com/en-us/purview/edisc-ref-api-guide
📖
Documentation
https://learn.microsoft.com/en-us/graph/security-information-protection-overview
📖
Documentation
https://learn.microsoft.com/en-us/graph/security-datasecurityandgovernance-overview
📖
GettingStarted
https://learn.microsoft.com/en-us/purview/developer/use-the-api
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/security-recordsmanagement-overview?view=graph-rest-1.0

Specifications

Schemas & Data

Other Resources

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/microsoft-purview:microsoft-purview-classification-rules-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

microsoft-purview-classification-rules-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Microsoft Purview Scanning Classification Rules API
  description: APIs for configuring and managing scans of data sources to automatically discover and catalog data assets. Supports registering data sources and scheduling automated scans across your data estate.
  version: 2023-09-01
  contact:
    name: Microsoft Purview Support
    url: https://learn.microsoft.com/en-us/purview/
  license:
    name: Microsoft API License
    url: https://azure.microsoft.com/en-us/support/legal/
servers:
- url: https://{accountName}.scan.purview.azure.com
  description: Microsoft Purview Scanning API endpoint
  variables:
    accountName:
      description: The name of the Microsoft Purview account
      default: myaccount
security:
- oauth2: []
tags:
- name: Classification Rules
  description: Operations for managing classification rules
paths:
  /scan/classificationrules/{classificationRuleName}:
    put:
      operationId: createOrReplaceClassificationRule
      summary: Microsoft Purview Create or replace a classification rule
      description: Creates or replaces a classification rule.
      tags:
      - Classification Rules
      parameters:
      - name: classificationRuleName
        in: path
        required: true
        schema:
          type: string
      - name: api-version
        in: query
        required: true
        schema:
          type: string
          default: '2023-09-01'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClassificationRule'
      responses:
        '200':
          description: Classification rule updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRule'
        '201':
          description: Classification rule created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRule'
        '401':
          description: Unauthorized
    get:
      operationId: getClassificationRule
      summary: Microsoft Purview Get a classification rule
      description: Gets a classification rule by name.
      tags:
      - Classification Rules
      parameters:
      - name: classificationRuleName
        in: path
        required: true
        schema:
          type: string
      - name: api-version
        in: query
        required: true
        schema:
          type: string
          default: '2023-09-01'
      responses:
        '200':
          description: Classification rule retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRule'
        '401':
          description: Unauthorized
        '404':
          description: Classification rule not found
    delete:
      operationId: deleteClassificationRule
      summary: Microsoft Purview Delete a classification rule
      description: Deletes a classification rule.
      tags:
      - Classification Rules
      parameters:
      - name: classificationRuleName
        in: path
        required: true
        schema:
          type: string
      - name: api-version
        in: query
        required: true
        schema:
          type: string
          default: '2023-09-01'
      responses:
        '200':
          description: Classification rule deleted successfully
        '401':
          description: Unauthorized
        '404':
          description: Classification rule not found
  /scan/classificationrules:
    get:
      operationId: listClassificationRules
      summary: Microsoft Purview List classification rules
      description: Lists classification rules in the account.
      tags:
      - Classification Rules
      parameters:
      - name: api-version
        in: query
        required: true
        schema:
          type: string
          default: '2023-09-01'
      responses:
        '200':
          description: Classification rules listed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRuleList'
        '401':
          description: Unauthorized
  /classificationrules/{classificationRuleName}:
    get:
      tags:
      - Classification Rules
      description: Gets a classification rule.
      operationId: ClassificationRules_Get
      parameters:
      - $ref: '#/components/parameters/classificationRuleName'
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRule'
        default:
          description: An error response received from the Scanning Service.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
      summary: Classification rules get
      x-summary-source: derived
    put:
      tags:
      - Classification Rules
      description: Creates or replaces a classification rule.
      operationId: ClassificationRules_CreateOrReplace
      parameters:
      - $ref: '#/components/parameters/classificationRuleName'
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRule'
        '201':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRule'
        default:
          description: An error response received from the Scanning Service.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClassificationRule'
        description: The classification rule definition.
        required: true
      summary: Classification rules create or replace
      x-summary-source: derived
    delete:
      tags:
      - Classification Rules
      description: Deletes a classification rule.
      operationId: ClassificationRules_Delete
      parameters:
      - $ref: '#/components/parameters/classificationRuleName'
      - $ref: '#/components/parameters/api-version'
      responses:
        '204':
          description: Success.
        default:
          description: An error response received from the Scanning Service.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
      summary: Classification rules delete
      x-summary-source: derived
  /classificationrules:
    get:
      tags:
      - Classification Rules
      description: Lists classification rules in Account.
      operationId: ClassificationRules_List
      parameters:
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRuleList'
        default:
          description: An error response received from the Scanning Service.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Classification rules list
      x-summary-source: derived
  /classificationrules/{classificationRuleName}/versions:
    get:
      tags:
      - Classification Rules
      description: Lists the rule versions of a classification rule.
      operationId: ClassificationRules_ListVersionsByRuleName
      parameters:
      - $ref: '#/components/parameters/classificationRuleName'
      - $ref: '#/components/parameters/api-version'
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationRuleList'
        default:
          description: An error response received from the Scanning Service.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Classification rules list versions by rule name
      x-summary-source: derived
  /classificationrules/{classificationRuleName}/versions/{classificationRuleVersion}:tag:
    post:
      tags:
      - Classification Rules
      description: Sets classification action on a specific classification rule version.
      operationId: ClassificationRules_TagClassificationVersion
      parameters:
      - $ref: '#/components/parameters/classificationRuleName'
      - in: path
        name: classificationRuleVersion
        description: The version of the classification rule.
        required: true
        schema:
          type: integer
          format: int32
      - in: query
        name: action
        description: The action of classification rule.
        required: true
        x-ms-enum:
          name: ClassificationAction
          values:
          - value: Keep
            description: the classification action is keep
          - value: Delete
            description: the classification action is delete
          modelAsString: true
        schema:
          type: string
          enum:
          - Keep
          - Delete
      - $ref: '#/components/parameters/api-version'
      responses:
        '202':
          description: Success.
          headers:
            Operation-Location:
              description: Response header for long running operation.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResponse'
        default:
          description: An error response received from the Scanning Service.
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
      x-ms-long-running-operation: true
      summary: Classification rules tag classification version
      x-summary-source: derived
components:
  schemas:
    ClassificationRulePattern:
      type: object
      properties:
        kind:
          type: string
          enum:
          - Regex
        pattern:
          type: string
    ClassificationRuleList:
      type: object
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/ClassificationRule'
        nextLink:
          type: string
        count:
          type: integer
          format: int64
    ClassificationRule:
      type: object
      description: A classification rule definition
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
        kind:
          type: string
          enum:
          - Custom
          - System
        properties:
          type: object
          properties:
            description:
              type: string
            classificationName:
              type: string
            ruleStatus:
              type: string
              enum:
              - Enabled
              - Disabled
            createdAt:
              type: string
              format: date-time
            lastModifiedAt:
              type: string
              format: date-time
            version:
              type: integer
              format: int32
            dataPatterns:
              type: array
              items:
                $ref: '#/components/schemas/ClassificationRulePattern'
            columnPatterns:
              type: array
              items:
                $ref: '#/components/schemas/ClassificationRulePattern'
    OperationResponse:
      description: The operation response.
      type: object
      properties:
        scanResultId:
          format: uuid
          type: string
          description: The scan result identifier.
        startTime:
          format: date-time
          type: string
          description: The start time of the operation.
        endTime:
          format: date-time
          type: string
          description: The end time of the operation.
        status:
          enum:
          - Accepted
          - InProgress
          - TransientFailure
          - Succeeded
          - Failed
          - Canceled
          type: string
          description: Scan operation status.
          x-ms-enum:
            name: OperationStatus
            values:
            - value: Accepted
              description: the scan is accepted
            - value: InProgress
              description: the scan is InProgress
            - value: TransientFailure
              description: the scan is in transient failure
            - value: Succeeded
              description: the scan is succeeded
            - value: Failed
              description: the scan is failed
            - value: Canceled
              description: the scan is canceled
            modelAsString: true
        error:
          $ref: '#/components/schemas/ErrorInfo'
    ErrorInfo:
      description: The error info.
      type: object
      properties:
        code:
          type: string
          description: A unique error code that identifies the specific error.
        message:
          type: string
          description: A human-readable error message that provides more details about the error.
        target:
          type: string
          description: The specific component that the error is associated with.
        details:
          type: array
          description: Error info detail.
          items:
            $ref: '#/components/schemas/ErrorInfo'
    ProxyResource:
      description: The proxy resource.
      type: object
      properties:
        id:
          description: The resource identifier.
          type: string
          readOnly: true
        name:
          description: The resource name.
          type: string
          readOnly: true
    ErrorResponseModel:
      description: The error response model.
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorModel'
      required:
      - error
    ErrorModel:
      description: The error model.
      type: object
      properties:
        code:
          description: A unique error code that identifies the specific error.
          type: string
        message:
          description: A human-readable error message that provides more details about the error.
          type: string
        target:
          description: The specific component that the error is associated with.
          type: string
        details:
          description: An array of nested ErrorModel objects that provides additional error details.
          type: array
          items:
            $ref: '#/components/schemas/ErrorModel'
      required:
      - code
      - message
  securitySchemes:
    oauth2:
      type: oauth2
      description: Azure Active Directory OAuth2 authentication
      flows:
        clientCredentials:
          tokenUrl: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
          scopes:
            https://purview.azure.net/.default: Access Microsoft Purview
    azure_auth:
      type: oauth2
      flows:
        implicit:
          scopes:
            user_impersonation: impersonate your user account
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
      description: Azure Active Directory OAuth2 Flow.
  parameters:
    api-version:
      in: query
      name: api-version
      description: The api version to use.
      required: true
      x-ms-client-name: ApiVersion
      x-ms-parameter-location: client
      schema:
        type: string
    classificationRuleName:
      in: path
      name: classificationRuleName
      description: The classification rule name.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
        maxLength: 63
        minLength: 3
        pattern: ^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$