---
title: "Migrate a vendor user"
method: POST
path: "/resources/migrations/v1/local"
tags: ["Data migration"]
---

# Migrate a vendor user

`POST /resources/migrations/v1/local`

## Request

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

This route enables you to migrate a user by sending the following required fields: user’s email, their tenantId and metadata, a new user will be created. This endpoint takes other properties as well, such as the user’s name, their phone number, hashed password, etc...

## Request body

- MigrateUserRequest
  - `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 `201`

- UserDto
  - `id` string, required
  - `email` string, required
  - `name` string
  - `profilePictureUrl` string
  - `sub` string, required
  - `verified` boolean, required
  - `mfaEnrolled` boolean, required
  - `mfaBypass` boolean
  - `phoneNumber` string
  - `roles` RoleResponse[], required
    - `id` string, required
    - `vendorId` string, required
    - `tenantId` string, required
    - `key` string, required
    - `name` string, required
    - `description` string, required
    - `isDefault` boolean, required
    - `firstUserRole` boolean, required
    - `level` number, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `permissions` string[], required
  - `permissions` PermissionResponse[], required
    - `id` string, required
    - `key` string, required
    - `name` string, required
    - `description` string, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `roleIds` string[], required
    - `categoryId` string, required
    - `fePermission` boolean, required
  - `provider` string, required
  - `tenantId` string, required
  - `tenantIds` string[], required
  - `activatedForTenant` boolean
  - `isLocked` boolean
  - `tenants` UserTenantDto[], required
    - `tenantId` string, required
    - `roles` RoleResponse[], required
      - `id` string, required
      - `vendorId` string, required
      - `tenantId` string, required
      - `key` string, required
      - `name` string, required
      - `description` string, required
      - `isDefault` boolean, required
      - `firstUserRole` boolean, required
      - `level` number, required
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `permissions` string[], required
    - `temporaryExpirationDate` string, date-time
    - `isDisabled` boolean
  - `invisible` boolean
  - `superUser` boolean
  - `metadata` string, required
  - `vendorMetadata` string, required
  - `createdAt` string, date-time, required
  - `lastLogin` string, date-time, required
  - `groups` object[]
  - `subAccountAccessAllowed` boolean, required
  - `managedBy` 'frontegg' | 'scim2' | 'external'

---

[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)
