auth

Login With Code

邮箱验证码登录 — 第二步:验证身份 → 自动判断注册/登录 → 签发 session_token。

🔴 统一入口:未注册则自动注册(name=邮箱@前部分, plan=free, 送500信用点), 已注册则直接登录。前端根据 is_new_user 字段显示不同提示。

🔴 session_token(cs_ 前缀)与 API Token(tt_ 前缀)的区别:

  • session_token:邮箱登录后返回,24h 过期,用于控制台 Web UI 认证
  • API Token:长期密钥,用于 AI Agent 程序化调用回测 API

🔑 与 Key 恢复的关键区别:

  • Key 恢复:吊销全部旧 API Token → 签发新 API Token(安全重置,适用于忘记/泄露 Key)
  • 邮箱登录:仅签发新 session_token,不创建、不吊销任何 API Token 如邮箱未注册,先自动注册再登录

适用于控制台 Web UI 用户登录,获取会话凭证后调用控制台 API。

post/api/v1/auth/login

Request

  • Base URL: https://api.ticktest.cn (the document declares no server; this is the origin it was published from)
  • URL: https://api.ticktest.cn/api/v1/auth/login
  • Auth: none declared

Request body

emailstring required

注册时使用的邮箱

verification_codestring required

邮箱验证码(6位数字)

Response

Successful Response

statusstring required
session_tokenstring nullable
session_token_prefixstring nullable
session_expires_atstring nullable
user_idstring nullable
namestring nullable
creditsinteger nullable
planstring nullable
tokensobject[]
is_new_userboolean
messagestring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.