Docs Menu
Docs Home
/ /
MongoDB CLI
/ / /

mongocli iam globalApiKeys update

On this page

  • Syntax
  • Arguments
  • Options
  • Inherited Options
  • Examples

Modify the roles and description for a global API key.

Command Syntax
mongocli iam globalApiKeys update <ID> [options]
Name
Type
Required
Description
ID
string
true
Unique 24-digit string that identifies the global API key.
Name
Type
Required
Description
--desc
string
true
Description of the API key.
-h, --help
false
help for update
-o, --output
string
false
Output format. Valid values are json, json-path, go-template, or go-template-file. To see the full output, use the -o json option.
--role
strings
true
Role or roles that you want to assign to the API key. To assign more than one role, you can specify each role with a separate role flag or specify all of the roles as a comma-separated list using one role flag. Valid values are GLOBAL_AUTOMATION_ADMIN, GLOBAL_BACKUP_ADMIN GLOBAL_MONITORING_ADMIN, GLOBAL_OWNER, GLOBAL_READ_ONLY,GLOBAL_USER_ADMIN. Passing this flag replaces preexisting data.
Name
Type
Required
Description
-P, --profile
string
false
Name of the profile to use from your configuration file. To learn about profiles for MongoCLI, see https://dochub.mongodb.org/core/atlas-cli-configuration-file.
# Modify the roles and description for the global API key with the ID 5f5bad7a57aef32b04ed0210:
mongocli iam globalApiKeys update 5f5bad7a57aef32b04ed0210 --desc "My Sample Global API Key" --role GLOBAL_MONITORING_ADMIN --output json

Back

list