Auth keys update

Open in

Use the ably auth keys update command to update the name or capabilities of an API key.

Synopsis

ably auth keys update <key-name-or-value> [options]

Arguments

key-name-or-value
Required

The key name (APP_ID.KEY_ID) or full key value (APP_ID.KEY_ID:KEY_SECRET) of the API key to update.

Options

--name

The new name for the API key.

--capabilities

New capabilities for the key, specified as either a JSON object for per-channel capabilities or a comma-separated list applied to all channels. Available operations are subscribe, publish, presence, history, stats, channel-metadata, push-subscribe, push-admin, privileged-headers, object-subscribe, object-publish, annotation-subscribe, annotation-publish, message-update-own, message-update-any, message-delete-own, and message-delete-any.

--json

Output results as compact JSON. Mutually exclusive with --pretty-json.

--pretty-json

Output results in formatted JSON. Mutually exclusive with --json.

--verbose | -v

Enable verbose logging. Can be combined with --json or --pretty-json.

Examples

Rename an API key:

ably auth keys update "aBcDeF.gHiJkL" --name "New Name"

Update a key using its full key value:

ably auth keys update "aBcDeF.gHiJkL:keySecret" --name "New Name"

Update the capabilities for a key using a JSON object for per-channel control:

ably auth keys update "APP_ID.KEY_ID" --capabilities '{"channel1":["publish"],"channel2":["subscribe"]}'

Update key capabilities using a comma-separated list:

ably auth keys update "APP_ID.KEY_ID" --capabilities "publish,subscribe,history"

Update a key and output the result in JSON format:

ably auth keys update "APP_ID.KEY_ID" --name "New Name" --capabilities "publish,subscribe" --json

See also

  • Auth — Explore all ably auth commands.
  • CLI reference — Full list of available commands.