User Management API
API to manage users in the Multifactor system.
Prior using this API, you need to enable the extended API in your account in the "API settings" section and use the
API Key
andAPI Secret
provided there.
User list
A function to request a list of system users
Endpoint https://api.multifactor.ru/users
| GET method.
Response example:
{
"model": [ //user list
{
"id": "5e3c1058c3a23e55b0579ded", //user id in Multifactor system
"identity": "user@example.com", //user login in your system
"name": null,
"email": null,
"isEnrolled": false,
"createdAt": "2020-02-06T13:10:48.139Z",
"lastLogin": null,
"isLocked": false
}
],
"success": true,
"message": null
}
To find a specific user by login use additional identity
query parameter:
https://api.multifactor.ru/users?identity=user@example.com
User sign up
Users sign up automatically when they first visit the access page, but there is also an option to sign them up through the API.
Endpoint https://api.multifactor.ru/users
| POST method.
Request example:
{
"Identity": "user@example.com", //user identifier in your system
"Email": "user@example.com", //e-mail, not required
"Name": "User Name" //name, not required
}
Response example:
{
"model": {
"identity": "user@example.com",
"name": "User Name",
"email": "user@example.com",
"isEnrolled": false,
"createdAt": "2020-03-05T11:55:43.8001916Z",
"lastLogin": null,
"isLocked": false
},
"success": true,
"message": null
}
Edit user parameters
Edit user parameters, lock and unlock.
Endpoint https://api.multifactor.ru/users/:id
| PUT method.
id
parameter — user identifier in the Multifactor system
Request example:
{
"Name": "User Name", //if you need to edit user name
"Email": "user@example.com", //if you need to edit user email
"IsLocked": true //if you need to lock user
}
Response example:
{
"model": {
"identity": "user@example.com",
"name": "User Name",
"email": "user@example.com",
"isEnrolled": false,
"createdAt": "2020-03-05T11:55:43.8001916Z",
"lastLogin": null,
"isLocked": true
},
"success": true,
"message": null
}
Delete user
Endpoint https://api.multifactor.ru/users/:id
| DELETE method.
id
parameter — user identifier in Multifactor system
Response example:
{
"success": true,
"message": null
}
Sign up link
If case the user has not yet configured the two-factor authentication methods, he/she will be prompted to do so the first time he/she logs on to your site. You can also send a configuration link by e-mail.
Address https://api.multifactor.ru/users/:id/enroll
| POST method.
id
parameter — user identifier in Multifactor system
Request example:
{
"Email": "user@example.com", //адрес, куда отправить письмо
}
Response example:
{
"success": true,
"message": null
}