Users
View, manage, and analyze user accounts in your DYPAI application.
User Management Dashboard
The Users section provides a complete view of all registered users:
- List of all users with search and filtering
- User details and profile information
- Authentication status and activity
- Role assignments
User States
| State | Description |
|---|---|
| Confirmed | Email verified, full access |
| Pending | Awaiting email confirmation |
| Anonymous | Temporary session without account |
| Banned | Account suspended, no access |
User Registration
Register new users via API:
// JavaScript/TypeScript
const response = await fetch('https://your-project.dypai.io/auth/v1/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'your-anon-key'
},
body: JSON.stringify({
email: 'user@example.com',
password: 'securepassword123',
data: {
full_name: 'John Doe',
avatar_url: 'https://example.com/avatar.png'
}
})
});
const { user, session } = await response.json();The
data field accepts any custom user metadata.User Login
// Login with email and password
const response = await fetch('https://your-project.dypai.io/auth/v1/token?grant_type=password', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'your-anon-key'
},
body: JSON.stringify({
email: 'user@example.com',
password: 'securepassword123'
})
});
const { access_token, refresh_token, user } = await response.json();Get Current User
// Get authenticated user info
const response = await fetch('https://your-project.dypai.io/auth/v1/user', {
headers: {
'Authorization': 'Bearer ' + access_token,
'X-API-KEY': 'your-anon-key'
}
});
const user = await response.json();
console.log(user.email, user.user_metadata);Update User
// Update user profile
const response = await fetch('https://your-project.dypai.io/auth/v1/user', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + access_token,
'X-API-KEY': 'your-anon-key'
},
body: JSON.stringify({
data: {
full_name: 'John Smith',
preferences: { theme: 'dark' }
}
})
});
const updatedUser = await response.json();Password Reset
// Request password reset email
const response = await fetch('https://your-project.dypai.io/auth/v1/recover', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'your-anon-key'
},
body: JSON.stringify({
email: 'user@example.com'
})
});
// User receives email with reset linkConfigure email templates in Auth β Providers β Email.
Ban/Unban Users
Administrators can ban users from the dashboard or via API:
// Ban a user (requires service role key)
const response = await fetch('https://your-project.dypai.io/auth/v1/admin/users/{user_id}', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + serviceRoleKey
},
body: JSON.stringify({
ban_duration: '876000h' // ~100 years = permanent
})
});Banning a user immediately invalidates all their sessions.
Delete User
// Delete a user (requires service role key)
const response = await fetch('https://your-project.dypai.io/auth/v1/admin/users/{user_id}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer ' + serviceRoleKey
}
});Deleting a user is permanent and removes all their data.
User Statistics
The dashboard displays key metrics:
- Total registered users
- Active users (last 30 days)
- New registrations
- Users by authentication provider
- Login success/failure rates
Filtering Users
Search and filter users by:
- Email address
- User ID
- Registration date
- Last sign in
- Account state
- Assigned roles