Skip to main content

delete-identity

Permanently delete an identity using the Unkey CLI. Remove the entity and unlink all associated API keys for cleanup or compliance purposes.
1 min read

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)
Note

See the API reference for the full HTTP endpoint documentation.

Usage#

Flags#

--identitystringrequired#

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
--bodystringSend this JSON string as the request body. You cannot combine it with request-building flags.

Examples#

Output#

Default output shows the request ID:

With --output=json, the full response envelope is returned: