Authentication
Every request must be authenticated with an API key or an OAuth 2.0 token.
Mọi request phải được xác thực bằng khóa API hoặc token OAuth 2.0.
1 · Overview · Tổng quan
Boltz One supports two schemes: API keys for server-to-server calls, and OAuth 2.0 for user-delegated access.
Boltz One hỗ trợ hai cơ chế: khóa API cho gọi server-to-server, và OAuth 2.0 cho truy cập ủy quyền thay mặt người dùng.
2 · API Keys · Khóa API
Pass your secret key as a bearer token in the Authorization header.
Truyền khóa bí mật dưới dạng bearer token trong header Authorization.
| Scope | Description · Mô tả |
|---|---|
| read:all | Read-only access |
| write:jobs | Create & update jobs |
| admin | Full account access |
3 · OAuth 2.0 · OAuth 2.0
Use the authorization-code flow to obtain access tokens on behalf of users.
Dùng luồng authorization-code để lấy access token thay mặt người dùng.
4 · Token Lifecycle · Vòng đời token
Access tokens expire after 1 hour; refresh tokens last 30 days. Use a refresh token to re-issue without re-authenticating.
Access token hết hạn sau 1 giờ; refresh token tồn tại 30 ngày. Dùng refresh token để cấp lại mà không cần đăng nhập lại.