Add User
Add a new user to the whitelist. The user will be able to sign in with the application.
Note:
- The system can only have 01 superadmin.
- "manager" can't add more users.
- "admin" can't add more superadmins.
POST
/user
curl \
-X POST http://localhost:5000/user \
--cookie "fastapiusersauth=$API_KEY" \
-H "Content-Type: application/json" \
-d '{"email":"abcxyz@gmail.com","role":"superadmin"}'
Request example
{
"email": "abcxyz@gmail.com",
"role": "superadmin"
}
Response examples (200)
{
"detail": "User added successfully."
}
Response examples (400)
{
"detail": "Invalid added roles."
}
Response examples (401)
{
"detail": "Unauthorized"
}
Response examples (422)
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}