Skip to main content
PUT
/
api
/
application
/
approve
/
{id}
curl --request PUT \
  --url http://localhost:5000/api/application/approve/64b3e7a2f1c0d2e3a4b5c6d7
{
  "_id": "64b3e7a2f1c0d2e3a4b5c6d7",
  "studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
  "teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
  "type": "LEAVE",
  "message": "I need to take a leave of absence from January 20 to January 25.",
  "status": "APPROVED",
  "__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.

Updates an existing application’s status to APPROVED. The application is located by its MongoDB ObjectId supplied as a path parameter.
No authentication is required to call this endpoint.

Path parameters

id
string
required
The MongoDB ObjectId of the application to approve.

Response

Returns the updated application object with status set to APPROVED.
_id
string
The unique MongoDB ObjectId of 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 updated status of the application. Always APPROVED after a successful call.
__v
number
Internal MongoDB document version key.
If the provided id does not match any application, the server will return null. Ensure the ObjectId is valid and exists before calling this endpoint.
curl --request PUT \
  --url http://localhost:5000/api/application/approve/64b3e7a2f1c0d2e3a4b5c6d7
{
  "_id": "64b3e7a2f1c0d2e3a4b5c6d7",
  "studentId": "64a1f2c3e4b0d5f6a7b8c9d0",
  "teacherId": "64a1f2c3e4b0d5f6a7b8c9d1",
  "type": "LEAVE",
  "message": "I need to take a leave of absence from January 20 to January 25.",
  "status": "APPROVED",
  "__v": 0
}

Build docs developers (and LLMs) love