Deprecate User Passwords - Cognigy Documentation

Deprecate User Passwords

Endpoint

POST /v2.0/users/deprecatepassword

Example Requests

cURL

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

#### Python
```python
import requests

url = "https://api-trial.cognigy.ai/new/v2.0/users/deprecatepassword"

payload = { "userId": "<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({userId: '<string>'})
};

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

Common Errors

Request Body

Response