Python
import requests
url = "https://app.langwatch.ai/api/role-bindings"
payload = { "scopeId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({scopeId: '<string>'})
};
fetch('https://app.langwatch.ai/api/role-bindings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/role-bindings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scopeId": "<string>"
}
'{
"id": "<string>",
"principal": {
"id": "<string>",
"name": "<string>"
},
"customRoleId": "<string>",
"customRoleName": "<string>",
"scopeId": "<string>",
"scopeName": "<string>",
"createdAt": "<string>",
"hasLegacyAccessNotice": true
}Role Bindings
Create role binding
Create a role binding for exactly one principal: a user, a group, or an API key. Every reference is checked against the caller’s organization, and an identical binding answers 409 role_binding_already_exists.
POST
/
api
/
role-bindings
Python
import requests
url = "https://app.langwatch.ai/api/role-bindings"
payload = { "scopeId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({scopeId: '<string>'})
};
fetch('https://app.langwatch.ai/api/role-bindings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/role-bindings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scopeId": "<string>"
}
'{
"id": "<string>",
"principal": {
"id": "<string>",
"name": "<string>"
},
"customRoleId": "<string>",
"customRoleName": "<string>",
"scopeId": "<string>",
"scopeName": "<string>",
"createdAt": "<string>",
"hasLegacyAccessNotice": true
}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}.
Body
application/json
Available options:
ADMIN, MEMBER, VIEWER, CUSTOM Available options:
ORGANIZATION, TEAM, PROJECT Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Response
201 - application/json
Success
Show child attributes
Show child attributes
Available options:
ADMIN, MEMBER, VIEWER, CUSTOM Available options:
ORGANIZATION, TEAM, PROJECT Was this page helpful?
⌘I