Core
API v2.x
2

deleteApiKey #

Deletes a user API key.


Query Syntax #

HTTP #

URL: http://kuzzle:7512/users/<userId>/api-keys/<apiKeyId>[?refresh=wait_for]
Method: DELETE

The API key can also be targeted by its clear-text key or its fingerprint instead of its _id, using query string parameters:

URL: http://kuzzle:7512/users/<userId>/api-keys[?key=<key>&refresh=wait_for]
Method: DELETE
URL: http://kuzzle:7512/users/<userId>/api-keys[?fingerprint=<fingerprint>&refresh=wait_for]
Method: DELETE

Other protocols #

{
  "controller": "security",
  "action": "deleteApiKey",
  "userId": "mWakSm4BWtbu6xy6NY8K",
  "_id": "api-key-id"
}

Arguments #

Exactly one of the following must be provided to identify the API key to delete:

  • _id: API key ID
  • key: the clear-text API key
  • fingerprint: the API key fingerprint (SHA-256 hash of the clear-text key)

Optional: #

  • refresh: if set to wait_for, Kuzzle will not respond until the API key deletion is indexed (default: "wait_for")

Response #

Returns the deleted API key ID.

{
  "status": 200,
  "error": null,
  "result": {
    "_id": "api-key-id",
  }
  "action": "deleteApiKey",
  "controller": "security",
  "requestId": "<unique request identifier>"
}