# Remove the legacy GitHub token.

> The versioned twin of `DELETE /api/settings/github-token`, and the explicit last step of moving to the App.
> https://koi.dog/docs/api/github/delete-git-hub-legacy-token/

`DELETE /api/v1/github/legacy-token` · Scopes: `config`, `approve`

Answers the installation slot after it. Removing it while an active installation reaches every project repository moves the workspace to the App for good: a legacy token can no longer be stored. Removing it before then only disconnects it; repositories the installation does not reach lose GitHub access. It never uninstalls the App. `409 connection_in_use` while a crew that is not over works on a repository nothing else would serve; `409 conflict` when another token was stored, or the workspace's GitHub access changed (a project, an installation or what it reaches), while GitHub was asked: nothing is removed or recorded. The timeline records the key ID, action and outcome.

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Retry the same request with the same key. [Retry rules](https://koi.dog/docs/api/#retries). |

## Response.

200 OK · JSON object

## Request.

```sh
curl -X DELETE https://api.koi.dog/api/v1/github/legacy-token \
    -H "Authorization: Bearer $KOIDOG_API_KEY"
```

```js
const res = await fetch("https://api.koi.dog/api/v1/github/legacy-token", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
  },
});
console.log(await res.json());
```

```python
import os

import requests

r = requests.delete(
    "https://api.koi.dog/api/v1/github/legacy-token",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "installation": {
  },
  "needsMigration": false,
  …
}
```
