Consumer Authentication

/

API reference

/

Passwords

/

Create

Create User with Password

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

Create a new user with a password. If session_duration_minutes is specified, a new session will be started as well.

If a user with this email already exists in your Stytch project, this endpoint will return a duplicate_email error. To add a password to an existing passwordless user, you'll need to either call the Migrate password endpoint or prompt the user to complete one of our password reset flows.

This endpoint will return an error if the password provided does not meet our strength requirements, which you can check beforehand via the Password strength check endpoint.

When creating new Passwords users, it's good practice to enforce an email verification flow. We'd recommend checking out our Email verification guide for more information.


Body parameters


email*string

password*string

nameobject

session_custom_claimsmap<string, any>

session_duration_minutesint

trusted_metadataobject

untrusted_metadataobject

Response fields


status_codeint

request_idstring

user_idstring

userobject

email_idstring

session_tokenstring

session_jwtstring

sessionobject
curl --request POST \
  --url https://test.stytch.com/v1/passwords \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sandbox@stytch.com",
    "password": "+LX6z8)(9NIwqbbq"
  }'

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"
}

Common Error Types