User Management
Services for managing the system users, their permissions, Maskyoo number assignment and the access log.
get_users
The list of all users (without passwords), each one with its permissions and assigned Maskyoo numbers.
Endpoint: /api/?service=get_users
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
format | string | NO | json / xml. |
Error code
| Code | Description |
|---|---|
7041 | No results |
get_user_by_id
The details of a single user (without the password), including permissions and assigned Maskyoo numbers.
Endpoint: /api/?service=get_user_by_id
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | int | YES | The user ID. |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
7031 | user_id is missing |
7032 | The user does not exist |
set_user
Create a new user. The system automatically creates:
- A user profile.
- A default set of report permissions.
- A personal tag named
#<email>.
The time zone, language and date format are copied from the main administrator user of the account.
A user created through the API does not receive the "export data to file" permission by default; the permissions can be updated in the user management interface when needed.
Endpoint: /api/?service=set_user
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | YES | Up to 99 characters. |
password | string | YES | At least 8 characters. Must comply with the system password policy. |
user_phone | string | NO | Phone number (converted to international format). |
user_phone_sms | string | NO | Phone number for SMS (converted to international format). |
user_login | string | NO | The login name is always derived automatically from the part before @ in email; a value sent in this parameter is not used. |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
7001 | email is empty or longer than 99 |
7002 | password is shorter than 8 / does not comply with the policy |
7003 | Creating the user failed |
7004 | Creating the profile failed |
7005 | Creating the default permissions failed |
Example
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
-X POST "https://[MASKYOO_URL]/api/?service=set_user" \
-d "[email protected]" \
-d "password=Str0ng!Pass" \
-d "user_phone=972544224422" \
-d "format=json"
update_user
Update an existing user. It supports updating the password (an empty value = do not update), the phone, the SMS phone and the status.
Endpoint: /api/?service=update_user
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | int | YES | The user ID. |
password | string | NO | A new password (when sent, it must comply with the policy). |
user_phone | string | NO | A new phone number (at least 6 characters). |
user_phone_sms | string | NO | A new SMS phone number. |
user_status | int | NO | 1 = enable the user, 0 = disable the user. Both values are supported through the API. |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
7011 | user_id is missing |
7012 | The update failed |
7013 | The password does not comply with the policy |
delete_user
Delete a user, including permissions, profiles and Maskyoo number assignment.
Endpoint: /api/?service=delete_user
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | int | YES | The user to delete. |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
7021 | user_id is missing |
7022 | The user does not exist |
7023 | Deleting the user failed |
7024 | Removing the Maskyoo number assignment failed |
7025 | Deleting the user profile failed |
7026 | Deleting the user permissions failed |
The deletion is irreversible. Verify before use.
set_ddi_to_user
Assign a Maskyoo number to a user (view / manage permission).
Endpoint: /api/?service=set_ddi_to_user
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | int | YES | The user. |
maskyoo | string | YES | The Maskyoo number. |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
8001 | user_id is missing |
8002 | maskyoo is missing |
8003 | The user does not exist |
8004 | The Maskyoo number does not exist |
8005 | The assignment failed |
8006 | The assignment already exists |
get_ddi_by_user_id
The list of Maskyoo numbers assigned to a user (including the status: active / inactive / release).
Endpoint: /api/?service=get_ddi_by_user_id
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | int | YES | The user ID. |
format | string | NO | json / xml. |
Error code
| Code | Description |
|---|---|
8011 | user_id is missing |
8012 | No results for this user |
delete_ddi_from_user_id
Remove the assignment of a Maskyoo number from a user.
Endpoint: /api/?service=delete_ddi_from_user_id
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | int | YES | The user. |
maskyoo | string | YES | The number to remove. |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
8021 | user_id is missing |
8022 | maskyoo is missing |
8023 | The user does not exist |
8024 | The Maskyoo number does not exist |
8025 | The assignment does not exist |
8026 | The removal failed |
get_users_access_log
The users login log (up to 1000 rows, in descending order). It can be filtered by user and by time range.
Endpoint: /api/?service=get_users_access_log
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | int | NO | Filter by user. |
start_time | string | NO | Y-m-d H:i:s. When only start_time is sent, end_time is set to now. |
end_time | string | NO | Y-m-d H:i:s. |
format | string | NO | json / xml. |
Response fields
access_log_user_id, access_log_name, access_log_time, access_log_status, access_log_ip.
Error code
| Code | Description |
|---|---|
6001 | No results |
System impact
The user management services affect access, permissions and reports:
- Creating a user —
set_useris identical to creating a user in the interface: it creates a profile, default permissions and the personal tag#<email> - Number assignment —
set_ddi_to_userdetermines which Maskyoo numbers the user sees in the reports and in the management screens - Deleting a user — an irreversible action; it removes the user, the permissions, the profile and the number assignment
- Passwords — must comply with the system password policy; non-compliance returns
7002/7013 - Access log —
get_users_access_logreflects the same records that are visible in the access log report; limited to 1000 rows - Time zone and language — these details are copied from the main administrator when a user is created through the API