# Disconnect one of an agent's connections, or cancel its sign-in.

`DELETE /o/{org}/agents/{agent}/connections/{connection}`

The agent's next session that needs it is `422 CONNECTION_NOT_READY` until it is connected again.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org` | path | string | yes | The org's slug or id. A caller with no role in the org gets `404`. |
| `agent` | path | string | yes | The id or name of an agent made from a template (`POST /o/{org}/agents {template, name}`). |
| `connection` | path | string | yes | The id the create returned, or a connection's own id from the list. |

## Example request

```bash
curl -X DELETE "https://api.phoenix.so/o/$RUSH_ORG/agents/$AGENT/connections/$CONNECTION" \
  -H "Authorization: Bearer $RUSH_TOKEN"
```

```typescript
const org = process.env.RUSH_ORG;
const agent = process.env.AGENT;
const connection = process.env.CONNECTION;

const res = await fetch(`https://api.phoenix.so/o/${org}/agents/${agent}/connections/${connection}`, {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.RUSH_TOKEN}`,
  },
});

console.log(res.status, await res.json());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]
agent = os.environ["AGENT"]
connection = os.environ["CONNECTION"]

res = requests.delete(
    f"https://api.phoenix.so/o/{org}/agents/{agent}/connections/{connection}",
    headers={"Authorization": f"Bearer {os.environ['RUSH_TOKEN']}"},
)

print(res.status_code, res.json())
```

## Responses

### 200

Deleted.

- `id` (string, required)
- `deleted` (boolean, required, one of `true`)

### 401

No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.

### 404

No such agent, or no such connection of it (`NOT_FOUND`).

### 429

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (`RATE_LIMITED`). The error names the limit. Wait `Retry-After` seconds.

## Example response (200)

```json
{
  "id": "c41e8a72-0d5b-4c9e-a3f6-71b2d8e45f09",
  "deleted": true
}
```
