curl --request GET \
--url https://api.example.com/api/user/data{
"success": true,
"user": {
"_id": "user_2abc123def456",
"name": "John Doe",
"email": "john.doe@example.com",
"imageUrl": "https://img.clerk.com/eyJ0eXBlIjoicHJveHkiLCJzcmMiOiJodHRwczovL2ltYWdlcy...",
"enrolledCourses": [
"60d5ec49f1b2c72b8c8e4f1a",
"60d5ec49f1b2c72b8c8e4f1b"
]
}
}
Retrieve authenticated user’s profile information and enrolled courses list
curl --request GET \
--url https://api.example.com/api/user/data{
"success": true,
"user": {
"_id": "user_2abc123def456",
"name": "John Doe",
"email": "john.doe@example.com",
"imageUrl": "https://img.clerk.com/eyJ0eXBlIjoicHJveHkiLCJzcmMiOiJodHRwczovL2ltYWdlcy...",
"enrolledCourses": [
"60d5ec49f1b2c72b8c8e4f1a",
"60d5ec49f1b2c72b8c8e4f1b"
]
}
}
userId is automatically extracted from the authentication token.
{
"success": true,
"user": {
"_id": "user_2abc123def456",
"name": "John Doe",
"email": "john.doe@example.com",
"imageUrl": "https://img.clerk.com/eyJ0eXBlIjoicHJveHkiLCJzcmMiOiJodHRwczovL2ltYWdlcy...",
"enrolledCourses": [
"60d5ec49f1b2c72b8c8e4f1a",
"60d5ec49f1b2c72b8c8e4f1b"
]
}
}
{
"success": false,
"message": "User Not Found"
}
{
"success": false,
"message": "An unexpected error occurred"
}
| Status Code | Description |
|---|---|
| 200 | Success or user not found (check success field) |
| 401 | Unauthorized - Invalid or missing authentication token |
| 500 | Internal server error |