Skip to content
Esc
navigateopen⌘Jpreview
Dashboard

Import one user directly

Import one user immediately with the Bulk Import functionality.

POST/appid-{appId}/bulk-import/import
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.
Path parameters
appIdstringrequired
The application ID. Omit the entire `appid-{appId}` prefix to use `public`.
Header parameters
cdi-versionstring
X.Y of the X.Y.Z CDI version.
Request body
requiredapplication/json
externalUserIduserId
userMetadatauserMetadata
should be a JSON object (not a JSON literal nor an array)
userRolesbulkImportUserRole[]
Show properties
Array of bulkImportUserRole
rolerolerequired
tenantIdstenantId[]required
totpDevicesbulkImportTotpDevice[]
Show properties
Array of bulkImportTotpDevice
secretKeystringrequired
skewnumber
periodnumber
deviceNamestring
loginMethodsbulkImportUserEmailPasswordLoginMethod | bulkImportUserThirdPartyLoginMethod | bulkImportUserPasswordlessLoginMethod[]required
min items 1
Show properties
Array of bulkImportUserEmailPasswordLoginMethod | bulkImportUserThirdPartyLoginMethod | bulkImportUserPasswordlessLoginMethod
One of:
bulkImportUserEmailPasswordLoginMethod
tenantIdstenantId[]
List of tenant IDs this login method is associated with
isVerifiedboolean
Indicates whether the email is verified
isPrimaryboolean
Indicates whether the login method is the primary login method
timeJoinedInMSSinceEpochinteger
Time joined in milliseconds since the epoch
recipeIdstringrequired
Allowed:emailpassword
emailemailrequired
passwordHashpasswordHash
plainTextPasswordstring
hashingAlgorithmhashingAlgorithm
Allowed:argon2bcryptfirebase_scrypt
bulkImportUserThirdPartyLoginMethod
tenantIdstenantId[]
List of tenant IDs this login method is associated with
isVerifiedboolean
Indicates whether the email is verified
isPrimaryboolean
Indicates whether the login method is the primary login method
timeJoinedInMSSinceEpochinteger
Time joined in milliseconds since the epoch
recipeIdstringrequired
Allowed:thirdparty
emailemailrequired
thirdPartyIdthirdPartyIdrequired
thirdPartyUserIdthirdPartyUserIdrequired
bulkImportUserPasswordlessLoginMethod
tenantIdstenantId[]
List of tenant IDs this login method is associated with
isVerifiedboolean
Indicates whether the email is verified
isPrimaryboolean
Indicates whether the login method is the primary login method
timeJoinedInMSSinceEpochinteger
Time joined in milliseconds since the epoch
recipeIdstringrequired
Allowed:passwordless
emailemail
phoneNumberphoneNumber
Responses
200User added successfully
statusstatusOK
Allowed:OK
userauthRecipeUser
Show properties
iduserId
isPrimaryUserboolean
tenantIdstenantId[]
timeJoinedtimeJoined
emailsemail[]
phoneNumbersphoneNumber[]
thirdPartyobject[]
Show properties
Array of object
idthirdPartyId
userIdthirdPartyUserId
loginMethodsobject[]
Show properties
Array of object
tenantIdstenantId[]
recipeUserIduserId
verifiedboolean
timeJoinedtimeJoined
recipeIdrecipeId
Allowed:emailpasswordpasswordlessthirdparty
emailemail
phoneNumberphoneNumber
thirdPartyobject
Show properties
idthirdPartyId
userIdthirdPartyUserId
400User has invalid schema
errorstring
usersobject[]
Show properties
Array of object
indexnumber
Index of the user in the users array that has invalid schema
errorsstring[]
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "/appid-public/bulk-import/import" \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "externalUserId": "fa7a0841-b533-4478-95533-0fde890c3483",
  "userMetadata": {
    "preferences": {
      "theme": "dark"
    },
    "notifications": {
      "email": true
    },
    "todos": [
      "example"
    ]
  },
  "userRoles": [
    {
      "role": "admin",
      "tenantIds": [
        "customer1"
      ]
    }
  ],
  "totpDevices": [
    {
      "secretKey": "2PRXZWZAYYDAWCD",
      "skew": 0,
      "period": 30,
      "deviceName": "My Authy App"
    }
  ],
  "loginMethods": [
    {
      "tenantIds": [
        "customer1"
      ],
      "isVerified": true,
      "isPrimary": true,
      "timeJoinedInMSSinceEpoch": 0,
      "recipeId": "emailpassword",
      "email": "johndoe@gmail.com",
      "passwordHash": "$argon2d$v=19$m=12,t=3,p=1$aGI4enNvMmd0Zm0wMDAwMA$r6p7qbr6HD+8CD7sBi4HVw",
      "plainTextPassword": "passwordExample",
      "hashingAlgorithm": "argon2"
    }
  ]
}'
Response
{
  "status": "OK",
  "user": {
    "id": "fa7a0841-b533-4478-95533-0fde890c3483",
    "isPrimaryUser": true,
    "tenantIds": [
      "customer1"
    ],
    "timeJoined": 1623918032231,
    "emails": [
      "johndoe@gmail.com"
    ],
    "phoneNumbers": [
      "+14155552671"
    ],
    "thirdParty": [
      {
        "id": "google",
        "userId": 106347997792363870000
      }
    ],
    "loginMethods": [
      {
        "tenantIds": [
          "customer1"
        ],
        "recipeUserId": "fa7a0841-b533-4478-95533-0fde890c3483",
        "verified": true,
        "timeJoined": 1623918032231,
        "recipeId": "emailpassword",
        "email": "johndoe@gmail.com",
        "phoneNumber": "+14155552671",
        "thirdParty": {
          "id": "google",
          "userId": 106347997792363870000
        }
      }
    ]
  }
}

API reference

API schema and response details