# Delete a connection and its stored credential.

> Refused while agents still use it.
> https://koi.dog/docs/api/connections/delete-connection/

`DELETE /api/v1/connections/{id}` · Scopes: `config`, `approve`

Destructive, so a key needs `approve` as well as `config`. When an API key calls it, the timeline records who did what and the outcome. No query parameters, and no body.

## Path parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The connection's id. |

## Response.

204 No Content: the answer has no body.

## Request.

```sh
curl -X DELETE "https://app.koi.dog/api/v1/connections/$ID" \
    -H "Authorization: Bearer $KOIDOG_API_KEY"
```

```js
const res = await fetch(`https://app.koi.dog/api/v1/connections/${process.env.ID}`, {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
  },
});
console.log(res.status);
```

```python
import os

import requests

r = requests.delete(
    f"https://app.koi.dog/api/v1/connections/{os.environ['ID']}",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
)
r.raise_for_status()
print(r.status_code)
```
