## Unassign a Project from a User

### Endpoint

`POST /v2.0/users/{userId}/removeproject`

### Description
Unassign a project from a user.

### Request Example

#### cURL

```bash
curl --request POST \
  --url https://api-trial.cognigy.ai/new/v2.0/users/{userId}/removeproject \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '\n{\n  "projectId": "<string>"\n}\n'
```

#### Python

```python
import requests

url = "https://api-trial.cognigy.ai/new/v2.0/users/{userId}/removeproject"

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

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

print(response.text)
```

#### JavaScript (Fetch)

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

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

### Request Body

| Parameter   | Type   | Required | Description                              |
|-------------|--------|----------|------------------------------------------|
| projectId   | string | Yes      | The ID of the project to unassign.      |

### Response

- `204 No Content`: The user no longer has access to the project.

### Error Responses

- `400 Bad Request`: Validation failed. Missing payload.
- `401 Unauthorized`: Invalid API key.
- `404 Not Found`: User or project not found.

### Authorization

- **X-API-Key**: Required in the header to authorize the request.
