Applications
Create an application
POST/v1/applications
Creates a new, separate login with its own users, a publishable
key and a first secret key. The response's secret_key holds that
key (name Default, role admin); the full key appears only in
this response, so store it on your server right away.
The body takes no redirect URLs or provider settings; set them
afterwards with PATCH /applications/{app_id}. Google sign-in is
on by default (providers.google.enabled: true) and works once the
application has at least one redirect URL.
region is required and cannot be changed later (PATCH answers
422 region_immutable): all end users of the application are
stored in that region. Pick the region of your users' country (TR
for Turkey, EU for everyone else at launch).
Needs an organization API key or a dashboard session. The caller
receives the new application's admin secret key, so it needs all
of that role's scopes (applications:read, applications:write,
users:read, users:write, events:read), or it gets
403 missing_scope. A secret key gets
403 secret_key_not_allowed.
Header
X-Fox-TenantstringRequired when authenticating with a dashboard session token instead of a tenant API key.
Beispiel:
ten_8f2c91a7
Body application/json
namestringerforderlichregionstringerforderlichAll end users of this application are stored in this region, whatever country they choose (single-region applications). Cannot be changed after creation;
PATCHanswers422 region_immutable.Werte:
EUTRsectorstringfinance, fintech, payments, insurance, health, government, telecom and crypto show a warning and a contact address in the dashboard. Banks, payment institutions and e-money institutions are excluded by the Terms.
Werte:
ecommercesaaseducationhealthfinancefintechpaymentsinsurancegovernmenttelecomcryptogamingmediaotheruser_countriesstring[]Informational only today; does not affect sign-up. ISO 3166-1 alpha-2.
Standard:
[]country_restrictionobjectDefault
all: users from every country can sign up and are stored in the application's region. Accepting users from countries with their own data-location rules (for example Russia or China) is the tenant's responsibility under the DPA.only_listed: only the listed countries can sign up; others get422 country_not_allowed.2 Felder
modestringWerte:
allonly_listedStandard:allcountriesstring[]
Antworten
201CreatedApplicationWithKeys
Created.
secret_key.keyis returned only once.idstringBeispiel:
app_sellernamestringregionstringMore regions will be added; clients must accept unknown values.
Werte:
EUTRmulti_regionbooleanNot available yet; planned.
Standard:
falseblockstringEast block planned; operated by a separate company. Every application is
westtoday.Werte:
westeastStandard:westsectorstringnullableuser_countriesstring[]country_restrictionobject2 Felder
modestringWerte:
allonly_listedcountriesstring[]
redirect_urlsstring[]The exact URLs Google sign-in may send users back to. Empty until you set them with
PATCH /applications/{app_id}.providersobjectSocial sign-in providers. Google is the only one today.
1 Feld
googleobject2 Felder
enabledbooleanOn unless turned off with
PATCH /applications/{app_id}.Standard:
truemodestringplatform: Fox Login's own Google app. Using your own Google app is planned.Werte:
platform
publishable_keystringBeispiel:
pk_live_tr_8f2c91a7b3d04e5fcreated_atstring (date-time)secret_keySecretKeyWithKeyerforderlichA new secret key. The full
keyappears only in this response; only its hash is stored.8 Felder
idstringBeispiel:
key_3b7e10c2namestringBeispiel:
Billing workerrolestringadmin(Full access),editor(Read and write users) orviewer(Read only). ThesecretKeysecurity scheme lists the scopes of each role.Werte:
admineditorviewerprefixstringBeispiel:
sk_live_eu_Q9xTkeystringThe full key. Send it as
Authorization: Bearer <key>.Beispiel:
sk_live_eu_Q9xTa7Lm2Nb4Vc6Xz8Sd1Fg3Hj5Kl7Pq9Wr2Ey4Tu6Icreated_atstring (date-time)created_bystringnullableBeispiel:
usr_eu_8f2c91a7last_used_atnull
400Bad RequestError
invalid_name(1-100 characters),invalid_country_restriction(modemust bealloronly_listed) orinvalid_country(not an ISO 3166-1 alpha-2 code, incountry_restriction.countriesoruser_countries).errorobjecterforderlich5 Felder
codestringerforderlichStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Beispiel:
region_unavailablemessagestringerforderlichPlain English, for developers
regionstringnullableRegion that produced the error, if any
Werte:
EUTRretryablebooleanerforderlichdetailsobject
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).errorobjecterforderlich5 Felder
codestringerforderlichStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Beispiel:
region_unavailablemessagestringerforderlichPlain English, for developers
regionstringnullableRegion that produced the error, if any
Werte:
EUTRretryablebooleanerforderlichdetailsobject
403ForbiddenError
missing_scope(the role or scopes of the key, or the dashboard role, lack the scope),secret_key_not_allowed(a secret key called an endpoint for the whole organization) ornot_a_member(X-Fox-Tenant names a tenant the caller does not belong to).errorobjecterforderlich5 Felder
codestringerforderlichStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Beispiel:
region_unavailablemessagestringerforderlichPlain English, for developers
regionstringnullableRegion that produced the error, if any
Werte:
EUTRretryablebooleanerforderlichdetailsobject
503Service UnavailableError
region_unavailable: the application is not created if its region cannot be told about it.errorobjecterforderlich5 Felder
codestringerforderlichStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Beispiel:
region_unavailablemessagestringerforderlichPlain English, for developers
regionstringnullableRegion that produced the error, if any
Werte:
EUTRretryablebooleanerforderlichdetailsobject