Assign a Global Role - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

Assign a Global Role

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

Example Usage

cURL

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

Python

import requests

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

payload = {}
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({})
};

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

Common Response Status Codes

Authorizations

Required Headers

Body Parameters

application/json

Role options

Path Parameters

Response