Unassign a Project from a User - Cognigy Documentation

Unassign a Project from a User

Endpoint

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

Description

Unassign a project from a user.

Request Example

cURL

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

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)

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

Error Responses

Authorization