---
title: "Disconnect a connected AI app"
description: "Owners and admins may disconnect any grant in the workspace; anyone may disconnect their own.\nSets revoked_at and revoked_by; the app's next call is refused. Repeating it is harmless.\n"
---

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

Path: Channel Automation API › AI Connectors

`DELETE /api/workspaces/{workspaceId}/ai-connectors/grants/{grantId}`

Owners and admins may disconnect any grant in the workspace; anyone may disconnect their own.
Sets revoked_at and revoked_by; the app's next call is refused. Repeating it is harmless.

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Path parameters

- `workspaceId` (`delete/api/workspaces/workspaceId/ai-connectors/grants/grantId.path.workspaceId`; string, required)
- `grantId` (`delete/api/workspaces/workspaceId/ai-connectors/grants/grantId.path.grantId`; string, required)
  - format `uuid`

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.channelautomation.com/api/workspaces/<workspaceId>/ai-connectors/grants/<grantId>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/workspaces/<workspaceId>/ai-connectors/grants/<grantId>';
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.channelautomation.com/api/workspaces/<workspaceId>/ai-connectors/grants/<grantId>"

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

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

print(response.text)
```

## Responses

### 200

{ success, data: { id, revoked_at, revoked_by }, already_revoked? }

### 403

Someone else's grant and the caller is not an owner or admin

### 404

No grant with that id in this workspace

### 503

AI_CONNECTORS_NOT_SET_UP, or unavailable


Source: https://developer.channelautomations.com/api/delete-api-workspaces-workspace-id-ai-connectors-grants-grant-id/index.md
