---
title: "Migrate vendor users in bulk"
method: POST
path: "/resources/migrations/v1/local/bulk"
tags: ["Data migration"]
---

# Migrate vendor users in bulk

`POST /resources/migrations/v1/local/bulk`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/migrations/v1/local/bulk`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/migrations/v1/local/bulk/post.ts> (a function with typed inputs; its response is checked against the schema)

This route enables you to migrate users in bulk. Expects an array of `users`. Each entry must include a user's `email` and `tenantId`, which specifies that user's parent account. Use the the other fields as needed to store additional information. We recommend using the `metadata` property if you need to store custom information in a user's object.

## Request body

- MigrateUsersRequest
  - `users` MigrateUserRequest[], required
    - `passwordHash` string: The password hash. For SCrypt should include the salt and key seperated by the salt separator
    - `passwordHashType` 'bcrypt' | 'scrypt' | 'firebase-scrypt' | 'pbkdf2' | 'argon2'
    - `passwordHashConfig` string: Stringified JSON Hashing config for the migrated password. For SCrypt should be formatted as { saltSeparator, N, r, p, keyLen }. For FirebaseScrypt should be formatted as { memCost, rounds, saltSeparator, signerKey }
    - `phoneNumber` string: phoneNumber can be used both for login with SMS and for MFA This auto-enrolls the user in MFA, prompting them at first login (regardless of tenant/vendor MFA settings). The required format is an area code + number, no spaces. For example: "+16037184056" The number must be unique
    - `provider` 'local' | 'saml' | 'google' | 'github' | 'facebook' | 'microsoft' | 'scim2' | 'slack' | 'apple'
    - `metadata` string: Stringified JSON object
    - `verifyUser` boolean: Whether to verify the user as part of the migration process. If this is set to false, another call is required for the verify user API
    - `roleIds` string[]: Role ids of the migrated users. If not provided, the user will be assigned the default roles
    - `email` string, required
    - `tenantId` string, required
    - `name` string
    - `profilePictureUrl` string
    - `authenticatorAppMfaSecret` string

## Response `202`

- MigrationContext
  - `migrationId` string, required

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
