Upsert connection URI domain
This API is deprecated. Please use the v2 version of this API. In the v2 version of the API, the login methods are no longer enabled using the emailPasswordEnabled, thirdPartyEnabled and passwordlessEnabled inputs. Instead, they are enabled using factorIds (such as emailpassword, otp-email, etc) specified in the firstFactors and requiredSecondaryFactors inputs. Please refer Multitenancy Docs to know the list of factorIds available.
Note: This deprecated API still accepts those emailPasswordEnabled, thirdPartyEnabled and passwordlessEnabled inputs for backward compatibility.
Create or update a connection uri domain.
SuperTokens subscription license key is required, if not using the base connection uri domain.
This request must originate from public app and public tenant on the base connection uri domain.
If creating a new connection uri domain, only the login methods set to true will be enabled and rest will be disabled by default.
firstFactors and requiredSecondaryFactors can be set to null to remove all entries in the core, or a non empty string array to be updated in the core. Setting of empty array is disallowed.
Note: the create/update will fail if a login method is not enabled and a relavant factor is added to either firstFactors or requiredSecondaryFactors. For example, emailPasswordEnabled cannot be set to false if emailpassword is present in the firstFactors array.
If updating an existing connection uri domain,
- core will keep the existing state of login methods and only update the ones that are specified in the request body.
- Core config will be merged into existing config. To delete a key in the config, use a null value
Note: The core config must contain a unique connection to the storage layer, because sharing of database between 2 different connection uri domains is not allowed.
Note: Updation of core config is not allowed for the default connectionUriDomain. In order to update config for the default connectionUriDomain, you must edit the config.yaml or the docker env directly.
/recipe/multitenancy/connectionuridomaindeprecatedapi-keyAPI key · headerrequiredridstringcdi-versionstringapplication/jsonconnectionUriDomainstringrequiredemailPasswordEnabledbooleanthirdPartyEnabledbooleanpasswordlessEnabledbooleanfirstFactorsfirstFactorsrequiredSecondaryFactorsrequiredSecondaryFactorscoreConfigobjectstatusstatusOKrequiredOKcreatedNewbooleanrequiredstringstringstringstringstringTry it
curl -X PUT "/recipe/multitenancy/connectionuridomain" \
-H "api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"connectionUriDomain": "core-1234.supertokens.io:3567",
"emailPasswordEnabled": true,
"thirdPartyEnabled": true,
"passwordlessEnabled": true,
"firstFactors": [
"emailpassword"
],
"requiredSecondaryFactors": [
"otp-phone"
],
"coreConfig": {}
}'const response = await fetch("/recipe/multitenancy/connectionuridomain", {
method: "PUT",
headers: {
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"connectionUriDomain": "core-1234.supertokens.io:3567",
"emailPasswordEnabled": true,
"thirdPartyEnabled": true,
"passwordlessEnabled": true,
"firstFactors": [
"emailpassword"
],
"requiredSecondaryFactors": [
"otp-phone"
],
"coreConfig": {}
})
});import requests
response = requests.put(
"/recipe/multitenancy/connectionuridomain",
headers={
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"connectionUriDomain": "core-1234.supertokens.io:3567",
"emailPasswordEnabled": True,
"thirdPartyEnabled": True,
"passwordlessEnabled": True,
"firstFactors": [
"emailpassword"
],
"requiredSecondaryFactors": [
"otp-phone"
],
"coreConfig": {}
},
){
"status": "OK",
"createdNew": true
}"string""Invalid API key""License Error""Not Found""Internal Error"