Skillio API Documentation

Backend REST API Endpoints & Routes

Server: Fastify Database: MongoDB Auth: JWT

Authentication

Xác thực & Quản lý phiên

POST /auth/login
Đăng nhập
POST /auth/logout
Đăng xuất
POST /auth/register
Đăng ký
GET /auth/verify-email
Xác thực email
POST /auth/refresh-token
Làm mới token

Users

Quản lý người dùng

GET /users
Danh sách users
GET /users/me
Thông tin cá nhân 🔒
GET /users/:id
Chi tiết user 🔒
POST /users
Tạo user 🔒
PUT /users/:id
Cập nhật user 🔒
DELETE /users/:id
Xóa user 🔒

Courses

Quản lý khóa học

GET /courses
Danh sách khóa học
GET /courses/:id
Chi tiết khóa học
GET /courses/slug/:slug
Khóa học theo slug
GET /courses/:id/full-detail
Chi tiết đầy đủ
POST /courses
Tạo khóa học
PUT /courses/:id
Cập nhật khóa học
DELETE /courses/:id
Xóa khóa học
POST /courses/:id/duplicate
Nhân bản khóa học

Chapters

Quản lý chương học

GET /chapters
Danh sách chương
GET /chapters/:id
Chi tiết chương
GET /courses/:courseId/chapters
Chương theo khóa học
POST /chapters
Tạo chương
PUT /chapters/:id
Cập nhật chương
PUT /chapters/reorder
Sắp xếp lại chương
DELETE /chapters/:id
Xóa chương

Lessons

Quản lý bài học

GET /lessons
Danh sách bài học
GET /lessons/:id
Chi tiết bài học
POST /lessons
Tạo bài học
PUT /lessons/:id
Cập nhật bài học
PUT /lessons/reorder
Sắp xếp lại bài học
DELETE /lessons/:id
Xóa bài học

Categories

Quản lý danh mục

GET /categories
Danh sách danh mục
GET /categories/:id
Chi tiết danh mục
POST /categories
Tạo danh mục
PUT /categories/:id
Cập nhật danh mục
DELETE /categories/:id
Xóa danh mục

Roles & Permissions

Quản lý vai trò & quyền hạn

GET /roles
Danh sách vai trò
GET /roles/:id
Chi tiết vai trò 🔒
GET /permissions
Danh sách quyền
POST /roles
Tạo vai trò 🔒
PUT /roles/:id/permissions
Gán quyền 🔒

Cart

Giỏ hàng & Thanh toán

GET /carts
Xem giỏ hàng 🔒
POST /carts
Thêm vào giỏ 🔒
DELETE /carts/:courseId
Xóa khỏi giỏ 🔒
POST /carts/checkout
Thanh toán 🔒

Orders

Quản lý đơn hàng

GET /orders
Danh sách đơn hàng
GET /orders/:id
Chi tiết đơn hàng
POST /orders
Tạo đơn hàng
PUT /orders/:id/activate
Kích hoạt đơn hàng

Items

Quản lý items & files

POST /items
T� item
PATCH /items/:id/rename
Đổi tên item
PATCH /items/:id/move
Di chuyển item
DELETE /items/:id
Xóa item
POST /items/upload
Upload & tạo item

Topics

Qu�ản lý chủ đề

GET /topics
D�anh sách chủ đề
GET /topics/:id
Chi tiết chủ đề
POST /topics
T� chủ đề
PUT /topics/:id
C�p nhật chủ đề
DELETE /topics/:id
Xóa chủ đề
DELETE /topics
Xóa nhiều chủ đề

User Groups

Quản lý nhóm người dùng

GET /user-groups
Danh sách nhóm
GET /user-groups/:id
Chi tiết nhóm
POST /user-groups
T� nhóm
PUT /user-groups/:id
C�p nhật nhóm
POST /user-groups/:groupId/add-user
Thêm user vào nhóm
POST /user-groups/:groupId/remove-user
Xóa user khỏi nhóm
DELETE /user-groups/:id
Xóa nhóm

Notifications

Qu�ản lý thông báo

GET /notifications
Danh sách thông báo
POST /notifications
T� thông báo
PATCH /notifications/:id/read
Đánh dấu đã đọc
PATCH /notifications/read-all
Đọc tất cả
DELETE /notifications/:id
Xóa thông báo

Automations

Quản lý tự động hóa

GET /automations
Danh sách automation
GET /automations/:id
Chi tiết automation
POST /automations
T� automation
PUT /automations/:id
C�p nhật automation
POST /automations/:id/run
Chạy automation
DELETE /automations/:id
Xóa automation
DELETE /automations
Xóa nhiều automation

Activation Codes

Quản lý mã kích hoạt

GET /activation-codes
Danh sách mã kích hoạt
GET /activation-codes/:id
Chi tiết mã kích hoạt
POST /activation-codes
T� mã kích hoạt
PUT /activation-codes/:id
Ýp nhật mã kích hoạt
POST /activations/activate
Kích hoạt khóa học
DELETE /activation-codes/:id
Xóa mã kích hoạt

System Utilities

Tiện ích hệ thống

GET /ping
Health check
GET /viewer
Viewer tool
GET /viewer/*
Viewer wildcard
GET /cloudinary-usage
Cloudinary usage
GET /statistics
Thống kê hệ thống

Content Management

Quản lý nội dung

GET /hero-banner
Banner trang chủ
GET /faq
Câu hỏi thường gặp
GET /testimonials
Lời chứng thực
GET /contacts
Liên hệ
GET /login/google/callback
Google OAuth callback