RBAC API

Role-based access control endpoints for assigning and validating permissions

RBAC API

RBAC (Role-Based Access Control) governs access at organization, project, and resource scopes.

Overview

Roles map to a collection of permissions. Users receive roles via assignments scoped to a specific organization, project, or resource.

Global Roles Listing

GET /api/v1/roles

Returns all system-defined roles.

Permissions Check

GET /api/v1/permissions/check?scopeType=project&scopeId=proj-abc123

Returns actions the current user can perform within the specified scope.

Role Assignments

Organization Level

GET    /api/v1/organizations/{orgId}/rbac
POST   /api/v1/organizations/{orgId}/rbac
DELETE /api/v1/organizations/{orgId}/rbac/{assignmentId}

Project Level

GET    /api/v1/projects/{projectId}/rbac
POST   /api/v1/projects/{projectId}/rbac
DELETE /api/v1/projects/{projectId}/rbac/{assignmentId}

Resource Level

GET    /api/v1/projects/{projectId}/resources/{resourceId}/rbac
POST   /api/v1/projects/{projectId}/resources/{resourceId}/rbac
DELETE /api/v1/projects/{projectId}/resources/{resourceId}/rbac/{assignmentId}

Role Assignment Object

interface RoleAssignment {
  assignment_id: string;
  user_id: string;
  role: string; // e.g. project_viewer, project_editor, project_owner
  scope_type: "organization" | "project" | "resource";
  scope_id: string;
  created_at: string;
}

Common Roles (Examples)

RoleDescription
org_ownerFull organization control
project_ownerManage project + billing
project_editorCreate/update resources
project_viewerRead-only project access
resource_editorModify resource configuration
resource_viewerRead-only resource access

Error Responses

StatusDescription
400 Bad RequestInvalid role or scope
401 UnauthorizedMissing/invalid token
403 ForbiddenInsufficient permission
404 Not FoundScope does not exist

Next Steps

Cookie Notice

We use cookies to enhance your browsing experience.