Skip to main content

Fields and error codes for access methods

When to use this reference​

Use this reference when writing an integration or interpreting a cluster response and you need the exact field set, parameter type, access level, and meaning of a code. For step-by-step procedures, see the guides on user management, on roles and privileges, and on sign-in and sessions; for the permission model, see vStack Center access model. VDC in the tables below stands for virtual data center, the object scoped by vdc_id.

Method summary​

Users​

MethodParametersAccessReturns
user-listnoneCluster mastera map of active users, keyed by string id
user-getidCluster mastera single user's profile
user-createname, fullnameCluster masterthe created account's id
user-deleteidCluster masterempty data
user-set-passwordid, passwordown password: any user; another user's id: Cluster masterempty data
user-unlockidCluster masterthe unlocked account's id
user-params-getnonecurrent userthe saved JSON settings object
user-params-setarbitrary objectcurrent userempty data

User roles and assignments​

MethodParametersAccessReturns
user-rolenonecurrent userUID and authmap
user-rolesuser_id, qown roles: any user; another user's user_id: Cluster mastera VDC → role map; with the q key, a VDC → role array map
user-roles-v2user_idthe View Own User Roles privilege (7102); another user's user_id: View Any User Roles (7106)a role → scope attributes map
user-roles-mapnoneCluster masterall users with expanded assignments
user-role-assignuser_id, vdc_id, role_idCluster masterempty data
user-role-deassignuser_id, vdc_id, role_idCluster masterempty data

The vdc_id parameter in user-role-assign is required for a role with a scope binding; in user-role-deassign, it is always required. The q flag in user-roles is determined by the presence of the key in params; its value is not read. The q flag is not supported for user-roles-v2.

Roles and privileges​

MethodParametersAccessReturns
role-listnonenot specified in the canonical API documentationall roles with scope_ids, creator, and timestamps
role-getida global role with the View Role Details privilege (7114)the role with its complete privileges and scope_ids
role-scopesidthe View Role Scopes privilege (7115)the role's scope attributes with self_referencing = false
role-createname, privileges, scope_idsCluster masterthe created role's id
role-setid, name, remove_privileges, add_privileges, scope_idsCluster masterempty data
role-deleteidCluster masterempty data
role-privilege-listnonethe View Role Privileges privilege (7108), granted to all seven fixed rolesa role_id → array of privilege_id map
privilege-listnonethe View Privileges privilege (7107), granted to all seven fixed rolesthe privilege registry with categories, scopes, and methods
privilege-categoriesnonethe View Privilege Categories privilege (7109), granted to all seven fixed rolesa category_id → name map
privilege-scopesnonethe View Privilege Scopes privilege (7110), granted to all seven fixed rolesthe scope attribute reference

Account access restrictions​

MethodParametersAccessReturns
user-remote-listuser_idCluster masteran array of allowed CIDRs
user-remote-adduser_id, remoteCluster masterempty data
user-remote-deleteuser_id, remoteCluster masterempty data
user-vhost-listuser_idCluster masteran array of allowed vhosts
user-vhost-adduser_id, vhostCluster masterempty data
user-vhost-deleteuser_id, vhostCluster masterempty data

Session and security settings​

MethodParametersAccessReturns
auth-logoutallany authenticated user, for their own sessions{"result": true}
auth-security-settings-getnoneany authorized user; the field set depends on the rolepassword and lockout settings
auth-security-settings-seteight policy fields, all optionalCluster masterempty data

Parameters with validation​

MethodParameterTypeRequiredRestriction
user-createnamestringyesregex ^[A-Z,a-z,_-]{4,41}$
user-createfullnamestringno—
user-deleteidnumberyesrange(min=0); id < 10 is prohibited
user-set-passwordidnumbernodefaults to the current user
user-set-passwordpasswordstringyesregex ^[\S]+$ plus the password policy
user-role-assignuser_id, role_idnumberyesrange(min=0); user_id < 10 is prohibited
user-remote-addremotestringyesIPv4 CIDR with a mask of 8–32 or IPv6 with a prefix of 16–128
user-vhost-addvhoststringyeslength 5–512
role-createnamestringyeslength 1–64, unique
role-createprivilegesarray<integer>yesnonempty; excludes 7111–7113
role-createscope_idsarray<integer>noonly attributes with self_referencing = false
role-setidintegeryesat least 10000
role-deleteidintegeryesat least 10000
auth-security-settings-setmax_failed_attempts, failed_attempts_window_minutes, password_min_lengthintegernorange(min=1)
auth-security-settings-setlockout_duration_minutesintegernorange(min=0)
auth-logoutallbooleannodefaults to false

User profile fields​

The field set is the same for user-get and for each entry in user-list.

