code=NOT_FOUND.
Important: This operation is immediate and permanent. Verify you have the correct API ID before deletion. If delete protection is enabled, disable it first through the dashboard or API configuration.
Required permissions:
api.*.delete_api(to delete any API)api.<api_id>.delete_api(to delete a specific API)
See the API reference for the full HTTP endpoint documentation.
Usage
Flags
Specifies which API namespace to permanently delete from your workspace. Must be a valid API ID that begins with
api_ and exists within your workspace.Before proceeding, ensure you have the correct API ID and understand that this action cannot be undone. If you need to migrate functionality, create replacement keys in a new API namespace and update client applications before deletion.Global Flags
| Flag | Type | Description |
|---|---|---|
--root-key | string | Override root key ($UNKEY_ROOT_KEY) |
--api-url | string | Override API base URL (default: https://api.unkey.com) |
--config | string | Path to config file (default: ~/.unkey/config.toml) |
--output | string | Output format — use json for raw JSON |
Examples
Output
Default output shows the request ID with latency:--output=json, the full response envelope is returned:

