Skip to main content
POST
/
api
/
application
/
send
curl --request POST \
  --url http://localhost:5000/api/application/send \
  --header 'Content-Type: application/json' \
  --data '{
    "studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
    "teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
    "type": "LEAVE",
    "message": "I need to take a leave of absence from January 20 to January 25."
  }'
{
  "_id": "64b3e7a2f1c0d2e3a4b5c6d7",
  "studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
  "teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
  "type": "LEAVE",
  "message": "I need to take a leave of absence from January 20 to January 25.",
  "status": "PENDING",
  "__v": 0
}

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/praveenarya123/sps-backend/llms.txt

Use this file to discover all available pages before exploring further.

Creates a new application record and saves it to the database. The application status is automatically set to PENDING upon creation.
No authentication is required to call this endpoint.

Request body

studentId
string
required
The MongoDB ObjectId of the student submitting the application.
teacherId
string
required
The MongoDB ObjectId of the teacher the application is directed to.
type
string
required
The category of the application. Common values: LEAVE, COMPLAINT, REQUEST.
message
string
required
The body text of the application describing the student’s request or complaint.

Response

Returns the newly created application object.
_id
string
The unique MongoDB ObjectId assigned to the application.
studentId
string
The MongoDB ObjectId of the student who submitted the application.
teacherId
string
The MongoDB ObjectId of the teacher the application is addressed to.
type
string
The application category (e.g., LEAVE, COMPLAINT, REQUEST).
message
string
The application message body.
status
string
The current status of the application. Always PENDING on creation.
__v
number
Internal MongoDB document version key.
curl --request POST \
  --url http://localhost:5000/api/application/send \
  --header 'Content-Type: application/json' \
  --data '{
    "studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
    "teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
    "type": "LEAVE",
    "message": "I need to take a leave of absence from January 20 to January 25."
  }'
{
  "_id": "64b3e7a2f1c0d2e3a4b5c6d7",
  "studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
  "teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
  "type": "LEAVE",
  "message": "I need to take a leave of absence from January 20 to January 25.",
  "status": "PENDING",
  "__v": 0
}

Build docs developers (and LLMs) love