Tham chiếu API
API của trust.iai.one phục vụ một mục tiêu: xác minh bằng chứng dữ liệu, chứng chỉ và quyền sở hữu tài sản số qua một lớp verify thống nhất.
Base URL
https://trust.iai.one/api
Xác thực
Endpoint dashboard dùng JWT phiên đăng nhập. Endpoint server-to-server dùng API key trong header Authorization.
Authorization: Bearer vtl_live_xxxxxxxxx
Auth
| Method | Path | Mục đích |
|---|
| POST | /api/auth/magic-link | Gửi link đăng nhập qua email. |
| POST | /api/auth/verify-token | Đổi token thành phiên đăng nhập. |
| GET | /api/auth/me | Lấy hồ sơ người dùng hiện tại. |
Proof
Proof là API mở trước tiên vì rủi ro thấp, giá trị rõ và là nền cho credential.
| Method | Path | Mục đích |
|---|
| POST | /api/proof/create | Tạo SHA-256 hash, timestamp và verify URL. |
| POST | /api/proof/verify | Kiểm tra proof bằng id hoặc hash. |
| GET | /api/proof/{id} | Lấy chi tiết proof. |
curl -X POST https://trust.iai.one/api/proof/create \
-H "Authorization: Bearer vtl_live_xxx" \
-F "file=@contract.pdf" \
-F 'metadata={"project":"demo"}'
Credentials
| Method | Path | Mục đích |
|---|
| POST | /api/vc/issue | Phát hành credential có thể xác minh. |
| GET | /api/vc/{id} | Lấy chi tiết credential. |
| POST | /api/vc/{id}/revoke | Thu hồi credential. |
Assets
| Method | Path | Mục đích |
|---|
| POST | /api/asset/create | Tạo bản ghi tài sản số từ credential hoặc metadata. |
| GET | /api/asset/{id} | Lấy trạng thái và lịch sử sở hữu. |
Verify công khai
Verify là endpoint công khai, không cần auth, tự nhận diện proof, credential hoặc asset.
GET /api/verify/{id}
{
"type": "proof",
"status": "valid",
"created_at": "2026-04-28T00:00:00Z"
}
Billing
| GET | /api/billing/plans | Danh sách gói. |
| POST | /api/billing/checkout | Tạo phiên thanh toán. |
Giới hạn tốc độ
| Plan | Limit |
|---|
| Free | 10/min |
| Pro | 60/min |
| Business | 300/min |
| Enterprise | Custom |
Mã lỗi
| 400 | Bad request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 429 | Rate limited |