Sign in / sign up with a Google credential
const url = 'https://api.tovarifinancial.com/auth/google';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"credential":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tovarifinancial.com/auth/google \ --header 'Content-Type: application/json' \ --data '{ "credential": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”object
Google ID-token credential from GIS
Examplegenerated
{ "credential": "example"}Responses
Section titled “Responses”Existing user authenticated (tokens issued), OR a second factor is required (challenge returned, no tokens)
object
Existing user authenticated — tokens issued.
object
Access/ID token lifetime in seconds.
object
object
TRUE when the outstanding policies are a first acceptance rather than an update.
object
Derived from users.email_verified, the sole source of truth for the gate.
object
Seconds the resend button stays disabled after an interactive send.
The session user display-language state (KAN-3773).
object
The per-environment Spanish rollout flag. False ⇒ effectiveLocale is always ‘en’.
The explicit choice; null = use device language.
This request’s X-Client-Locale, else the last-seen device language, else null.
The language to display: ‘en’ when the flag is off, else preference ?? detected ?? ‘en’.
Always false on a 200 — a brand-new account answers 201.
TRUE when this request replaced the account password to complete the Google link.
A second factor is required. email is carried because POST /auth/mfa needs it and an SSO client has no reliable way to know it. A challenge implies an EXISTING user, so there is no isNewUser.
object
object
The Cognito challenge name, e.g. SOFTWARE_TOKEN_MFA.
Example
{ "data": { "verification": { "status": "verified" }, "language": { "preference": "en", "detected": "en", "effectiveLocale": "en" } }}New account created from the Google credential; tokens issued
object
object
Access/ID token lifetime in seconds.
object
object
TRUE when the outstanding policies are a first acceptance rather than an update.
object
Derived from users.email_verified, the sole source of truth for the gate.
object
Seconds the resend button stays disabled after an interactive send.
The session user display-language state (KAN-3773).
object
The per-environment Spanish rollout flag. False ⇒ effectiveLocale is always ‘en’.
The explicit choice; null = use device language.
This request’s X-Client-Locale, else the last-seen device language, else null.
The language to display: ‘en’ when the flag is off, else preference ?? detected ?? ‘en’.
Always true on a 201.
Example
{ "data": { "verification": { "status": "verified" }, "language": { "preference": "en", "detected": "en", "effectiveLocale": "en" } }}Validation failed — see errorCode / fieldErrors
object
Machine-readable error code (AUTH_ERROR_CODES).
Optional field-level validation errors, keyed by field name.
object
Example
{ "errorCode": "INVALID_EMAIL_FORMAT"}Missing, invalid, or expired bearer token
object
Machine-readable error code (AUTH_ERROR_CODES).
Optional field-level validation errors, keyed by field name.
object
Example
{ "errorCode": "INVALID_EMAIL_FORMAT"}Conflict — errorCode is one of: IDENTITY_CONFLICT (the verified email belongs to an account already bound to a different Google identity, or the binding was lost to a concurrent request); USER_ALREADY_EXISTS (an account exists for this email that this sign-in cannot link or heal); UNCLAIMED_INVITE_ACCOUNT (the email resolves to an account created by accepting a household invite that has never verified its email — a fixed-message refusal, carrying no details, that writes nothing and tells the user to sign in with the password set when the invitation was accepted and verify their email first).
object
Machine-readable error code (AUTH_ERROR_CODES).
Optional field-level validation errors, keyed by field name.
object
Example
{ "errorCode": "INVALID_EMAIL_FORMAT"}Internal error (no internal detail leaked)
object
Machine-readable error code (AUTH_ERROR_CODES).
Optional field-level validation errors, keyed by field name.
object
Example
{ "errorCode": "INVALID_EMAIL_FORMAT"}Service temporarily unavailable — errorCode is SERVICE_UNAVAILABLE. A TRANSIENT, RETRYABLE condition rather than a defect in the request: a query that exceeded its time budget, a lost or refused database connection, a saturated connection pool, or an outage at an upstream provider the request depends on (the authentication provider, or the bank data provider on a bank-connection operation). The identical request may succeed on retry — back off briefly and, on a write, resend the same X-Idempotency-Key where the operation accepts one.
object
Machine-readable error code (AUTH_ERROR_CODES).
Optional field-level validation errors, keyed by field name.
object
Example
{ "errorCode": "INVALID_EMAIL_FORMAT"}