Skip to main content
POST
/
category
cURL
curl --request POST \
  --url https://grm-api.vercel.app/category \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>"
}
'
{
  "status": "<string>",
  "category": "<string>",
  "confidence": 123,
  "formatted_fields": {}
}
Analyzes and categorizes grievance text to determine the appropriate category. This endpoint uses natural language processing to classify the grievance text and extract structured information.

Request

The request requires a text field containing the grievance content to be categorized.

Response

The response includes:
  • status: Operation status
  • category: The classified category of the grievance
  • confidence: A confidence score (0-1) indicating the reliability of the classification
  • formatted_fields: Structured information extracted from the grievance text, which may include entities, key phrases, and other relevant data points
This endpoint is useful for automatically categorizing new grievances or re-categorizing existing ones to ensure proper routing and handling.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Grievance text to categorize

text
string
required

The grievance text to be categorized

Response

Categorization result

status
string

Status of the operation

category
string

The classified category of the grievance

confidence
number<float>

Confidence score of the classification

formatted_fields
object

Structured information extracted from the grievance text