| title | Sign Up |
|---|---|
| description | Register a new user in your project's users collection. |
Creates a new user account and returns an access token. Any extra fields defined in your users collection schema are accepted and validated automatically.
x-api-key: your pk_live_… key.
const res = await fetch('https://api.urbackend.in/api/userAuth/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'pk_live_YOUR_KEY'
},
body: JSON.stringify({
email: 'alice@example.com',
password: 'securePassword123',
name: 'Alice',
username: 'alice_dev',
preferences: { theme: 'dark', notifications: true }
})
});
const { user, accessToken } = await res.json();curl -X POST "https://api.urbackend.in/api/userAuth/signup" \
-H "Content-Type: application/json" \
-H "x-api-key: pk_live_YOUR_KEY" \
-d '{
"email": "alice@example.com",
"password": "securePassword123",
"name": "Alice"
}'{
"user": {
"_id": "64fd1234abcd5678ef901234",
"email": "alice@example.com",
"name": "Alice",
"username": "alice_dev"
},
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}| Status | Cause |
|---|---|
400 Bad Request |
Missing required fields or schema validation failure |
409 Conflict |
An account with that email address already exists |