Consumer Authentication

/

API reference

/

Users

/

Create user

Create User

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

Add a User to Stytch. A user_id is returned in the response that can then be used to perform other operations within Stytch. An email or a phone_number is required.


Body parameters


emailstring

phone_numberstring

nameobject

trusted_metadataobject

untrusted_metadataobject

create_user_as_pendingboolean

attributesobject

Response fields


status_codeint

request_idstring

user_idstring

userobject

email_idstring

phone_idstring

statusstring
curl --request POST \
  --url https://test.stytch.com/v1/users \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sandbox@stytch.com"
  }'

RESPONSE

201
{
  "status_code": 201,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
  "user": {...},
  "email_id": "email-test-81bf03a8-86e1-4d95-bd44-bb3495224953",
  "phone_id": "phone-number-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
  "status": "active"
}

Common Error Types