curl --request POST \
--url https://{subdomain}.auth.{region}.nhost.run/v1/signup/email-password \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"password": "Str0ngPassw#ord-94|%",
"options": {
"allowedRoles": [
"me",
"user"
],
"defaultRole": "user",
"displayName": "John Smith",
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"redirectTo": "https://my-app.com/catch-redirection"
}
}
'{
"session": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"accessTokenExpiresIn": 900,
"refreshTokenId": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"refreshToken": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"user": {
"avatarUrl": "https://myapp.com/avatars/user123.jpg",
"createdAt": "2023-01-15T12:34:56Z",
"defaultRole": "user",
"displayName": "John Smith",
"emailVerified": true,
"id": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"isAnonymous": false,
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"phoneNumberVerified": false,
"roles": [
"user",
"customer"
],
"email": "[email protected]",
"phoneNumber": "+12025550123",
"activeMfaType": "<string>"
}
}
}Register a new user account with email and password. Returns a session if email verification is not required, otherwise returns null session.
curl --request POST \
--url https://{subdomain}.auth.{region}.nhost.run/v1/signup/email-password \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"password": "Str0ngPassw#ord-94|%",
"options": {
"allowedRoles": [
"me",
"user"
],
"defaultRole": "user",
"displayName": "John Smith",
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"redirectTo": "https://my-app.com/catch-redirection"
}
}
'{
"session": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"accessTokenExpiresIn": 900,
"refreshTokenId": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"refreshToken": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"user": {
"avatarUrl": "https://myapp.com/avatars/user123.jpg",
"createdAt": "2023-01-15T12:34:56Z",
"defaultRole": "user",
"displayName": "John Smith",
"emailVerified": true,
"id": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
"isAnonymous": false,
"locale": "en",
"metadata": {
"firstName": "John",
"lastName": "Smith"
},
"phoneNumberVerified": false,
"roles": [
"user",
"customer"
],
"email": "[email protected]",
"phoneNumber": "+12025550123",
"activeMfaType": "<string>"
}
}
}User registration information including email, password, and optional profile data
Request to register a new user with email and password
Email address for the new user account
Password for the new user account
3 - 50"Str0ngPassw#ord-94|%"
Show child attributes
["me", "user"]"user"
32"John Smith"
A two-characters locale
2"en"
{ "firstName": "John", "lastName": "Smith" }"https://my-app.com/catch-redirection"
Registration successful. If email verification is required, session will be null.
Container for session information
User authentication session containing tokens and user information
Show child attributes
JWT token for authenticating API requests
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Expiration time of the access token in seconds
900
Identifier for the refresh token
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"
Token used to refresh the access token
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"
User profile and account information
Show child attributes
URL to the user's profile picture
"https://myapp.com/avatars/user123.jpg"
Timestamp when the user account was created
"2023-01-15T12:34:56Z"
Default authorization role for the user
"user"
User's display name
"John Smith"
Whether the user's email has been verified
true
Unique identifier for the user
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"
Whether this is an anonymous user account
false
User's preferred locale (language code)
2"en"
Custom metadata associated with the user
{ "firstName": "John", "lastName": "Smith" }Whether the user's phone number has been verified
false
List of roles assigned to the user
["user", "customer"]User's email address
User's phone number
"+12025550123"
Active MFA type for the user
Was this page helpful?