Skip to main content

Accounts and sessions

Console client configuration · Response and shared models

Sign-in endpoints issue tenant sessions. Use accessToken for management calls and refreshToken for refresh and logout. After auth.refresh, call setAccessToken with the new access token and persist the returned refresh token in your service. The SDK does not refresh sessions automatically.

OAuth authorization returns authorizeUrl and state. Open the URL in your frontend and send the callback code, state, and original redirectUri to your backend. A WeChat callback with nextAction=bind_phone requires phone verification using bindTicket. Your application handles browser windows, redirects, and session storage.

auth.methods returns providers and captcha configuration for the request host. When captcha.enabled=true, include the captcha component’s captchaTicket and captchaRandstr in SMS requests.

auth.methods​

Available sign-in methods.

GET /v1/auth/methods

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.methods()
Pythonc.auth.methods()
Javac.auth.methods()
Goc.Auth.Methods(ctx, &result)
PHP$c->auth->methods()

No request fields.

Returns: AuthMethods. See shared models for nested fields.

auth.sendSms​

Send SMS code.

POST /v1/auth/sms/send

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.sendSms(input)
Pythonc.auth.send_sms(**input)
Javac.auth.sendSms(input)
Goc.Auth.SendSms(ctx, input, &result)
PHP$c->auth->sendSms($input)

Input: SmsSendInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
phoneYesstringMainland China phone number, optionally prefixed with +86
sceneNo"login" | "bind" | undefinedOTP scene; console sign-in uses login
captchaTicketNostring | undefinedCaptcha ticket
captchaRandstrNostring | undefinedCaptcha random string

Returns: SendCodeResult. See shared models for nested fields.

auth.verifySms​

Sign in with SMS.

POST /v1/auth/sms/verify

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.verifySms(input)
Pythonc.auth.verify_sms(**input)
Javac.auth.verifySms(input)
Goc.Auth.VerifySms(ctx, input, &result)
PHP$c->auth->verifySms($input)

Input: SmsVerifyInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
codeYesstringVerification or OAuth authorization code
phoneYesstringMainland China phone number, optionally prefixed with +86
sceneNo"login" | "bind" | undefinedOTP scene; console sign-in uses login
captchaTicketNostring | undefinedCaptcha ticket
captchaRandstrNostring | undefinedCaptcha random string

Returns: AuthSession. See shared models for nested fields.

auth.sendEmail​

Send email code.

POST /v1/auth/email/send

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.sendEmail(input)
Pythonc.auth.send_email(**input)
Javac.auth.sendEmail(input)
Goc.Auth.SendEmail(ctx, input, &result)
PHP$c->auth->sendEmail($input)

Input: EmailSendInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
emailYesstringEmail address
sceneNo"login" | "bind" | undefinedOTP scene; console sign-in uses login

Returns: SendCodeResult. See shared models for nested fields.

auth.verifyEmail​

Sign in with email.

POST /v1/auth/email/verify

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.verifyEmail(input)
Pythonc.auth.verify_email(**input)
Javac.auth.verifyEmail(input)
Goc.Auth.VerifyEmail(ctx, input, &result)
PHP$c->auth->verifyEmail($input)

Input: EmailVerifyInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
codeYesstringVerification or OAuth authorization code
emailYesstringEmail address
sceneNo"login" | "bind" | undefinedOTP scene; console sign-in uses login

Returns: AuthSession. See shared models for nested fields.

auth.googleAuthorize​

Google authorization URL.

GET /v1/auth/google/authorize

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.googleAuthorize(input)
Pythonc.auth.google_authorize(**input)
Javac.auth.googleAuthorize(input)
Goc.Auth.GoogleAuthorize(ctx, input, &result)
PHP$c->auth->googleAuthorize($input)

Input: OAuthAuthorizeInput. Fields are sent as URL query parameters.

FieldRequiredTypeDescription
redirectUriYesstringOAuth callback URL; use the same value for authorization and exchange
stateNostring | undefinedOAuth state value

Returns: GoogleAuthorizeResult. See shared models for nested fields.

auth.googleCallback​

Exchange Google authorization code.

