Base URL: /supervisor/
Authentication: Required (JWT / Session)
Permissions: Zehish Admin only
POST /supervisor/request_certificate/Request Body
{
"course_id": 1
}
Response (200 OK)
{
"message": "Certificate request submitted"
}
Response (200 OK) - Already exists
{
"message": "Certificate request already exists"
}
Error Response (404 Not Found)
{
"error": "Course not found"
}
POST /supervisor/{certificate_request_id}/approve_certificate/Request Body (multipart/form-data)
certificate_image: file (required) - The certificate image fileResponse (200 OK)
{
"message": "Certificate approved and email sent to user"
}
Error Response (404 Not Found)
{
"error": "Certificate request not found"
}
Error Response (400 Bad Request)
{
"error": "No certificate image uploaded"
}
Email Notification: Upon approval, the system automatically sends an email to the user notifying them that their certificate is ready.
POST /supervisor/{course_id}/approve_course/Response (200 OK)
{
"message": "Course approved and published"
}
Error Response (404 Not Found)
{
"error": "Course not found"
}
DELETE /supervisor/{course_id}/delete_course/Response (200 OK)
{
"message": "Course deleted"
}
Error Response (404 Not Found)
{
"error": "Course not found"
}
GET /supervisor/list_notifications/Response (200 OK)
{
"notifications": [
{
"id": 1,
"message": "Certificate request pending for user John Doe",
"notification_type": "certificate_request",
"created_at": "2023-12-15T10:30:45Z",
"is_done": false
},
{
"id": 2,
"message": "New course submission: Advanced Python",
"notification_type": "course_submission",
"created_at": "2023-12-15T11:15:22Z",
"is_done": false
}
]
}
POST /supervisor/{notification_id}/mark_notification_done/Response (200 OK)
{
"message": "Notification marked as done"
}
Error Response (404 Not Found)
{
"error": "Notification not found"
}
400 Bad Request - Invalid input parameters401 Unauthorized - Authentication required403 Forbidden - Insufficient permissions (not Zehish admin)404 Not Found - Resource not found{
"detail": "You do not have permission to perform this action."
}