Consumer Authentication

/

API reference

/

Passwords

/

Migrate

Migrate Password

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

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


Body parameters


email*string

nameobject

trusted_metadataobject

untrusted_metadataobject

hash*string

hash_type*string

scrypt_configobject

argon_2_configobject

md_5_configobject

sha_1_configobject

pbkdf_2_configobject

set_email_verifiedboolean

Response fields


status_codeint

request_idstring

user_idstring

userobject

email_idstring

user_createdboolean
curl --request POST \
  --url https://test.stytch.com/v1/passwords/migrate \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sandbox@stytch.com",
    "hash": "$2a$12$vefoDBbzuMb/NczV/fc9QemTizkNAZr9EO02pIUHPAAJibcYp0.ne",
    "hash_type": "bcrypt"
  }'

RESPONSE

200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
  "email_id": "email-test-81bf03a8-86e1-4d95-bd44-bb3495224953",
  "user_created": true
}

Common Error Types