Skip to content

Data Import

Import tenants and their users in bulk. No notification emails will be sent to imported users. The import is asynchronous — it will be scheduled immediately and completed once every tenant and user has been imported.

The import supports importing users both with or without existing passwords.

  • Without password: Users can authenticate using configured SSO options. They will be asked to reset their password if they try username login.
  • With password: The Bridge will use the imported password for the first authentication, then generate a new password digest for all future logins.

POST https://api.thebridge.dev/account/import/tenants

The request body is an array of import objects, each containing:

ImportTenant

ParameterTypeRequiredDescription
namestringOptionalName of the tenant
ownerImportUserRequiredThe owner for this tenant
planstringOptionalKey of an existing plan
logostringOptionalA URI to a logo
metadataRecordOptionalCustom key-value metadata

ImportUser

ParameterTypeRequiredDescription
usernamestringRequiredThe username / email
rolestringOptionalRole of the user
firstNamestringOptionalUser's first name
lastNamestringOptionalUser's last name
passwordImportPasswordOptionalImport an existing password

ImportPassword

ParameterTypeRequiredDescription
valuestringRequiredThe password digest
algorithmstringRequiredBCRYPT, ARGON2I, MD5, SHA1, SHA256, or SHA512
pepperobjectOptionalOptional pepper: { value: string, position: 'BEGIN' | 'END' }

HTTP 200 — Returns status, reference, and import summary.

Request example

curl --request POST 'https://api.thebridge.dev/account/import/tenants' \
--header 'x-api-key: YOUR_APP_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '[
  {
    "tenant": {
      "name": "John Ltd",
      "plan": "MEDIUM",
      "owner": {
        "username": "peter@doe.com",
        "firstName": "Peter",
        "lastName": "Doe"
      }
    },
    "users": [
      {
        "username": "john@doe.com",
        "firstName": "John",
        "lastName": "Doe",
        "role": "ADMIN"
      }
    ]
  }
]'

Response example:

{
"status": "SCHEDULED",
"reference": "606b00a61679e20008d5654b",
"import": {
"tenants": 2,
"users": 4,
"passwords": false,
"errors": [],
"warnings": [],
"approved": true
}
}
POST Try it out
POST https://api.thebridge.dev/account/import/tenants
Stored in session memory only. Never persisted.

Validates the import body and returns a result that summarizes the import and indicates any errors or warnings, without actually performing the import.

POST https://api.thebridge.dev/account/import/validateTenants

The request body format is identical to the Import Tenants endpoint.

HTTP 200 — Returns tenants count, users count, errors, warnings, and approved flag.

Response example:

{
"tenants": 2,
"users": 4,
"passwords": false,
"errors": [
"One or more users are missing an username"
],
"warnings": [],
"approved": false
}
POST Try it out
POST https://api.thebridge.dev/account/import/validateTenants
Stored in session memory only. Never persisted.