ccloud api-key store


The Confluent Cloud CLI is deprecated and will stop working on May 9, 2022. All ccloud features have been moved to the Confluent CLI. To update to the new CLI, run ccloud update –major. See the Migrate to Confluent CLI v2 for more details.


Use this command to register an API secret created by another process and store it locally.

When you create an API key with the CLI, it is automatically stored locally. However, when you create an API key using the UI, API, or with the CLI on another machine, the secret is not available for CLI use until you “store” it. This is because secrets are irretrievable after creation.

You must have an API secret stored locally for certain CLI commands to work. For example, the Kafka topic consume and produce commands require an API secret.

ccloud api-key store [api-key] [secret] [flags]


    --resource string      The resource ID of the resource the API key is for.
-f, --force                Force overwrite existing secret for this key.
    --environment string   Environment ID.
    --context string       CLI context name.

Global Flags

-h, --help            Show help for this command.
-v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).


Pass the API key and secret as arguments

ccloud api-key store my-key my-secret

Get prompted for both the API key and secret

ccloud api-key store

Get prompted for only the API secret

ccloud api-key store my-key

Pipe the API secret

ccloud api-key store my-key -

Provide the API secret in a file

ccloud api-key store my-key @my-secret.txt

See Also