[comment]: # ({8f026b4a-0834cf88})
# User object

The following objects are directly related to the `user` API.

[comment]: # ({/8f026b4a-0834cf88})

[comment]: # ({267a4b51-0ecc45be})
### User

The user object has the following properties.

|Property|[Type](/manual/api/reference_commentary#data_types)|Description|
|--|--|------|
|userid|string|*(readonly)* ID of the user.|
|**username**<br>*(required)*|string|User name.|
|**roleid**<br>*(required)*|string|Role ID of the user.|
|attempt\_clock|timestamp|*(readonly)* Time of the last unsuccessful login attempt.|
|attempt\_failed|integer|*(readonly)* Recent failed login attempt count.|
|attempt\_ip|string|*(readonly)* IP address from where the last unsuccessful login attempt came from.|
|autologin|integer|Whether to enable auto-login.<br><br>Possible values:<br>0 - *(default)* auto-login disabled;<br>1 - auto-login enabled.|
|autologout|string|User session life time. Accepts seconds and time unit with suffix. If set to 0s, the session will never expire.<br><br>Default: 15m.|
|lang|string|Language code of the user's language, for example, `en_US`.<br><br>Default: `default` - system default.|
|name|string|Name of the user.|
|refresh|string|Automatic refresh period. Accepts seconds or time unit with suffix (e.g., 30s, 90s, 1m, 1h).<br><br>Default: 30s.|
|rows\_per\_page|integer|Amount of object rows to show per page.<br><br>Default: 50.|
|surname|string|Surname of the user.|
|theme|string|User's theme.<br><br>Possible values:<br>`default` - *(default)* system default;<br>`blue-theme` - Blue;<br>`dark-theme` - Dark;<br>`hc-light` - High-contrast light;<br>`hc-dark` - High-contrast dark.|
|url|string|URL of the page to redirect the user to after logging in.|
|timezone|string|User's time zone, for example, `Europe/London`, `UTC`.<br><br>Default: `default` - system default.<br><br>For the full list of supported time zones please refer to [PHP documentation](https://www.php.net/manual/en/timezones.php).|
|alias<br>(deprecated)|string|This property is deprecated, please use `username` instead.<br>User alias.|

Note that for some methods (update, delete) the required/optional parameter combination is different.

[comment]: # ({/267a4b51-0ecc45be})

[comment]: # ({008d161b-1ad487be})
### Media

The media object has the following properties.

|Property|Type|Description|
|--|--|------|
|mediaid|string|*(readonly)* ID of the user's media.|
|userid|string|*(readonly)* ID of the user.|
|**mediatypeid**<br>(required)|string|ID of the media type used by the user's media.|
|**sendto**<br>(required)|string/array|Address, user name or other identifier of the recipient.<br><br>If type of [Media type](/manual/api/reference/mediatype/object#mediatype) is e-mail, values are represented as array. For other types of [Media types](/manual/api/reference/mediatype/object#mediatype), value is represented as a string.|
|active|integer|Whether the media is enabled.<br><br>Possible values:<br>0 - *(default)* enabled;<br>1 - disabled.|
|severity|integer|Trigger severities to send notifications about.<br><br>Possible bitmap values:<br>1 - Not classified;<br>2 - Information;<br>4 - Warning;<br>8 - Average;<br>16 - High;<br>32 - Disaster.<br><br>This is a bitmask field; any sum of possible bitmap values is acceptable (for example, 48 for Average, High, and Disaster).<br><br>Default: 63.|
|period|string|Time when the notifications can be sent as a [time period](/manual/appendix/time_period) or user macros separated by a semicolon.<br><br>Default: 1-7,00:00-24:00|

[comment]: # ({/008d161b-1ad487be})
