B2B Saas Authentication

/

API reference

/

Passwords

/

Migrate

Migrate

POSThttps://test.stytch.com/v1/b2b/passwords/migrate

Adds an existing password to a member's email that doesn't have a password yet. We support migrating members from passwords stored with bcrypt, scrypt, argon2, MD-5, SHA-1, and PBKDF2. This endpoint has a rate limit of 100 requests per second.

The member's email will be marked as verified when you use this endpoint.


Body parameters


organization_id*string

email_address*string

namestring

trusted_metadataobject

untrusted_metadataobject

hash*string

hash_type*string

scrypt_configobject

argon_2_configobject

md_5_configobject

sha_1_configobject

pbkdf_2_configobject

rolesarray[strings]

preserve_existing_sessionsboolean

Response fields


member_idstring

member_createdboolean

memberobject

organizationobject

status_codeint

request_idstring
curl --request POST \
  --url https://test.stytch.com/v1/b2b/passwords/migrate \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "email_address": "sandbox@stytch.com",
    "hash": "$2a$12$vefoDBbzuMb/NczV/fc9QemTizkNAZr9EO02pIUHPAAJibcYp0.ne",
    "hash_type": "bcrypt",
    "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"
  }'

RESPONSE

200
{
	"member": {
		"email_address": "sandbox@stytch.com",
		"email_address_verified": true,
		"is_breakglass": false,
		"member_id": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
		"member_password_id": "member-password-test-2aaf4...",
		"mfa_enrolled": false,
		"mfa_phone_number": "",
		"mfa_phone_number_verified": false,
		"name": "",
		"oauth_registrations": [],
		"organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
		"sso_registrations": [],
		"scim_registration": [],
		"status": "pending",
		"trusted_metadata": {},
		"untrusted_metadata": {}
	},
	"member_created": true,
	"member_id": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
	"organization": {...},
	"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
	"status_code": 200
}

Common Error Types