Tag API#
API quản lý tags để phân loại tài khoản và nội dung.
Base URL: https://app.socialking.vn/api/v1
1. Tạo Tag#
POST /tag/create
#
Auth: Bearer Token (JWT)
Request Body:
{
"name": "VIP Account",
"description": "Tài khoản VIP",
"color": "#EF4444"
}| Field | Type | Required | Validation |
|---|---|---|---|
name | string | Yes | 1-50 ký tự |
description | string | No | Max 200 ký tự, nullable |
color | string | No | Hex color #XXXXXX, default #6B7280 |
Response (201):
{
"success": true,
"data": {
"id": "uuid-string",
"name": "VIP Account",
"description": "Tài khoản VIP",
"color": "#EF4444",
"createdAt": "2026-03-30T10:30:00Z"
}
}2. Cập nhật Tag#
PUT /tag/update/:id
#
Auth: Bearer Token (JWT)
URL Params: id (UUID)
Request Body: Các fields giống tạo, tất cả optional.
3. Xóa Tags#
POST /tag/delete
#
Auth: Bearer Token (JWT)
Request Body:
{
"tagIds": ["uuid-1", "uuid-2"]
}| Field | Type | Required | Validation |
|---|---|---|---|
tagIds | UUID[] | Yes | 1-100 IDs |
4. Danh sách Tags#
GET /tag/get-all
#
Auth: Bearer Token (JWT)
Query Parameters:
| Param | Type | Default | Mô tả |
|---|---|---|---|
page | number | 1 | Trang |
limit | number | 20 | Max 100 items/trang |
search | string | - | Tìm kiếm theo tên |
color | string | - | Filter theo màu |
Response (200):
{
"success": true,
"data": {
"tags": [
{
"id": "uuid-string",
"name": "VIP Account",
"description": "Tài khoản VIP",
"color": "#EF4444",
"createdAt": "2026-03-30T10:30:00Z"
}
],
"total": 10,
"page": 1,
"limit": 20
}
}5. Chi tiết Tag#
GET /tag/get-by-id/:id
#
Auth: Bearer Token (JWT)
URL Params: id (UUID)