Shinobi
Home  /  API  /  Superuser Only

Superuser Only

This user is the highest level user in the Shinobi system. It does not manage cameras, it manages Administrators and the system core.

Superusers must have their API Keys added explicity to the super.json file located in your Shinobi directory.

[
   {
      "mail": "[LOGIN ADDRESS]",
      "pass": "[PASSWORD]",
      "tokens": [
         "[A USER SPECIFIED API KEY]",
         "[ANOTHER USER SPECIFIED API KEY]",
         "[ANOTHER USER SPECIFIED API KEY]",
         "[ANOTHER USER SPECIFIED API KEY]"
      ]
   }
]

Currently only for updating username and password. Leave the password fields blank to keep the current password and only change the username.

http://xxx.xxx.xxx.xxx/super/[API KEY]/accounts/saveSettings?data={"mail":"[LOGIN ADDRESS]","pass":"[NEW_PASSWORD]","pass_again":"[NEW_PASSWORD_AGAIN]"}
Update Superuser settings : Sample of Post Data
{
   "data": {
      "mail": "[LOGIN ADDRESS]",
      "pass": "[PASSWORD]",
      "pass_again": "[PASSWORD AGAIN]"
   }
}

The only complex part of this registration method is filling the details column. See below for a Sample : Administrator object.

http://xxx.xxx.xxx.xxx/super/[API KEY]/accounts/registerAdmin?data={"mail":"[USERNAME]","pass":"[NEW_PASSWORD]","pass_again":"[NEW_PASSWORD_AGAIN]","ke":"[GROUP KEY]","uid":"[USER ID]","details":"[USER DETAILS]"}
Register Administrator : Sample of Post Data

The contents of details can vary based on version used.

{
   "data": {
      "mail": "[LOGIN ADDRESS]",
      "ke": "[GROUP KEY]",
      "pass": "[PASSWORD]",
      "password_again": "[PASSWORD AGAIN]",
      "details": {
         "factorAuth": "0",
         "size": "10000",
         "days": "5",
         "event_days": "10",
         "log_days": "10",
         "max_camera": "",
         "permissions": "all",
         "edit_size": "1",
         "edit_days": "1",
         "edit_event_days": "1",
         "edit_log_days": "1",
         "use_admin": "1",
         "use_aws_s3": "1",
         "use_webdav": "1",
         "use_discordbot": "1",
         "use_ldap": "1"
      }
   }
}

Tip : Post data does not have to be in a query string, it can be actual POST data as well.

http://xxx.xxx.xxx.xxx/super/[API KEY]/accounts/editAdmin?data={}&account={}
Edit Administrator : Sample of Post Data

The contents of details can vary based on version used.

{
   "data": {
      "mail": "[GROUP KEY]",
      "ke": "[GROUP KEY]",
      "pass": "[PASSWORD]",
      "password_again": "[PASSWORD AGAIN]",
      "details": {
         "factorAuth": "0",
         "size": "10000",
         "days": "5",
         "event_days": "10",
         "log_days": "10",
         "max_camera": "",
         "permissions": "all",
         "edit_size": "1",
         "edit_days": "1",
         "edit_event_days": "1",
         "edit_log_days": "1",
         "use_admin": "1",
         "use_aws_s3": "1",
         "use_webdav": "1",
         "use_discordbot": "1",
         "use_ldap": "1"
      }
   },
   "account": {
      "mail": "[GROUP KEY]",
      "ke": "[GROUP KEY]",
      "uid": "[USER ID]"
   }
}

Tip : Post data does not have to be in a query string, it can be actual POST data as well.

http://xxx.xxx.xxx.xxx/super/[API KEY]/accounts/deleteAdmin?account={}&deleteSubAccounts=1&deleteMonitors=1&deleteVideos=1&deleteEvents=1
Delete Administrator : Sample of Post Data
{
   "account": {
      "mail": "[LOGIN ADDRESS]",
      "ke": "[GROUP KEY]",
      "uid": "[USER ID]"
   },
   "deleteSubAccounts": "1",
   "deleteMonitors": "1",
   "deleteVideos": "1",
   "deleteEvents": "1"
}

This will not list Superusers.

http://xxx.xxx.xxx.xxx/super/[API KEY]/accounts/list

There are only two types to request. See below for choices.

http://xxx.xxx.xxx.xxx/super/[API KEY]/accounts/list/[TYPE]
  • admin
  • sub
http://xxx.xxx.xxx.xxx/super/[API KEY]/logs
http://xxx.xxx.xxx.xxx/super/[API KEY]/logs/delete

[CONF.JSON] should be a JSON string of your conf.json file.

http://xxx.xxx.xxx.xxx/super/[API KEY]/system/configure?data=[CONF.JSON]
http://xxx.xxx.xxx.xxx/super/[API KEY]/system/update

The [OPTIONS] parameter is to select which script to restart. Available uses are below.

http://xxx.xxx.xxx.xxx/super/[API KEY]/system/restart/[OPTIONS]
  • system
  • cron

ShinobiDocs

All content is property of their respective owners.