Python
import requests
url = "https://app.langwatch.ai/api/roles/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"permissions": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', permissions: ['<string>']})
};
fetch('https://app.langwatch.ai/api/roles/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://app.langwatch.ai/api/roles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
]
}
'{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
],
"createdAt": "<string>",
"updatedAt": "<string>"
}Roles
Update role
Update a custom role. Partial: only the fields present are written; a permissions list replaces the set outright.
PATCH
/
api
/
roles
/
{id}
Python
import requests
url = "https://app.langwatch.ai/api/roles/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"permissions": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', permissions: ['<string>']})
};
fetch('https://app.langwatch.ai/api/roles/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://app.langwatch.ai/api/roles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
]
}
'{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
],
"createdAt": "<string>",
"updatedAt": "<string>"
}Authorizations
Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.
Path Parameters
Minimum string length:
1Body
application/json
Was this page helpful?
⌘I