FieldTypeDescription
idintegeruser identifier
namestringaccount name
fullnamestring | nullfull name
createdintegercreation time, epoch
modifiedinteger | nulllast modification time, epoch
failed_login_attemptsintegerfailed sign-in attempt counter
first_failed_atinteger | nullstart of the current counting window, epoch; null means no failed attempts
locked_untilinteger | nulltime until which the account is locked, epoch; null means not locked

Role fields​

FieldTypeReturned byDescription
idintegerrole-list, role-getrole identifier
namestringrole-list, role-getrole name
scope_idsinteger[]role-list, role-getthe role's scope attributes; an empty array means no binding
privilegesinteger[]role-getthe role's complete privilege list
creatorinteger | nullrole-list, role-getthe role's creator; null for fixed roles
created_tsintegerrole-list, role-getcreation time, unix timestamp
modified_tsinteger | nullrole-list, role-getlast modification time; null means never modified

The platform's fixed roles:

IDName
1Cluster Master
2vDC Admin
3vDC User
4vDC Viewer
5Resource Viewer
6Security Admin
7VM Developer

Privilege and scope attribute fields​

A privilege-list registry entry:

FieldTypeDescription
idnumberprivilege identifier
namestringprivilege name
category_idnumber | nullcategory; null means the privilege is not assigned to a category
scope_idsnumber[]the privilege's scope attributes; an empty array means a global privilege
methodsstring[]names of JSON-RPC methods that require this privilege

A privilege-scopes and role-scopes reference entry:

FieldTypeDescription
idintegerscope attribute identifier
namestringattribute name, such as vdc_id or creator
self_referencingbooleantrue means the value is generated from user_id (creator); false means it comes from role assignments (vdc_id)

In the role-scopes response, self_referencing is always false: self-referencing attributes are not included in this response.

Privilege categories (privilege-categories): 1 — vDC, 2 — VM, 3 — Network, 4 — Edge, 5 — Storage, 6 — Node, 7 — Cluster, 8 — User, 9 — Misc, 10 — Auth, 11 — Security, 12 — User Interface, 13 — Unified Storage, 14 — OS Image Library, 15 — Backup.

note

The canonical API documentation lists only the first ten categories in its response example, while the database contains fifteen: each new domain adds its own category. The method returns the complete reference, so check the actual cluster response.

User roles: four response formats​

Methoddata formatWhen it is useful
user-roleUID + authmap: an array of objects with vdc_id, vdc_name, role_id, role_name, GI_accountthe client needs to show "who I am and where" in a single call
user-roles without qa string vdc_id → role_id mapquickly checking a single role per VDC
user-roles with qa string vdc_id → array of role_id mapthe user has more than one role in a VDC
user-roles-v2a role_id → scopes map, containing is_global and ids for each attr_iddetermining exactly how the role is restricted
user-roles-mapa string user id → profile + roles array maptaking an inventory of all cluster assignments

Fields in user-roles-v2:

FieldTypeDescription
data.<role_id>.scopesobjectkeys are string attr_id values of the role's scope attributes
data.<role_id>.scopes.<attr_id>.is_globalbooleantrue means there are no values in the assignments and the role is not restricted by the attribute
data.<role_id>.scopes.<attr_id>.idsinteger[]attribute values from assignments, such as a list of VDCs

Valid role_id values for fixed roles are 1–7. Custom roles appear in the same responses with identifiers starting at 10000.

Security settings​

FieldTypeVisible to in auth-security-settings-get
max_failed_attemptsintegeronly Cluster master
failed_attempts_window_minutesintegeronly Cluster master
lockout_duration_minutesintegeronly Cluster master
password_min_lengthintegerall authorized users
password_require_uppercasebooleanall authorized users
password_require_lowercasebooleanall authorized users
password_require_digitsbooleanall authorized users
password_require_specialbooleanall authorized users

Error codes​

Users​

CodeMessageMethods
-403Access denieduser-list, user-roles-map
-403Access denieduser-roles
-22204Empty param user_iduser-roles, user-roles-v2
-22205Bad id param valueuser-roles, user-roles-v2
-403Access denieduser-create
-22505Bad name param valueuser-create
-22515Failed to add an useruser-create
-22516User with name '<name>' exists alreadyuser-create
-403Access denieduser-delete
-22606Specified user was not founduser-delete
-22610Build-it users removal prohibiteduser-delete
-403Access denieduser-set-password
-22712Bad passworduser-set-password
-22720Specified user was not founduser-set-password
-22730…-22735, -22737password policy requirementsuser-set-password
-403Access denieduser-get
-22803No param iduser-get
-22804Empty param iduser-get
-22805Bad id param valueuser-get
-403Access denieduser-unlock
-22906Specified user was not founduser-unlock
-29030No user with ID==<uid>user-params-get
-34000No params at alluser-params-set
-39030No user with ID==<uid>user-params-set

