Docs

Bulk User Import Database Schema and Example

The users file must have an array with the users' information in JSON format. The following JSON schema describes valid users:

{
    "type": "object",
    "properties": {
        "email_verified": {
            "type": "boolean"
        },
        "email": {
            "type": "string",
            "description": "The email of the user.",
            "format": "email"
        },
        "username": {
            "type": "string",
            "description": "The username."
        },
        "app_metadata": {
            "type": "object",
            "description": "Data related to the user that does affect the application's core functionality."
        },
        "user_metadata": {
            "type": "object",
            "description": "Data related to the user that does not affect the application's core functionality."
        }
    },
    "required": ["email", "email_verified"],
    "additionalProperties": false
}

User app_metadata schema

Additionally, the app_metadata should not contain any of these properties:

  • clientID
  • globalClientID
  • global_client_id
  • email_verified
  • user_id
  • identities
  • lastIP
  • lastLogin
  • metadata
  • created_at
  • loginsCount
  • _id

The app_metadata stores information that can impact how an application functions or what the user can access (for example, a user's support plan or roles and access groups). For more information, refer to User Metadata.

File example

A file with the following contents is valid:

[
  {
    "email": "john.doe@contoso.com",
    "email_verified": false,
    "app_metadata": {
        "roles": ["admin"],
        "plan": "premium"
    },
    "user_metadata": {
        "theme": "light"
    }
  }
]

The file size limit for a bulk import is 500KB. You will need to start multiple imports if your data exceeds this size.

Keep reading