Skip to main content
POST
/
grievances
cURL
curl --request POST \
  --url https://grm-api.vercel.app/grievances \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "description": "<string>",
  "category": "<string>",
  "user_id": "<string>",
  "priority": "medium",
  "cpgrams_category": "<string>",
  "reformed_top_level_category": "<string>",
  "reformed_last_level_category": "<string>",
  "reformed_flag": false
}
'
{
  "id": "<string>",
  "status": "<string>",
  "title": "<string>",
  "description": "<string>",
  "priority": "<string>",
  "user_id": "<string>",
  "cpgrams_category": "<string>"
}
Creates a new grievance in the Xata database. This endpoint requires authentication via a bearer token. Required fields include title, description, category, and user_id. The user must exist in the system, otherwise a 404 error is returned. The grievance is created with a default status of “pending” and timestamps are automatically generated. Additional fields like priority, cpgrams_category, reformed_top_level_category, reformed_last_level_category, and reformed_flag can be provided as needed. The response includes the ID of the created grievance and a status message indicating successful creation.

Authorizations

Authorization
string
header
required

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

Body

application/json

Grievance to add to the system

title
string
required

Title of the grievance

description
string
required

Detailed description of the grievance

category
string
required

Category of the grievance

user_id
string
required

ID of the user submitting the grievance

priority
string
default:medium

Priority level: low, medium, high, critical

cpgrams_category
string

CPGRAMS category of the grievance

reformed_top_level_category
string

Top level category in the reformed classification

reformed_last_level_category
string

Last level category in the reformed classification

reformed_flag
boolean
default:false

Flag indicating if the grievance is part of reformed process

Response

Grievance created successfully

id
string

ID of the created grievance

status
string

Status message

title
string

Title of the grievance

description
string

Description of the grievance

priority
string

Priority level of the grievance

user_id
string

ID of the user who submitted the grievance

cpgrams_category
string

CPGRAMS category of the grievance