# Delete access token - Platform API

> Delete a GetBlock access token. Its endpoint URL stops working immediately. Complete guide to DELETE /tokens/{id} in the Platform API.

`DELETE /tokens/{id}` deletes one of your tokens, whatever its access type. The token stops working immediately.

```
DELETE https://public-api.getblock.io/api/v1/tokens/{id}
```

> **Danger:** **This cannot be undone.** Every client still using the token's endpoint URL starts failing. To replace a leaked token with a working one, [rotate](/platform-api/api-reference/rotate-token/) it instead.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | Path parameter. The token's `id`. |

## Request Example

#### cURL

```bash
curl -X DELETE https://public-api.getblock.io/api/v1/tokens/9b2796d7b4c448de83b01644bb93f625 \
  -H "Authorization: Bearer $GETBLOCK_API_KEY"
```

#### JavaScript

```javascript
const tokenId = '9b2796d7b4c448de83b01644bb93f625';

const response = await fetch(`https://public-api.getblock.io/api/v1/tokens/${tokenId}`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.GETBLOCK_API_KEY}` }
});

console.log(response.status); // 204
```

#### Python

```python
import os
import requests

token_id = "9b2796d7b4c448de83b01644bb93f625"

response = requests.delete(
    f"https://public-api.getblock.io/api/v1/tokens/{token_id}",
    headers={"Authorization": f"Bearer {os.environ['GETBLOCK_API_KEY']}"},
)

print(response.status_code)  # 204
```

## Response Example

`204 No Content`, without a body.

## Response Parameters

None.

## Use Cases

* Remove endpoints of a service you shut down
* Free a slot when you reach the plan's token limit
* Revoke access for a customer who left your service

## Error Handling

| HTTP | Cause |
| --- | --- |
| 401 | Missing or invalid API key. |
| 404 | No such token among yours, or it is already deleted. |
| 502 | A GetBlock service behind the API did not answer. Retry later. |

Error bodies carry an `error` message and a `request_id`. See [Errors](/platform-api/api-reference/objects-and-conventions/#errors).
