## Remove the Contact ID

### API Endpoint

`POST /v2.0/profiles/{profileId}/contactids/remove`

### Request Example in cURL

```bash
curl --request POST \
  --url https://api-trial.cognigy.ai/new/v2.0/profiles/{profileId}/contactids/remove \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "contactId": "<string>"
}'
```

### Request Example in Python

```python
import requests

url = "https://api-trial.cognigy.ai/new/v2.0/profiles/{profileId}/contactids/remove"

payload = { "contactId": "<string>" }
headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Request Example in JavaScript (Fetch API)

```javascript
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({contactId: '<string>'})
};

fetch('https://api-trial.cognigy.ai/new/v2.0/profiles/{profileId}/contactids/remove', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Response Codes

- **204**: Successfully deleted Conversations
- **400**: Bad Request
  ```json
  {
    "type": "Bad Request",
    "title": "Bad Request Error",
    "status": 400,
    "detail": "Validation failed. Missing payload.",
    "instance": "/v2.0/flows/5ce7c2d833ea1e04d7e6c432",
    "code": 1000,
    "traceId": "api--f84324f4-98eb-4f02-abdd-375a2e6c3c1f",
    "details": {}
  }
  ```
- **401**: Unauthorized
  ```json
  {
    "type": "Unauthorized",
    "title": "Unauthorized Error",
    "status": 401,
    "detail": "<string>",
    "instance": "/v2.0/flows/5ce7c2d833ea1e04d7e6c432",
    "code": 401,
    "traceId": "api--f84324f4-98eb-4f02-abdd-375a2e6c3c1f",
    "details": {}
  }
  ```
- Additional errors may follow a similar format for status codes: **403**, **404**, **405**, **409**, **413**, **500**, **501**, **502**, **503**, **504**.

### Headers

#### Required Header:
- **X-API-Key**: Supplied in the HTTP header.