POST /v1/auth/google/callback

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.googleCallback(input)
Pythonc.auth.google_callback(**input)
Javac.auth.googleCallback(input)
Goc.Auth.GoogleCallback(ctx, input, &result)
PHP$c->auth->googleCallback($input)

Input: GoogleCallbackPayload. Fields are sent in the JSON body.

FieldRequiredTypeDescription
codeYesstringVerification or OAuth authorization code
stateYesstringOAuth state value
redirectUriYesstringOAuth callback URL; use the same value for authorization and exchange

Returns: AuthSession. See shared models for nested fields.

auth.googleToken​

Sign in with Google ID token.

POST /v1/auth/google/token

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.googleToken(input)
Pythonc.auth.google_token(**input)
Javac.auth.googleToken(input)
Goc.Auth.GoogleToken(ctx, input, &result)
PHP$c->auth->googleToken($input)

Input: GoogleTokenInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
idTokenYesstringID token from Google Identity Services

Returns: AuthSession. See shared models for nested fields.

auth.wechatAuthorize​

WeChat authorization URL.

GET /v1/auth/wechat/authorize

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.wechatAuthorize(input)
Pythonc.auth.wechat_authorize(**input)
Javac.auth.wechatAuthorize(input)
Goc.Auth.WechatAuthorize(ctx, input, &result)
PHP$c->auth->wechatAuthorize($input)

Input: OAuthAuthorizeInput. Fields are sent as URL query parameters.

FieldRequiredTypeDescription
redirectUriYesstringOAuth callback URL; use the same value for authorization and exchange
stateNostring | undefinedOAuth state value

Returns: GoogleAuthorizeResult. See shared models for nested fields.

auth.wechatCallback​

Exchange WeChat authorization code.

POST /v1/auth/wechat/callback

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.wechatCallback(input)
Pythonc.auth.wechat_callback(**input)
Javac.auth.wechatCallback(input)
Goc.Auth.WechatCallback(ctx, input, &result)
PHP$c->auth->wechatCallback($input)

Input: GoogleCallbackPayload. Fields are sent in the JSON body.

FieldRequiredTypeDescription
codeYesstringVerification or OAuth authorization code
stateYesstringOAuth state value
redirectUriYesstringOAuth callback URL; use the same value for authorization and exchange

Returns: WechatCallbackResult. See shared models for nested fields.

auth.sendWechatBindPhone​

Send phone code for WeChat sign-in.

POST /v1/auth/wechat/bind-phone/send

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.sendWechatBindPhone(input)
Pythonc.auth.send_wechat_bind_phone(**input)
Javac.auth.sendWechatBindPhone(input)
Goc.Auth.SendWechatBindPhone(ctx, input, &result)
PHP$c->auth->sendWechatBindPhone($input)

Input: WechatBindPhoneSendInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
bindTicketYesstringOne-time binding ticket from the WeChat callback
phoneYesstringMainland China phone number, optionally prefixed with +86
captchaTicketNostring | undefinedCaptcha ticket
captchaRandstrNostring | undefinedCaptcha random string

Returns: SendCodeResult. See shared models for nested fields.

auth.verifyWechatBindPhone​

Verify phone for WeChat sign-in.

POST /v1/auth/wechat/bind-phone/verify

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.verifyWechatBindPhone(input)
Pythonc.auth.verify_wechat_bind_phone(**input)
Javac.auth.verifyWechatBindPhone(input)
Goc.Auth.VerifyWechatBindPhone(ctx, input, &result)
PHP$c->auth->verifyWechatBindPhone($input)

Input: WechatBindPhoneVerifyInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
codeYesstringVerification or OAuth authorization code
bindTicketYesstringOne-time binding ticket from the WeChat callback
phoneYesstringMainland China phone number, optionally prefixed with +86
captchaTicketNostring | undefinedCaptcha ticket
captchaRandstrNostring | undefinedCaptcha random string

Returns: AuthSession. See shared models for nested fields.

auth.sendBindPhone​

Send phone binding code.

POST /v1/auth/phone/bind/send

Authentication: tenant Bearer token.

