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.
How Imported Users Authenticate
Section titled “How Imported Users Authenticate”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.
Import Tenants
Section titled “Import Tenants”HTTP Request
Section titled “HTTP Request”POST https://api.thebridge.dev/account/import/tenants
Body Structure
Section titled “Body Structure”The request body is an array of import objects, each containing:
ImportTenant
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Optional | Name of the tenant |
owner | ImportUser | Required | The owner for this tenant |
plan | string | Optional | Key of an existing plan |
logo | string | Optional | A URI to a logo |
metadata | Record | Optional | Custom key-value metadata |
ImportUser
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Required | The username / email |
role | string | Optional | Role of the user |
firstName | string | Optional | User's first name |
lastName | string | Optional | User's last name |
password | ImportPassword | Optional | Import an existing password |
ImportPassword
| Parameter | Type | Required | Description |
|---|---|---|---|
value | string | Required | The password digest |
algorithm | string | Required | BCRYPT, ARGON2I, MD5, SHA1, SHA256, or SHA512 |
pepper | object | Optional | Optional pepper: { value: string, position: 'BEGIN' | 'END' } |
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/import/tenantsValidate Import Data
Section titled “Validate Import Data”Validates the import body and returns a result that summarizes the import and indicates any errors or warnings, without actually performing the import.
HTTP Request
Section titled “HTTP Request”POST https://api.thebridge.dev/account/import/validateTenants
The request body format is identical to the Import Tenants endpoint.
Response HTTP 200
Section titled “Response HTTP 200”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
https://api.thebridge.dev/account/import/validateTenants