# Revoke an endpoint key

Source: https://docs.vlayers.ai/reference/hosting/revoke-endpoint-key

`DELETE /v1/endpoints/{endpoint}/keys/{key}` · scope `workspace:write`

Stops the key working. Callers holding it are refused within half a minute. Revoking a key that is already revoked is a 404.

Requires an API key with the `workspace:write` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `endpoint` | path | string | yes | The endpoint id: the first segment of its `run.vlayers.ai` URL. Example: `"x7k2p4q9m3vd"` |
| `key` | path | string | yes | The key id from `GET /v1/agents/{id}/endpoints`. Example: `"0192f5c1-5e6f-7a8b-9c0d-1e2f3a4b5c67"` |

## Request

cURL:

```bash
curl -X DELETE "https://api.vlayers.ai/v1/endpoints/$ENDPOINT_ID/keys/$KEY_ID" \
  -H "Authorization: Bearer $VOICELAYER_API_KEY"
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { revokedAt } = await voicelayer.hosting.revokeEndpointKey('<endpoint-id>', '<key-id>');
console.log(revokedAt);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.hosting.revoke_endpoint_key("<endpoint-id>", "<key-id>")
print(result.revoked_at)
```

## Response `200`

```json
{
  "id": "0192f5c1-5e6f-7a8b-9c0d-1e2f3a4b5c67",
  "kind": "api",
  "name": "Partner integration",
  "preview": "vle_AbCd…wXyZ",
  "createdAt": "2026-10-20T15:04:05.000Z",
  "expiresAt": null,
  "lastUsedAt": null,
  "revokedAt": "2026-10-20T15:04:05.000Z"
}
```
