Classify text for sensitive data patterns (PII, credentials, phone numbers, addresses, etc.). Returns match positions, confidence scores, and classifier identifiers.
POST /classifications/v1
Requires Authorization: Bearer <token> header. Returns 401 Unauthorized with a WWW-Authenticate header if the token is missing or invalid.
JSON
{
"context": {
"actor": "user",
"agent_id": "my-agent",
"platform": "AMAZON_BEDROCK"
},
"classifierDescription": {
"type": "profile",
"uuid": "7dbf380f-0af8-4276-acb0-85413db2dbff",
"version": 1
},
"structured": false,
"metadata": {
"objectName": "object",
"parentObjectName": "parent",
"xPath": "path",
"fileExtension": "extension"
},
"text": "phone 321-507-0525 number"
}
Field Type Required Description contextobjectYes Context metadata passed through to metrics context.actorstringYes "user" or "agent" β identifies the source of the textcontext.agent_idstringYes Unique identifier for the calling agent context.platformstringYes AI platform: AMAZON_BEDROCK, AMAZON_SAGEMAKER, AZURE_FOUNDRY, DATABRICKS, or GCP_VERTEX classifierDescriptionobjectYes Specifies which classifiers to use (see below) structuredbooleanYes Whether the text is structured data metadataobjectNo Optional metadata about the content source textstringYes The text to classify
JSON
{
"type": "profile",
"uuid": "7dbf380f-0af8-4276-acb0-85413db2dbff",
"version": 1
}
Field Type Required Description typestringYes "profile"uuidstring (UUID)Yes Classification profile UUID versionintegerYes Profile version number
JSON
{
"type": "codes",
"codes": [
{ "code": "C1", "version": 1 },
{ "code": "C2", "version": 2 }
]
}
Field Type Required Description typestringYes "codes"codesarrayYes List of classifier code objects codes[].codestringYes Classifier code codes[].versionintegerYes Classifier version
JSON
{
"type": "json",
"classifiers": [
{ "name": "A" },
{ "name": "B" }
]
}
Field Type Required Description typestringYes "json"classifiersarrayYes Inline classifier definition objects
Field Type Description objectNamestringName of the content object parentObjectNamestringName of the parent object xPathstringXPath to the content fileExtensionstringFile extension of the source
JSON
{
"context": {
"actor": "user",
"agent_id": "my-agent",
"platform": "AMAZON_BEDROCK"
},
"matches": [
{
"start": 6,
"end": 18,
"confidence": 100,
"text": "321-507-0525",
"classifier": "US_PHONE_NUMBER"
}
]
}
Field Type Description contextobjectThe context from the request, passed through matchesarrayList of classification matches (empty if no sensitive data detected) matches[].startintegerStarting character position of the match matches[].endintegerEnding character position of the match matches[].confidenceintegerConfidence score (0β100) matches[].textstringThe matched text content matches[].classifierstringName of the classifier that matched
JSON
{
"code": 400,
"message": "Invalid classifier description"
}
JSON
{
"code": 401,
"message": "Invalid or missing bearer token"
}
Includes a WWW-Authenticate header.
JSON
{
"code": 500,
"message": "Classification engine error"
}
JSON
{
"code": 502,
"message": "Upstream classification service unavailable"
}
Bash
curl -X POST https://localhost:4443/classifications/v1 \
--pinnedpubkey "sha256//x48Lk2iu3R3nAhSiz07bExGHTusDRjHqBx9ArK3cFGE=" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"context": { "actor": "user", "agent_id": "my-agent", "platform": "AMAZON_BEDROCK" },
"classifierDescription": {
"type": "profile",
"uuid": "7dbf380f-0af8-4276-acb0-85413db2dbff",
"version": 1
},
"structured": false,
"metadata": {
"objectName": "object",
"parentObjectName": "parent",
"xPath": "path",
"fileExtension": "extension"
},
"text": "phone 321-507-0525 number"
}'
For Python SDK usage, see Classify Text .