deleteApiKey

Available since 7.1.0 Available since Kuzzle 2.1.0

Deletes an API key for the currently loggued user.


Copied to clipboard!
deleteApiKey(id, [options]);

Property Type Description
id
string
API key unique ID
options
object
Additional options

options

Additional query options

Property Type
(default)
Description
refresh
boolean

(false)
If set to wait_for, Kuzzle will not respond until the API key is indexed

Resolves

Resolves if the API key is successfully deleted.

Usage

Copied to clipboard!
try {
  await kuzzle.auth.login('local', { username: 'john.doe', password: 'password' });

  await kuzzle.auth.deleteApiKey('fQRa28BsidO6V_wmOcL');

  console.log('API key successfully deleted');
} catch (e) {
  console.error(e);
}