---
title: "Delete a connection"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a connection

Path: CloudRaker Workspace API › Connections

`DELETE /spaces/{spaceId}/connections/{connectionId}`

Deletes the connection, destroys its stored secrets (deletion IS the revocation primitive) and removes its auto-provisioned action. Authorization: `space:contribute` on the connection’s own space. Returns `{ data: { id, deleted } }`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`deleteConnection.path.spaceId`; string, required)
- `connectionId` (`deleteConnection.path.connectionId`; string, required)

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/connections/<connectionId>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/connections/<connectionId>';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/spaces/<spaceId>/connections/<connectionId>"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

The deleted connection id.

#### Example

```json
{
  "data": {
    "id": "string",
    "deleted": true
  }
}
```

- `data` (`deleteConnection.response.200.data`; object, required)
  - `id` (`deleteConnection.response.200.data.id`; string, required)
  - `deleted` (`deleteConnection.response.200.data.deleted`; boolean, required)


Source: https://docs.cloudraker.com/workspace/api/connections/delete-connection/index.md
