Deactivating an API Key

Deactivate an API key so that requests using the selected key value no longer authenticate.

Note

Deactivation is reversible. Use this action to temporarily block usage without deleting or revoking the key.
    1. On the API keys list page, select the API key that you want to work with. If you need help finding the list page for API keys, see Listing API keys.
    2. In Key names and expiration times, find the key state you want to change (for example, Key one state).
    3. Select the Actions menu (three dots) and select Deactivate.
    4. Confirm the deactivation.
  • To deactivate one secret of an API key, run the api-key set-api-key-state command, providing the API key OCID, the secret's key name, and set the state to INACTIVE:

    oci generative-ai api-key set-api-key-state [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • To deactivate one secret of an API key, run the SetApiKeyState operation, providing the API key OCID, the secret's key name, and set the state to INACTIVE.