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

# Delete user profile

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

This API enables you to delete existing user profiles by using `distinct_id`.

## 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.

## Body

#### distinct\_id (body, array of string, required)

Enter the `distinct_id` of all user profiles that you wish to delete.

## Response

#### 200

Profile deleted successfully

#### \_message (string, required)

#### status (string, required)

#### 400

Distinct ID 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/delete' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"distinct_id": ["U00001", "U00002"]}'
```

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

```python Python
import requests

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

#### Response

```json 200
{
  "_message": "1 User(s) deleted successfully",
  "status": "ok"
}
```

```json 400
{
  "_message": "Cannot delete non existing user",
  "status": "error"
}
```

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