Source: https://fyno.docs.pageloop.ai/api-reference/manage-user-profiles/post-wsid-version-profiles-distinct-id-channel-delete

# Delete channel data

POST `https://api.fyno.io/v1/{WSID}/{version}/profiles/{distinct_id}/channel/delete`

This API enables you to delete existing data for all channels. You can use either of the following approaches:

- **Option 1:** Use the `channel` key in the payload to delete all tokens in the specified channel.
- **Option 2:** Use the `push` and `inapp` keys in the payload to delete specific tokens in these channels.

**Note:** You can use either option 1 or option 2. It is not allowed to use both approaches in one request.

## Authorization

#### Authorization (header, string, required)

Enter your API Key. If you don't have it already, you can create one from the API Keys page within your Fyno account

## Path Parameters

#### WSID (path, string, required)

Enter your workspace ID. You can obtain this value from the API Keys page within your Fyno account.

#### version (path, enum (string), required) — allowed: live, test

Specify the version for which you would like to manage the user profile.

#### distinct\_id (path, string, required)

Enter the distinct ID that you currently use to identify the user.

## Response

#### 200

Profile updated successfully

#### \_message (string, required)

#### status (string, required)

#### 400

Distinct ID or channel data does not exist

#### \_message (string, required)

#### status (string, required)

#### 401

API Key or Workspace ID is invalid. User is unauthorised.

#### \_message (string, required)

#### status (string, required)

#### Request

```bash cURL
curl -X POST 'https://api.fyno.io/v1/{WSID}/{version}/profiles/{distinct_id}/channel/delete' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

```javascript JavaScript
const res = await fetch('https://api.fyno.io/v1/{WSID}/{version}/profiles/{distinct_id}/channel/delete', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});
const data = await res.json();
```

```python Python
import requests

res = requests.post(
    'https://api.fyno.io/v1/{WSID}/{version}/profiles/{distinct_id}/channel/delete',
    headers={'Authorization': 'Bearer <token>'},
    json={}
)
data = res.json()
```

#### Response

```json 200
{
  "_message": "Channel has been modified successfully",
  "status": "ok"
}
```

```json 400
{
  "_message": "Unable to delete channel since the channel does not exist",
  "status": "error"
}
```

```json 401
{
  "_message": "Invalid API details",
  "status": "error"
}
```
