> ## Documentation Index
> Fetch the complete documentation index at: https://docs.entityml.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete API Key

> Deactivate an API key.

## Request

<Note>
  This endpoint does not require a Bearer token. After deletion, the key will no longer appear in the active-key list.
</Note>

### Path Parameters

<ParamField path="key_id" type="string" required>
  The ID of the API key to deactivate.
</ParamField>

### Query Parameters

<ParamField query="user_id" type="string" required>
  The user ID that owns the key.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the key was deactivated successfully.
</ResponseField>

<ResponseField name="message" type="string">
  Confirmation message.
</ResponseField>

## Example

<CodeGroup>
  ```python Python SDK theme={null}
  from entityml import EntityMLClient

  client = EntityMLClient()
  deleted = client.api_keys.delete(key_id="YOUR_KEY_ID", user_id="YOUR_USER_ID")
  print(deleted)
  ```

  ```bash CLI theme={null}
  entityml api-keys delete \
    --key-id YOUR_KEY_ID \
    --user-id YOUR_USER_ID
  ```

  ```bash Raw HTTP (cURL) theme={null}
  curl -X DELETE "https://api.entityml.com/api/v1/keys/YOUR_KEY_ID?user_id=YOUR_USER_ID"
  ```
</CodeGroup>

### Example response

```json theme={null}
{
  "success": true,
  "message": "API key deactivated successfully"
}
```
