End-user API (SDK)
Google sign-in, step 2 for a new user: set the country
POST/v1/client/oauth/complete
Base URL: https://eu.auth.foxlogin.app, https://tr.auth.foxlogin.app
For fox_status=country_required: creates the user with the
chosen country and signs in, answering like
/v1/client/oauth/token. The ticket works once, for 15 minutes.
The country is checked before the ticket is used, so after
invalid_country or country_not_allowed the user can pick
another country with the same ticket. If a user with the same
email signed up in the meantime, the Google account is linked to
that user instead. Records user.created and user.signed_in
with method: google. Counts toward the limit of 20 code checks
per minute per IP address.
Body application/json
ticketstringrequiredThe
fox_ticketquery parameter from the redirect. Works once, for 15 minutes.Example:
fxc_Ab3dE5fG7hJ9kL1mN3pQ5rS7tU9vW1xY3zA5bC7dE9fcountrystringrequiredISO 3166-1 alpha-2, in any case.
Example:
TR
Responses
200OKSession | MfaRequired
Signed in, or
mfa_requiredSession | MfaRequired
A session, or
mfa_requiredwhen the account has two-factor authentication on.One of:
Session
userEndUserProfileThe end-user object returned by the End-user API (SDK). Has no
phonefield; phone sign-in is not implemented.10 properties
idstringExample:
usr_tr_8f2c91a7regionstringMore regions will be added; clients must accept unknown values.
Values:
EUTRemailstringemail_verifiedbooleannamestringnullablecountrystringISO 3166-1 alpha-2
statusstringOnly
activeis reachable through the SDK; other statuses cannot sign in.Example:
activelabelsLabelscreated_atstring (date-time)last_sign_in_atstringnullable
session_idstringaccess_tokenstringrefresh_tokenstringtoken_type"Bearer"expires_in600
MfaRequired
status"mfa_required"requiredmfa_tokenstringrequiredOpaque, 5-minute lifetime, 5 wrong codes invalidate it (
invalid_mfa_token).
400Bad RequestError
invalid_code(the ticket is wrong, used or expired; start again) orinvalid_country.errorobjectrequired5 properties
codestringrequiredStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Example:
region_unavailablemessagestringrequiredPlain English, for developers
regionstringnullableRegion that produced the error, if any
Values:
EUTRretryablebooleanrequireddetailsobject
401UnauthorizedError
Missing or invalid key or token. The Management API answers
missing_api_key(no Bearer token) orinvalid_api_key(unknown or revoked secret key or organization API key).errorobjectrequired5 properties
codestringrequiredStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Example:
region_unavailablemessagestringrequiredPlain English, for developers
regionstringnullableRegion that produced the error, if any
Values:
EUTRretryablebooleanrequireddetailsobject
403ForbiddenError
account_locked: the user this Google account belongs to is not active.errorobjectrequired5 properties
codestringrequiredStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Example:
region_unavailablemessagestringrequiredPlain English, for developers
regionstringnullableRegion that produced the error, if any
Values:
EUTRretryablebooleanrequireddetailsobject
422Unprocessable ContentError
country_not_allowed: the application only accepts users from the countries listed incountry_restriction.countries.errorobjectrequired5 properties
codestringrequiredStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Example:
region_unavailablemessagestringrequiredPlain English, for developers
regionstringnullableRegion that produced the error, if any
Values:
EUTRretryablebooleanrequireddetailsobject
429Too Many RequestsError
rate_limited. Retry afterRetry-Afterseconds.errorobjectrequired5 properties
codestringrequiredStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Example:
region_unavailablemessagestringrequiredPlain English, for developers
regionstringnullableRegion that produced the error, if any
Values:
EUTRretryablebooleanrequireddetailsobject