Skip to content
Esc
navigateopen⌘Jpreview
Dashboard

Upsert app (deprecated)

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 an app. SuperTokens subscription license key is required.

If creating a new app, 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 app,

  1. core will keep the existing state of login methods and only update the ones that are specified in the request body.
  2. Core config will be merged into existing config. To delete a key in the config, use a null value

Note: the newly created app will use the same connection uri domain from which this request originates and the request must originate from public app and public tenant.

Note: Updation of core config is not allowed for the default connectionUriDomain, public app. In order to update config for the default connectionUriDomain and public app, you must edit the config.yaml or the docker env directly.

PUT/recipe/multitenancy/appdeprecated
Authorization
api-keyAPI key · headerrequired
The core service API token. If you are using a self-hosted core service and you have not generated a token, you can omit the header.
Header parameters
ridstring
cdi-versionstring
X.Y of the X.Y.Z CDI version.
Request body
application/json
appIdstringrequired
emailPasswordEnabledboolean
thirdPartyEnabledboolean
passwordlessEnabledboolean
firstFactorsfirstFactors
requiredSecondaryFactorsrequiredSecondaryFactors
coreConfigobject
Responses
200Create or Update app result
statusstatusOKrequired
Allowed:OK
createdNewbooleanrequired
400error code 400
string
401error code 401
string
402error code 402
string
404error code 404
string
500error code 500
string
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT "/recipe/multitenancy/app" \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "appId": "app1",
  "emailPasswordEnabled": true,
  "thirdPartyEnabled": true,
  "passwordlessEnabled": true,
  "firstFactors": [
    "emailpassword"
  ],
  "requiredSecondaryFactors": [
    "otp-phone"
  ],
  "coreConfig": {}
}'
Response
{
  "status": "OK",
  "createdNew": true
}

API reference

API schema and response details