Content Classifiers - Create Or Replace
Create a new classifier asynchronously.
PUT {endpoint}/contentunderstanding/classifiers/{classifierId}?api-version=2025-05-01-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
classifier
|
path | True |
string pattern: ^[a-zA-Z0-9._-]{1,64}$ |
The unique identifier of the classifier. |
endpoint
|
path | True |
string (uri) |
Content Understanding service endpoint. |
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
x-ms-client-request-id |
string (uuid) |
An opaque, globally-unique, client-generated string identifier for the request. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
categories | True |
<string,
Classifier |
The categories to classify against. |
description |
string |
A description of the classifier. |
|
processingLocation |
The location where the data may be processed. |
||
splitMode |
Mode used to split input into content objects. |
||
tags |
object |
Tags associated with the classifier. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The request has succeeded. Headers
|
|
201 Created |
The request has succeeded and a new resource has been created as a result. Headers
|
|
Other Status Codes |
An unexpected error response. Headers x-ms-error-code: string |
Security
Ocp-Apim-Subscription-Key
Type:
apiKey
In:
header
OAuth2Auth
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Token URL:
https://login.microsoftonline.com/common/oauth2/token
Scopes
Name | Description |
---|---|
https://cognitiveservices.azure.com/.default |
Examples
Create or Replace Classifier
Sample request
PUT {endpoint}/contentunderstanding/classifiers/myClassifier?api-version=2025-05-01-preview
{
"description": "My classifier",
"tags": {
"createdBy": "John"
},
"splitMode": "auto",
"categories": {
"receipt": {
"description": "Sales receipts"
},
"invoice": {
"analyzerId": "myInvoice"
}
}
}
Sample response
Operation-Location: https://myendpoint.cognitiveservices.azure.com/contentunderstanding/classifiers/myClassifier/operations/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2025-05-01-preview
{
"classifierId": "myClassifier",
"description": "My classifier",
"tags": {
"createdBy": "John"
},
"status": "creating",
"createdAt": "2025-05-01T18:46:36.051Z",
"lastModifiedAt": "2025-05-01T18:46:36.051Z",
"splitMode": "auto",
"categories": {
"receipt": {
"description": "Sales receipts"
},
"invoice": {
"analyzerId": "myInvoice"
}
}
}
Operation-Location: https://myendpoint.cognitiveservices.azure.com/contentunderstanding/classifiers/myClassifier/operations/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2025-05-01-preview
{
"classifierId": "myClassifier",
"description": "My classifier",
"tags": {
"createdBy": "John"
},
"status": "creating",
"createdAt": "2025-05-01T18:46:36.051Z",
"lastModifiedAt": "2025-05-01T18:46:36.051Z",
"splitMode": "auto",
"categories": {
"receipt": {
"description": "Sales receipts"
},
"invoice": {
"analyzerId": "myInvoice"
}
}
}
Definitions
Name | Description |
---|---|
Azure. |
The error object. |
Azure. |
A response containing error details. |
Azure. |
An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. |
Classifier |
A classifier category. |
Classifier |
Mode used to split input into content objects. |
Content |
Classifier that classifies content into categories with optional splitting. |
Processing |
The location where the data may be processed. |
Resource |
Status of a resource. |
Azure.Core.Foundations.Error
The error object.
Name | Type | Description |
---|---|---|
code |
string |
One of a server-defined set of error codes. |
details |
An array of details about specific errors that led to this reported error. |
|
innererror |
An object containing more specific information than the current object about the error. |
|
message |
string |
A human-readable representation of the error. |
target |
string |
The target of the error. |
Azure.Core.Foundations.ErrorResponse
A response containing error details.
Name | Type | Description |
---|---|---|
error |
The error object. |
Azure.Core.Foundations.InnerError
An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.
Name | Type | Description |
---|---|---|
code |
string |
One of a server-defined set of error codes. |
innererror |
Inner error. |
ClassifierCategory
A classifier category.
Name | Type | Description |
---|---|---|
analyzerId |
string |
Optional analyzer used to process the content. |
description |
string |
The description of the category. |
ClassifierSplitMode
Mode used to split input into content objects.
Value | Description |
---|---|
noSplit |
Treat the entire input as a single content object. |
perPage |
Split each page of the input into a separate content object. |
auto |
Split the input into content objects based on the input and category definitions. |
ContentClassifier
Classifier that classifies content into categories with optional splitting.
Name | Type | Default value | Description |
---|---|---|---|
categories |
<string,
Classifier |
The categories to classify against. |
|
classifierId |
string pattern: ^[a-zA-Z0-9._-]{1,64}$ |
The unique identifier of the classifier. |
|
createdAt |
string (date-time) |
The date and time when the classifier was created. |
|
description |
string |
A description of the classifier. |
|
lastModifiedAt |
string (date-time) |
The date and time when the classifier was last modified. |
|
processingLocation | geography |
The location where the data may be processed. |
|
splitMode | noSplit |
Mode used to split input into content objects. |
|
status |
The status of the classifier. |
||
tags |
object |
Tags associated with the classifier. |
|
warnings |
Warnings encountered while creating the classifier. |
ProcessingLocation
The location where the data may be processed.
Value | Description |
---|---|
geography |
Data may be processed in the same geography as the resource. |
dataZone |
Data may be processed in the same data zone as the resource. |
global |
Data may be processed in any Azure data center globally. |
ResourceStatus
Status of a resource.
Value | Description |
---|---|
creating |
The resource is being created. |
ready |
The resource is ready. |
deleting |
The resource is being deleted. |
failed |
The resource failed during creation. |