deleteApiKey #
Available since 7.1.0
Available since Kuzzle 2.1.0
Deletes a user's API key.
deleteApiKey(userId, id, [options]);
Property | Type | Description |
---|---|---|
userId | string | User kuid |
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 |
queuable | boolean ( true ) | If true , queues the request during downtime, until connected to Kuzzle again |
timeout | number ( -1 ) | Time (in ms) during which a request will still be waited to be resolved. Set it -1 if you want to wait indefinitely |
triggerEvents | boolean ( false ) | If set to true , will trigger events even if using Embeded SDK. You should always ensure that your events/pipes does not create an infinite loop. Available since Kuzzle 2.31.0 |
Resolves #
Resolves if the API key is successfully deleted.
Usage #
try {
await kuzzle.security.deleteApiKey('john.doe', 'fQRa28BsidO6V_wmOcL');
console.log('API key successfully deleted');
} catch (e) {
console.error(e);
}
Edit this page on Github(opens new window)