# Disconnect account (/docs/reference/connectors/delete)

`DELETE https://api.corespeed.io/connectors/:id`

Removes the caller's own unambiguous **private** account on an OAuth
connector: the upstream grant is revoked best-effort, then the stored
credential is deleted regardless of the revoke outcome.

This path no longer doubles as remote-MCP deregistration. An org-registered
remote MCP connector is deleted with **`DELETE /connectors/org/:slug`**
(admin-only, `403 admin_required` otherwise) — whole-sale: the registration,
its snapshots, its stored credentials, and the KV hot copies all go, with no
undo. The split means a remote slug can never collide with a connector id on
this route again.

A tied machine is not removed here either: `DELETE /connectors/device__<slug>`
answers `404 endpoint_not_found`. Untie it with [`cs untie`](/docs/cli/tie#untie)
on the machine, or revoke it from the dashboard.

#### Authorizations

* `Authorization` (string, header, required) — `Bearer <sk-cs-…>` — a CoreSpeed API key, or a user session JWT. `x-api-key: <sk-cs-…>` is accepted in its place.

#### Path parameters

* `id` (string, path, required) — An OAuth connector id, whose private account is removed.

#### Behavior

* **204** — Removed, or a no-op because you own no account on this connector — this route never deletes a shared account or an account shared with you.
* **409** `multiple_accounts` — You own more than one account on this connector, so the target is ambiguous. Address one account directly instead.
* **404** `endpoint_not_found` — Unknown connector id. Unknown ids never reveal anything, credentialed or not.

Shared accounts are removed over HTTP only through
`DELETE /connectors/:id/accounts/:accountId`, which returns `204` and enforces
the same per-scope authorization: private → owning member only; shared →
creator or organization admin. The `manage__accounts_remove` MCP tool performs
the same removal addressed by alias.

Authorizing a connector is not an HTTP operation — the OAuth dance runs in the
[dashboard](https://app.corespeed.io/connectors) over an internal binding, so
there is no public route to initiate a connect.

**curl**

```bash
curl -X DELETE https://api.corespeed.io/connectors/notion \
  -H "Authorization: Bearer $CORESPEED_API_KEY" \
  -i
```

**TypeScript**

```ts
const res = await fetch("https://api.corespeed.io/connectors/notion", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.CORESPEED_API_KEY}` },
});

if (res.status === 409) {
  throw new Error("multiple accounts match; remove one by account id");
}
```

**Python**

```python
import os
import httpx

res = httpx.delete(
    "https://api.corespeed.io/connectors/notion",
    headers={"Authorization": f"Bearer {os.environ['CORESPEED_API_KEY']}"},
)

if res.status_code == 409:
    raise RuntimeError("multiple accounts match; remove one by account id")
```

**Go**

```go
package main

import (
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("DELETE", "https://api.corespeed.io/connectors/notion", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("CORESPEED_API_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	if res.StatusCode == http.StatusConflict {
		panic("multiple accounts match; remove one by account id")
	}
}
```

**204 No Content** — Removed, or a no-op with no account of your own

No body.

**409 Conflict** — Ambiguous target

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "multiple_accounts",
    "message": "Multiple accounts connected for notion; use manage accounts_remove with a specific alias."
  }
}
```

**403 Forbidden** — DELETE /connectors/org/:slug, caller is not an org admin

```json
{
  "error": {
    "type": "forbidden",
    "code": "admin_required",
    "message": "Removing remote MCP connectors requires an org admin."
  }
}
```