OctoPrintClient.users
Note
Most methods here require that the used API token or the existing browser session has admin rights or corresponds to the user to be modified. Some methods definitely require admin rights.
- OctoPrintClient.users.list(opts)
Get a list of all registered users.
Requires admin rights.
- Arguments
opts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.get(name, opts)
Get information about a specific user.
- Arguments
name (
string()
) – The user’s nameopts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.add(user, opts)
Add a new user.
Requires admin rights.
- Arguments
user (
object()
) – The new useropts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.update(name, active, admin, opts)
Update an existing user.
Requires admin rights.
- Arguments
name (
string()
) – The user’s nameactive (
bool()
) – The newactive
state of the useradmin (
bool()
) – The newadmin
state of the useropts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.delete(name, opts)
Delete an existing user.
Requires admin rights.
- Arguments
name (
string()
) – The user’s nameopts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.changePassword(name, password, opts)
Change the password for a user.
- Arguments
name (
string()
) – The user’s namepassword (
string()
) – The new passwordopts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.generateApiKey(name, opts)
Generate a new API key for a user.
- Arguments
name (
string()
) – The user’s nameopts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.resetApiKey(name, opts)
Reset the API key for a user to being unset.
- Arguments
name (
string()
) – The user’s nameopts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.getSettings(name, opts)
Get the settings for a user.
- Arguments
name (
string()
) – The user’s nameopts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
- OctoPrintClient.users.saveSettings(name, settings, opts)
Save the settings for a user.
- Arguments
name (
string()
) – The user’s namesettings (
object()
) – The new settings, may be a partial set of settings which will be merged unto the current onesopts (
object()
) – Additional options for the request
- Returns Promise
A jQuery Promise for the request’s response
See also
- User API
The documentation of the underlying user API.