LanguageCall
Node.jsc.auth.sendBindPhone(input)
Pythonc.auth.send_bind_phone(**input)
Javac.auth.sendBindPhone(input)
Goc.Auth.SendBindPhone(ctx, input, &result)
PHP$c->auth->sendBindPhone($input)

Input: BindPhoneSendInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
phoneYesstringMainland China phone number, optionally prefixed with +86
captchaTicketNostring | undefinedCaptcha ticket
captchaRandstrNostring | undefinedCaptcha random string

Returns: SendCodeResult. See shared models for nested fields.

auth.verifyBindPhone​

Bind phone to signed-in account.

POST /v1/auth/phone/bind/verify

Authentication: tenant Bearer token.

LanguageCall
Node.jsc.auth.verifyBindPhone(input)
Pythonc.auth.verify_bind_phone(**input)
Javac.auth.verifyBindPhone(input)
Goc.Auth.VerifyBindPhone(ctx, input, &result)
PHP$c->auth->verifyBindPhone($input)

Input: PhoneVerifyInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
phoneYesstringMainland China phone number, optionally prefixed with +86
codeYesstringVerification or OAuth authorization code
captchaTicketNostring | undefinedCaptcha ticket
captchaRandstrNostring | undefinedCaptcha random string

Returns: AuthUser. See shared models for nested fields.

auth.wechatBindAuthorize​

WeChat account binding URL.

GET /v1/auth/wechat/bind/authorize

Authentication: tenant Bearer token.

LanguageCall
Node.jsc.auth.wechatBindAuthorize(input)
Pythonc.auth.wechat_bind_authorize(**input)
Javac.auth.wechatBindAuthorize(input)
Goc.Auth.WechatBindAuthorize(ctx, input, &result)
PHP$c->auth->wechatBindAuthorize($input)

Input: OAuthAuthorizeInput. Fields are sent as URL query parameters.

FieldRequiredTypeDescription
redirectUriYesstringOAuth callback URL; use the same value for authorization and exchange
stateNostring | undefinedOAuth state value

Returns: GoogleAuthorizeResult. See shared models for nested fields.

auth.wechatBindCallback​

Bind WeChat to account.

POST /v1/auth/wechat/bind/callback

Authentication: tenant Bearer token.

LanguageCall
Node.jsc.auth.wechatBindCallback(input)
Pythonc.auth.wechat_bind_callback(**input)
Javac.auth.wechatBindCallback(input)
Goc.Auth.WechatBindCallback(ctx, input, &result)
PHP$c->auth->wechatBindCallback($input)

Input: GoogleCallbackPayload. Fields are sent in the JSON body.

FieldRequiredTypeDescription
codeYesstringVerification or OAuth authorization code
stateYesstringOAuth state value
redirectUriYesstringOAuth callback URL; use the same value for authorization and exchange

Returns: AuthUser. See shared models for nested fields.

auth.refresh​

Refresh tenant session.

POST /v1/auth/token/refresh

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.refresh(input)
Pythonc.auth.refresh(**input)
Javac.auth.refresh(input)
Goc.Auth.Refresh(ctx, input, &result)
PHP$c->auth->refresh($input)

Input: RefreshInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
refreshTokenYesstringTenant refresh token

Returns: AuthSession. See shared models for nested fields.

auth.logout​

Revoke tenant session.

POST /v1/auth/logout

Authentication: public endpoint.

LanguageCall
Node.jsc.auth.logout(input)
Pythonc.auth.logout(**input)
Javac.auth.logout(input)
Goc.Auth.Logout(ctx, input, &result)
PHP$c->auth->logout($input)

Input: RefreshInput. Fields are sent in the JSON body.

FieldRequiredTypeDescription
refreshTokenYesstringTenant refresh token

Returns: LogoutResult. See shared models for nested fields.

auth.me​

Current account.

GET /v1/auth/me

Authentication: tenant Bearer token.

LanguageCall
Node.jsc.auth.me()
Pythonc.auth.me()
Javac.auth.me()
Goc.Auth.Me(ctx, &result)
PHP$c->auth->me()

No request fields.

Returns: CurrentUserResult. See shared models for nested fields.