Skip to main content
Available on Enterprise plans. An organization without an Enterprise plan is refused with HTTP 402 and the error code enterprise_plan_required. Self-hosted deployments need an Enterprise license for the same endpoints. To enable it, reach out to enterprise@langwatch.ai.

Intro

A role binding is one sentence: this principal has this role, here. It is how every kind of access in LangWatch is expressed, so this is the API to read when you want to know who can reach what. Each binding names exactly one principal, and there are three kinds:

Authentication

Requires an organization-level API key with organization:manage. Pass it as a Bearer token:

Endpoints

GET filters on userId, groupId, apiKeyId, scopeType and scopeId, and pages with offset and limit. limit defaults to 50 and cannot exceed 200. totalCount counts the filtered set, not the organization.

Scopes

The roles are ADMIN, MEMBER, VIEWER, and CUSTOM. CUSTOM carries a customRoleId from the Roles API, and is refused without one (custom_role_id_required). Some permissions only mean something for the organization as a whole, membership and billing among them. Granting one through a team- or project-scoped binding is refused at write time with org_exclusive_permission_scope, rather than being accepted and quietly having no effect.

Creating is idempotent-friendly

A binding is identified by its principal, its role, and its scope. Creating the same combination twice answers 409 role_binding_already_exists, which a provisioning tool can read as “already done” instead of a failure. A PATCH changes the role; the principal and the scope stay as they are, so moving a grant somewhere else means a new binding.

hasLegacyAccessNotice

A create response can carry hasLegacyAccessNotice: true. It means this is the person’s first explicit binding, and until now their access came from plain team membership, which this write switches off. Nothing failed, and nothing is blocked: it is there so a tool can tell an operator that this user’s access is now described entirely by bindings.

Errors