Steadii Docs

API Reference

Danh sách tất cả API endpoints

Base URL

https://api.dahodo.com/steadii

Authentication

POST /auth/google

Đăng nhập bằng Google ID Token.

// Request
{ "idToken": "<Google ID Token>" }

// Response
{
  "token": "<JWT>",
  "user": { "id": "...", "email": "...", "name": "...", "avatar": "..." }
}

Data Sync

GET /sync

Pull dữ liệu từ server. Auth: JWT

// Response
{
  "data": {
    "habits": [...],
    "days": {...},
    "reminders": {...},
    "customQuotes": [...],
    "onboardingCompleted": true,
    "updatedAt": "2026-03-29T10:30:00Z"
  }
}

POST /sync

Push dữ liệu lên server. Nếu conflict → trả về server data. Auth: JWT

// Response (success)
{ "status": "ok" }

// Response (conflict)
{ "status": "conflict", "data": {...} }

Subscription

GET /subscription

Lấy gói đăng ký hiện tại. Auth: JWT

POST /checkout

Tạo phiên thanh toán. Auth: JWT

POST /billing/portal

Tạo link quản lý thanh toán. Auth: JWT

POST /webhook

Webhook từ LemonSqueezy. Auth: HMAC-SHA256 header X-Signature

Account

DELETE /account

Xóa tài khoản và toàn bộ dữ liệu. Auth: JWT

Miscellaneous

GET /health

Health check. Response: { "status": "ok" }

POST /push/subscribe

Lưu push notification subscription. Auth: JWT

Rate Limiting

NhómGiới hạn
Auth endpoints10 req/phút
Tất cả endpoints100 req/phút

On this page