me
GET
/api/v1/auth/me
const url = 'https://example.com/api/v1/auth/me';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/auth/me";
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request GET \ --url https://example.com/api/v1/auth/me \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”fields
string | null
Comma-separated field groups to include: profile, preferences, quota, session.
Responses
Section titled “Responses”Current user info
Media typeapplication/json
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
code
required
string
data
/auth/me 响应:用户信息 + 偏好设置
object
access_token_expires_at
required
integer format: int64
created_at
required
string
email
required
string
email_verified
required
boolean
id
required
integer format: int64
must_change_password
required
boolean
pending_email
string | null
policy_group_id
integer | null format: int64
preferences
One of:
null
API-facing user preference payload: built-in preferences plus custom frontend KV entries.
object
color_preset
custom
object
key
additional properties
display_time_zone
string | null
language
One of:
null
Normalized BCP 47 locale tag used by product preferences and plugin-facing localization contracts.
The backend validates language tags without fixing the protocol to the frontend’s currently bundled locale set. Product UI choices remain limited by the resources actually shipped by that frontend build.
string
sort_by
storage_event_stream_enabled
boolean | null
profile
required
object
avatar
required
object
source
required
用户头像来源
string
url_1024
string | null
url_512
string | null
version
required
integer format: int32
display_name
string | null
role
required
用户角色
string
status
required
用户状态
string
storage_quota
required
integer format: int64
storage_used
required
integer format: int64
updated_at
required
string
username
required
string
error
msg
required
string
Example
{ "code": "success", "data": { "preferences": { "browser_open_mode": "single_click", "color_preset": "#2563eb", "language": "zh-CN", "sort_by": "name", "sort_order": "asc", "theme_mode": "system", "view_mode": "list" }, "profile": { "avatar": { "source": "none" } }, "role": "admin", "status": "active" }}Not authenticated