Skip to main content
Permanently delete an identity. This operation cannot be undone. Use this for data cleanup, compliance requirements, or when removing entities from your system. Important:
  • Associated API keys remain functional but lose shared resources
  • External ID becomes available for reuse immediately
Required permissions:
  • identity.*.delete_identity (to delete identities in any workspace)
See the API reference for the full HTTP endpoint documentation.

Usage

unkey api identities delete-identity [flags]

Flags

--identity
string
required
The ID of the identity to delete. This can be either the external ID (from your own system that was used during identity creation) or the identity ID (the internal ID returned by the identity service).

Global Flags

FlagTypeDescription
--root-keystringOverride root key ($UNKEY_ROOT_KEY)
--api-urlstringOverride API base URL (default: https://api.unkey.com)
--configstringPath to config file (default: ~/.unkey/config.toml)
--outputstringOutput format — use json for raw JSON

Examples

unkey api identities delete-identity --identity=user_123

Output

Default output shows the request ID with latency:
req_01H9TQPP77V5E48E9SH0BG0ZQX (took 38ms)
With --output=json, the full response envelope is returned:
{
  "meta": {
    "requestId": "req_01H9TQPP77V5E48E9SH0BG0ZQX"
  }
}
Last modified on March 26, 2026