Circle · API Reference

API — Circle

Tài liệu các endpoint của module circle. Mỗi endpoint có request format, response format, lỗi có thể xảy ra và ví dụ thực tế.

Tóm tắt endpoint

MethodPathMô tảAuthRate limit
GET/api/v1/circleDanh sách circle.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circleTạo circle mới.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
GET/api/v1/circle/me-joinCircle người dùng đã tham gia.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
GET/api/v1/circle/me/owner-circleCircle người dùng là owner.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
GET/api/v1/circle/request-invitationLời mời circle của user.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circle/send-invitationMời user có sẵn vào circle.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circle/response-invitationChấp nhận hoặc từ chối lời mời.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
GET/api/v1/circle/:publicId/energyXem HP/EXP. [CẦN XÁC NHẬN] response đang mock.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circle/:publicId/postsTạo bài circle và enqueue AI evaluation.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
GET/api/v1/circle/:publicId/postsĐọc bài trong circle.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circle/:publicId/posts/:postPublicId/replyReply bài trong circle.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circle/:publicId/join-requestGửi hoặc hủy join request.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circle/:publicId/manage/join-request/respondAdmin/owner accept hoặc reject join request.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circle/:publicId/send-invitation/manageAdmin mời qua email/token.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
POST/api/v1/circle/:publicId/sacrificeĐốt karma để cộng HP cho circle.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
GET/api/v1/circle/:publicId/statsStats cho owner/admin.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.
GET/api/v1/circle/:publicIdChi tiết circle.BearerGlobal apiLimiter; một số flow có Redis/domain limit riêng.

GET /api/v1/circle

GET Auth required apiLimiter

Endpoint này dùng để danh sách circle. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectKhôngTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X GET http://localhost:3302/api/v1/circle \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle

POST Auth required apiLimiter

Endpoint này dùng để tạo circle mới. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

GET /api/v1/circle/me-join

GET Auth required apiLimiter

Endpoint này dùng để circle người dùng đã tham gia. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectKhôngTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X GET http://localhost:3302/api/v1/circle/me-join \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/me-join"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

GET /api/v1/circle/me/owner-circle

GET Auth required apiLimiter

Endpoint này dùng để circle người dùng là owner. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectKhôngTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X GET http://localhost:3302/api/v1/circle/me/owner-circle \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/me/owner-circle"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

GET /api/v1/circle/request-invitation

GET Auth required apiLimiter

Endpoint này dùng để lời mời circle của user. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectKhôngTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X GET http://localhost:3302/api/v1/circle/request-invitation \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/request-invitation"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle/send-invitation

POST Auth required apiLimiter

Endpoint này dùng để mời user có sẵn vào circle. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle/send-invitation \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/send-invitation"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle/response-invitation

POST Auth required apiLimiter

Endpoint này dùng để chấp nhận hoặc từ chối lời mời. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle/response-invitation \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/response-invitation"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

GET /api/v1/circle/:publicId/energy

GET Auth required apiLimiter

Endpoint này dùng để xem HP/EXP. [CẦN XÁC NHẬN] response đang mock. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectKhôngTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X GET http://localhost:3302/api/v1/circle/cm_public_123/energy \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/energy"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle/:publicId/posts

POST Auth required apiLimiter

Endpoint này dùng để tạo bài circle và enqueue AI evaluation. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle/cm_public_123/posts \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/posts"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

GET /api/v1/circle/:publicId/posts

GET Auth required apiLimiter

Endpoint này dùng để đọc bài trong circle. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectKhôngTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X GET http://localhost:3302/api/v1/circle/cm_public_123/posts \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/posts"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle/:publicId/posts/:postPublicId/reply

POST Auth required apiLimiter

Endpoint này dùng để reply bài trong circle. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle/cm_public_123/posts/post_public_123/reply \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/posts/:postPublicId/reply"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle/:publicId/join-request

POST Auth required apiLimiter

Endpoint này dùng để gửi hoặc hủy join request. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle/cm_public_123/join-request \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/join-request"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle/:publicId/manage/join-request/respond

POST Auth required apiLimiter

Endpoint này dùng để admin/owner accept hoặc reject join request. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle/cm_public_123/manage/join-request/respond \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/manage/join-request/respond"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle/:publicId/send-invitation/manage

POST Auth required apiLimiter

Endpoint này dùng để admin mời qua email/token. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle/cm_public_123/send-invitation/manage \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/send-invitation/manage"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

POST /api/v1/circle/:publicId/sacrifice

POST Auth required apiLimiter

Endpoint này dùng để đốt karma để cộng HP cho circle. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectTùy endpointTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X POST http://localhost:3302/api/v1/circle/cm_public_123/sacrifice \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/sacrifice"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

GET /api/v1/circle/:publicId/stats

GET Auth required apiLimiter

Endpoint này dùng để stats cho owner/admin. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectKhôngTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X GET http://localhost:3302/api/v1/circle/cm_public_123/stats \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId/stats"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú

GET /api/v1/circle/:publicId

GET Auth required apiLimiter

Endpoint này dùng để chi tiết circle. Gọi endpoint này khi client cần thao tác đúng phạm vi module circle.

Request

HeaderGiá trịBắt buộcMô tả
AuthorizationBearer accessTokenJWT access token nếu route protected
x-refresh-tokenraw refresh tokenKhôngRefresh token header theo middleware
ParameterKiểuMô tảVí dụ
path paramsstringCác phần :publicId, :username, :code nếu path cócm123
query paramsstring/numbertake, after, page, limit hoặc module-specific querytake=20
FieldKiểuBắt buộcValidationMô tảVí dụ giá trị
bodyobjectKhôngTheo DTO Zod nếu route có validate()Payload nghiệp vụ của endpoint{"content":"Hello"}
Ví dụ request
curl -X GET http://localhost:3302/api/v1/circle/cm_public_123 \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Response

200/201 — Thành công

FieldKiểuLuôn có?Mô tả
successbooleantrue khi request thành công
messagestringKhôngMột số controller truyền message
dataobject/arrayTùy endpointDữ liệu trả về từ service
paginationobjectVới listCursor/offset pagination
{
  "success": true,
  "data": {
    "module": "circle",
    "endpoint": "/api/v1/circle/:publicId"
  }
}

Lỗi có thể xảy ra

HTTP StatusError CodeKhi nào xảy raCách xử lý ở client
401UNAUTHORIZEDUnauthorizedLogin lại hoặc refresh token.
400VALIDATION_FAILEDValidation failedClient sửa field sai.
404NOT_FOUNDResource not foundRefresh dữ liệu.
403FORBIDDENForbiddenẨn action trong UI.
500INTERNAL_SERVER_ERRORExternal dependency failOn-call kiểm tra provider/log.
Ví dụ lỗi
{
  "success": false,
  "message": "Validation failed"
}

Ghi chú