# Remove a connection

`DELETE /v1/connections/{id}`

Removes a connection and its stored credentials. Refused while publications use it, unless `force` (they are removed too; what they published stays at the destination). Owners and admins only.

Scope: `docs:write`.

## Request

```bash
curl -X DELETE "https://api.lydie.co/v1/connections/01JCQ3V5MZ8G4ZK2X7T9R6N1PB" \
  -H "Authorization: Bearer $LYDIE_TOKEN"
```

## Path parameters

- `id` (ULID, required)

## Query parameters

- `force` (boolean, optional): Default: `false`.

## Response

- `id` (ULID, required)
- `removedPublications` (integer, required)

```json
{
  "id": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
  "removedPublications": -9007199254740991
}
```

Errors use the envelope described at https://developers.lydie.co/errors.md.
