Skip to main content

Get All Applications

Retrieve all educator applications with optional filtering by status.

Authentication

Authorization
string
required
Bearer token with admin role required

Query Parameters

status
string
Filter applications by status. Available values:
  • pending - Applications awaiting review
  • approved - Approved applications
  • rejected - Rejected applications
If not specified, returns all applications regardless of status

Response

success
boolean
Indicates if the request was successful
applications
array
Array of applications sorted by submission date (newest first)
{
  "success": true,
  "applications": [
    {
      "_id": "65a1b2c3d4e5f6789abcdef0",
      "userId": "user_2abc123def456",
      "professionalTitle": "Senior Full-Stack Developer",
      "bio": "I have 8 years of experience in web development and have been teaching programming for the past 3 years. I'm passionate about helping others learn to code and build amazing applications.",
      "expertise": [
        "JavaScript",
        "React",
        "Node.js",
        "MongoDB",
        "Web Development"
      ],
      "linkedinUrl": "https://linkedin.com/in/johnsmith",
      "status": "pending",
      "rejectionReason": "",
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:30:00.000Z"
    },
    {
      "_id": "65a1b2c3d4e5f6789abcdef1",
      "userId": "user_3xyz789ghi012",
      "professionalTitle": "Data Science Consultant",
      "bio": "PhD in Computer Science with specialization in Machine Learning. I've worked with Fortune 500 companies on AI solutions and love making complex topics accessible.",
      "expertise": [
        "Python",
        "Machine Learning",
        "Data Science",
        "TensorFlow",
        "Statistics"
      ],
      "linkedinUrl": "https://linkedin.com/in/sarahjohnson",
      "status": "approved",
      "rejectionReason": "",
      "createdAt": "2024-01-14T14:20:00.000Z",
      "updatedAt": "2024-01-14T16:45:00.000Z"
    },
    {
      "_id": "65a1b2c3d4e5f6789abcdef2",
      "userId": "user_4mno345pqr678",
      "professionalTitle": "Freelance Developer",
      "bio": "I build websites.",
      "expertise": [
        "HTML",
        "CSS"
      ],
      "linkedinUrl": "",
      "status": "rejected",
      "rejectionReason": "Application does not demonstrate sufficient teaching experience or depth of expertise. Please provide more details about your background and expand your expertise areas.",
      "createdAt": "2024-01-13T09:15:00.000Z",
      "updatedAt": "2024-01-13T11:30:00.000Z"
    }
  ]
}

Approve Application

Approve an educator application and grant the user educator role in Clerk.

Authentication

Authorization
string
required
Bearer token with admin role required

Path Parameters

id
string
required
Application ID (MongoDB ObjectId)

Response

success
boolean
Indicates if the approval was successful
message
string
Confirmation message
{
  "success": true,
  "message": "Application approved. Educator role granted."
}

Side Effects

  1. Updates application status to approved
  2. Clears any existing rejectionReason
  3. Updates user’s Clerk public metadata with role: 'educator'
  4. User can now create and publish courses

Example Request

curl -X PATCH "https://api.skillrise.com/api/admin/educator-applications/65a1b2c3d4e5f6789abcdef0/approve" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN"

Reject Application

Reject an educator application with an optional reason.

Authentication

Authorization
string
required
Bearer token with admin role required

Path Parameters

id
string
required
Application ID (MongoDB ObjectId)

Request Body

reason
string
Reason for rejection (will be visible to the applicant)

Response

success
boolean
Indicates if the rejection was successful
message
string
Confirmation message
{
  "success": true,
  "message": "Application rejected."
}

Side Effects

  1. Updates application status to rejected
  2. Stores the rejection reason (if provided)
  3. User can resubmit a new application later
  4. Previous rejection reason will be cleared upon resubmission

Example Requests

curl -X PATCH "https://api.skillrise.com/api/admin/educator-applications/65a1b2c3d4e5f6789abcdef0/reject" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Application does not demonstrate sufficient teaching experience. Please provide more details about your background and reapply."
  }'

Notes

  • Applications can only be approved or rejected once they are in pending status
  • Rejected users can resubmit applications, which will overwrite their previous submission
  • Approving an application automatically grants the educator role in Clerk
  • The reason field is optional but recommended to provide feedback to applicants
  • All admin endpoints require the protectAdmin middleware authentication