Auth API โ
Request Email Code โ
prolog
POST API_BASE/auth/codeAuthorization Required โ
| OAuth | APIKey |
|---|---|
| No | No |
Request Body โ
json
{
"email": "user@example.com",
"lang": "en",
"scene": "login"
}scene can be login or replace_email.
Response โ
json
{
"data": null,
"ts": 1723923923
}Request Google OAuth URL โ
prolog
POST API_BASE/auth/google/url?state=:stateParameters โ
| Parameter | Type | Description |
|---|---|---|
state | string | OAuth state value (required). |
Response โ
json
{
"data": {
"url": "https://..."
},
"ts": 1723923923
}Login โ
prolog
POST API_BASE/auth/loginRequest Body โ
json
{
"method": "email_code",
"email": "user@example.com",
"code": "123456",
"lang": "en"
}For Google OAuth login:
json
{
"method": "google_oauth",
"code": "oauth_code",
"state": "state",
"lang": "en"
}Response โ
json
{
"data": {
"user": UserObject,
"access_token": "..."
},
"ts": 1723923923
}Issue Ephemeral Token โ
prolog
POST API_BASE/auth/ephemeral?origin=:originAuthorization Required โ
| OAuth | APIKey |
|---|---|
| Yes | Yes |
Parameters โ
| Parameter | Type | Description |
|---|---|---|
origin | string | The origin for the ephemeral token. |
Response โ
json
{
"data": {
"ephemeral_token": "..."
},
"ts": 1723923923
}Exchange Ephemeral Token โ
prolog
POST API_BASE/auth/ephemeral/exchange?token=:tokenParameters โ
| Parameter | Type | Description |
|---|---|---|
token | string | Ephemeral token (required). |
Response โ
json
{
"data": {
"user": UserObject,
"access_token": "..."
},
"ts": 1723923923
}