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 name

  • opts (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 user

  • opts (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 name

  • active (bool()) – The new active state of the user

  • admin (bool()) – The new admin state of the user

  • opts (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 name

  • opts (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 name

  • password (string()) – The new password

  • opts (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 name

  • opts (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 name

  • opts (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 name

  • opts (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 name

  • settings (object()) – The new settings, may be a partial set of settings which will be merged unto the current ones

  • opts (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.