Skip to content
Esc
navigateopen⌘Jpreview
Dashboard

Add bulk import users

Add users for bulk import. Maximum 10000 users can be added in one request.

POST/appid-{appId}/bulk-import/users
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
usersbulkImportUser[]required
max items 10000
Show properties
Array of bulkImportUser
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
200Bulk Import Users added successfully
statusstatusOK
Allowed:OK
usersaddBulkImportUserResponse[]
Show properties
Array of addBulkImportUserResponse
userIduserId
loginMethodsaddBulkImportUserLoginMethodResponse[]
Show properties
Array of addBulkImportUserLoginMethodResponse
recipeIdstringrequired
userIduserIdrequired
tenantstenantId[]required
emailemailrequired
thirdpartyIdthirdPartyId
thirdpartyUserIdthirdPartyUserId
phoneNumberphoneNumber
400One or more users have invalid schema
errorstring
usersobject[]
Show properties
Array of object
indexnumber
Index of the user in the users array that has invalid schema
errorsstring[]
401error code 401
string
404error code 404
string
500error code 500
string
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "/appid-public/bulk-import/users" \
  -H "api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "users": [
    {
      "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",
  "users": [
    {
      "userId": "fa7a0841-b533-4478-95533-0fde890c3483",
      "loginMethods": [
        {
          "recipeId": "emailpassword",
          "userId": "fa7a0841-b533-4478-95533-0fde890c3483",
          "tenants": [
            "customer1"
          ],
          "email": "johndoe@gmail.com",
          "thirdpartyId": "google",
          "thirdpartyUserId": 106347997792363870000,
          "phoneNumber": "+14155552671"
        }
      ]
    }
  ]
}

API reference

API schema and response details