Role assignment​

CodeMessageMethods
-403Access denieduser-role-assign
-22320Build-it users management prohibited / role already assigneduser-role-assign
-403Access denieduser-role-deassign
-22420Specified user has no specified role assignmentuser-role-deassign
-22421Build-it users management prohibiteduser-role-deassign

Roles and privileges​

CodeMessageMethods
-22500Access denied: only Cluster Master can create rolesrole-create
-22501Privileges list must not be emptyrole-create
-22502Role management privileges cannot be assigned to custom rolesrole-create
-22503Privilege ID not foundrole-create
-22504Scope ID not foundrole-create
-22505Self-referencing scope cannot be assigned to custom rolerole-create
-22506Role with name already existsrole-create
-22510Access denied: only Cluster Master can edit rolesrole-set
-22511Cannot modify a fixed rolerole-set
-22512Role not foundrole-set
-22513Role management privileges cannot be assigned to custom rolesrole-set
-22514Privilege ID not foundrole-set
-22515Scope ID not foundrole-set
-22516Role with name already existsrole-set
-22517Self-referencing scope cannot be assigned to custom rolerole-set
-22520Access denied: only Cluster Master can delete rolesrole-delete
-22521Cannot delete a fixed rolerole-delete
-22522Role not foundrole-delete
-22530Role not foundrole-get
-22540Role not foundrole-scopes

The -225xx range is used twice: user-create and the role-* group use the same numbers. For example, -22505 means "invalid user name" in user-create and "self-referencing scope prohibited" in role-create, while -22516 means either a user name or a role name is already in use. Interpret the code by the method called, rather than by the number alone.

Account access restrictions​

CodeMessageMethods
-403Access deniedall six methods in the group
-24504user_id param has been ommiteduser-remote-list
-24505user_id param is NULLuser-remote-list
-24506user_id param value is not numericuser-remote-list
-24604user_id param has been ommiteduser-vhost-list
-24605user_id param is NULLuser-vhost-list
-24606user_id param value is not numericuser-vhost-list
-24712remote param value is not CIDRuser-remote-add
-24713remote param has mask out of range 8..32user-remote-add
-24714User ID==<id> has remote <cidr> alreadyuser-remote-add
-24715Invalid CIDR syntax of remote paramuser-remote-add
-24812remote param value is not CIDR / vhost param has bad lengthuser-remote-delete, user-vhost-add
-24814User ID==<id> has no remote <cidr> / has vhost <vhost> alreadyuser-remote-delete, user-vhost-add
-24815Invalid CIDR syntax of remote paramuser-remote-delete
-24912vhost param has bad lengthuser-vhost-delete
-24914User ID==<id> has no vhost <vhost>user-vhost-delete

The canonical API documentation lists the pair -24812, -24814 for both user-remote-delete and user-vhost-add. Interpret their meaning by the method called.

Session and security settings​

CodeMessageWhere it occurs
-9494No session tokenany call without params.auth.cookie
-11000the token is not found among active sessions, has expired, or has been invalidatedauth-logout and any call with an invalid token
-125Temp token expired or invaliduser-set-password using temp_token
-126Method not allowed with temp tokenany call with temp_token except user-set-password and auth-security-settings-get
-127Temp token allows changing own password onlyuser-set-password using temp_token
-403Access deniedauth-security-settings-set
-29101Security settings not foundauth-security-settings-get
-29102database errorauth-security-settings-get, auth-security-settings-set

Identifier restrictions​

RangeMeaningConsequence
users id < 10built-in accountscannot be deleted (-22610); role assignments cannot be changed (-22320, -22421)
roles id < 10000the platform's fixed rolescannot be modified (-22511) or deleted (-22521); creator is null
roles id ≥ 10000custom rolescreated with role-create; deletion cascades to their assignments
privileges 7111–7113role managementcannot be assigned to a custom role (-22502, -22513)

Example: complete user setup​

{"jsonrpc": "2.0", "method": "user-create", "params": {"name": "ops_duty", "fullname": "Ops Duty"}, "id": "1"}
{"jsonrpc": "2.0", "method": "user-set-password", "params": {"id": 12, "password": "<пароль>"}, "id": "2"}
{"jsonrpc": "2.0", "method": "user-role-assign", "params": {"user_id": 12, "vdc_id": 10, "role_id": 2}, "id": "3"}
{"jsonrpc": "2.0", "method": "user-roles-map", "id": "4"}

The last call is a check: its response must show an assignment for user 12 with role_id: 2 and the required vdc_id.