POST/admins

Create an administrator

Creates an administrator account with the supplied account details, permissions, and settings. Use permissions, role, and status to configure access; status is 0 for disabled or 1 for enabled. Configure recovery codes and TOTP through their dedicated APIs rather than in this request.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

14 body fields

Administrator account details. The schema does not mark any body fields as required.

additional_infostringoptional
Free form text field
created_atintegeroptional
creation time as unix timestamp in milliseconds. It will be 0 for admins created before v2.2.0
descriptionstringoptional
optional description, for example the admin full name
emailstringoptional
The administrator's email address, in email format.
filtersobjectoptional
Administrator authentication and preference settings, including API key authentication, password authentication, allowed IP or network ranges in CIDR notation, and preferences. Recovery codes and TOTP configuration cannot be set through this API.
groupsarray<object>optional
Groups automatically selected for new users created by this admin. The admin will still be able to choose different groups. These settings are only used for this admin UI and they will be ignored in REST API/hooks.
idintegeroptional
The administrator identifier, which must be at least 1.
last_loginintegeroptional
Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
passwordstringoptional
Admin password. For security reasons this field is omitted when you search/get admins
permissionsarray<string>optional
An array of administrator permissions, such as `*`, `add_users`, `edit_users`, or `view_users`.
rolestringoptional
Role name. The admin administers the users carrying the same role, and holds any permission except `*`. Where the role isolates its resources, the groups and the folders carrying it are the ones the admin reads, and the server applies the role to the resources it creates
statusintegeroptional
status: * `0` user is disabled, login is not allowed * `1` user is enabled
Allowed:01
updated_atintegeroptional
last update time as unix timestamp in milliseconds
usernamestringoptional
username is unique

6 status codes
201Returns the created administrator object, including its account details, permissions, role, and status.
additional_infostringoptional
Free form text field
created_atintegeroptional
creation time as unix timestamp in milliseconds. It will be 0 for admins created before v2.2.0
descriptionstringoptional
optional description, for example the admin full name
emailstringoptional
filtersobjectoptional
groupsarray<object>optional
Groups automatically selected for new users created by this admin. The admin will still be able to choose different groups. These settings are only used for this admin UI and they will be ignored in REST API/hooks.
idintegeroptional
last_loginintegeroptional
Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes
passwordstringoptional
Admin password. For security reasons this field is omitted when you search/get admins
permissionsarray<string>optional
rolestringoptional
Role name. The admin administers the users carrying the same role, and holds any permission except `*`. Where the role isolates its resources, the groups and the folders carrying it are the ones the admin reads, and the server applies the role to the resources it creates
statusintegeroptional
status: * `0` user is disabled, login is not allowed * `1` user is enabled
Allowed:01
updated_atintegeroptional
last update time as unix timestamp in milliseconds
usernamestringoptional
username is unique
400Returned when the request is invalid, such as when a field value fails validation.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
401Returned when the request is unauthenticated.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
403Returned when the authenticated user is not permitted to add administrators.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
500Returned when an internal server error occurs.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
defaultUnexpected Error
errorstringoptional
error description if any
messagestringoptional
message, can be empty

Error handling

A 400 is returned when the request is invalid, a 401 when the authenticated user does not present valid credentials, and a 403 when the authenticated user lacks permission to add administrators. email must use email format, id must be at least 1, and status must be 0 or 1; a 500 indicates an internal server error.