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.
Başlıklar
X-Fox-TenantstringRequired when authenticating with a dashboard session token instead of a tenant API key.
Örnek:
ten_8f2c91a7
Gövde application/json
namestringzorunluregionstringzorunluAll 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.Değerler:
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.
Değerler:
ecommercesaaseducationhealthfinancefintechpaymentsinsurancegovernmenttelecomcryptogamingmediaotheruser_countriesstring[]Informational only today; does not affect sign-up. ISO 3166-1 alpha-2.
Varsayılan:
[]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 alan
modestringDeğerler:
allonly_listedVarsayılan:allcountriesstring[]
Yanıtlar
201CreatedApplicationWithKeys
Created.
secret_key.keyis returned only once.idstringÖrnek:
app_sellernamestringregionstringMore regions will be added; clients must accept unknown values.
Değerler:
EUTRmulti_regionbooleanNot available yet; planned.
Varsayılan:
falseblockstringEast block planned; operated by a separate company. Every application is
westtoday.Değerler:
westeastVarsayılan:westsectorstringboş olabiliruser_countriesstring[]country_restrictionobject2 alan
modestringDeğerler:
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 alan
googleobject2 alan
enabledbooleanOn unless turned off with
PATCH /applications/{app_id}.Varsayılan:
truemodestringplatform: Fox Login's own Google app. Using your own Google app is planned.Değerler:
platform
publishable_keystringÖrnek:
pk_live_tr_8f2c91a7b3d04e5fcreated_atstring (date-time)secret_keySecretKeyWithKeyzorunluA new secret key. The full
keyappears only in this response; only its hash is stored.8 alan
idstringÖrnek:
key_3b7e10c2namestringÖrnek:
Billing workerrolestringadmin(Full access),editor(Read and write users) orviewer(Read only). ThesecretKeysecurity scheme lists the scopes of each role.Değerler:
admineditorviewerprefixstringÖrnek:
sk_live_eu_Q9xTkeystringThe full key. Send it as
Authorization: Bearer <key>.Örnek:
sk_live_eu_Q9xTa7Lm2Nb4Vc6Xz8Sd1Fg3Hj5Kl7Pq9Wr2Ey4Tu6Icreated_atstring (date-time)created_bystringboş olabilirÖrnek:
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).errorobjectzorunlu5 alan
codestringzorunluStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Örnek:
region_unavailablemessagestringzorunluPlain English, for developers
regionstringboş olabilirRegion that produced the error, if any
Değerler:
EUTRretryablebooleanzorunludetailsobject
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).errorobjectzorunlu5 alan
codestringzorunluStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Örnek:
region_unavailablemessagestringzorunluPlain English, for developers
regionstringboş olabilirRegion that produced the error, if any
Değerler:
EUTRretryablebooleanzorunludetailsobject
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).errorobjectzorunlu5 alan
codestringzorunluStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Örnek:
region_unavailablemessagestringzorunluPlain English, for developers
regionstringboş olabilirRegion that produced the error, if any
Değerler:
EUTRretryablebooleanzorunludetailsobject
503Service UnavailableError
region_unavailable: the application is not created if its region cannot be told about it.errorobjectzorunlu5 alan
codestringzorunluStable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable
Örnek:
region_unavailablemessagestringzorunluPlain English, for developers
regionstringboş olabilirRegion that produced the error, if any
Değerler:
EUTRretryablebooleanzorunludetailsobject