Api Key Commands

With the api key commands you can manage the api keys in the panel, from the command line.


Create a api key

mlcli apikeys create <description>

Note: To grant permissions to an api key via the cli, just add --permissions <permissions>

Arguments: ( Arguments )

  • <description> → The description for the api key

Options: ( Options )

  • --permissions , -p → The permissions of the api key, (in ", split with commas; eg. "admin.users.read,admin.api.*,admin.users.update")*

  • --expires, -e → The expiry date for the api key"

Flags: ( Flags )

  • --admin ,-a → Grants the api key all permissions, option --permissions will be ignored

Example Usage:

mlcli apikeys create serverapikey -p "admin.api,admin.users.*,admin.system.diagnose"

Update a api key

mlcli apikeys update <id>

Arguments: ( Arguments )

  • <id>→ The id of the api key which should get updated

Options: ( Options )

  • --description, -d → The new description for the api key, if not specified, the description remains unchanged

Example usage:

mlcli apikeys update 1 -u johndoe1 -e johndoe@example.net -p "*"

List api keys

mlcli apikeys list

Note: To get listed more than 10 api keys, add -l <pagesize> to the command above, to change page, add -p <page>

Options: ( Options )

  • --pagesize , -l → The number of api keys which will get listed, must be between 1 and 100, default: 10

  • —-page , -p → The which will get displayed

Example Usage:

mlcli apikeys list -p 2 -l 15

Delete an api key

mlcli apikeys delete <id>

Note: This can not be undone

Arguments: ( Arguments )

  • <id>→ The id of the api key which should get deleted