Skip to main content

Member Roles

Tags: members, permissions, roles

Member role and permission management

In the product: Roles

Resources​

Request and response models used by the endpoints on this page.

CreateMemberRoleRequest​

FieldTypeRequiredDescription
dailyCreditLimitInteger
fileAccessArray<dict[str, int]>
folderAccessArray<dict[str, int]>
grantedScopesArray
nameString✓
siteAudienceArray

Example:

{
"name": "string"
}

DriftedSystemRoleResponse​

FieldTypeRequiredDescription
canonicalNameString✓
extraScopesArrayDefault: []
missingScopesArrayDefault: []
nameString✓
nameMatchesBoolean✓
roleIdInteger✓
systemKeyString✓

Example:

{
"roleId": 0,
"name": "string",
"systemKey": "string",
"canonicalName": "string",
"nameMatches": false,
"missingScopes": [],
"extraScopes": []
}

LegacyRoleSuggestionResponse​

FieldTypeRequiredDescription
matchTypeString✓How confident the match is. 'duplicate_name' — the role folds to the same canonical name as the target, so it is unambiguously the same role written differently; safe to merge. 'legacy_alias' — an older name for the target (e.g. 'admin' for Manager); this is a guess, the role may have been customised into something the workspace relies on, so clients should require explicit review rather than pre-selecting it.
referencesRoleReferenceCountsResponse✓Counts of everything in the workspace that points at the source role and would move.
resourcesTargetWouldGainIntegerResources the source role can reach that the target cannot. Under the 'union' access strategy these become newly reachable for everyone who already holds the target role. (default: 0)
sourceRoleIdInteger✓
sourceRoleNameString✓
systemKeyString✓
targetRoleIdInteger✓
targetRoleNameString✓

Example:

{
"sourceRoleId": 0,
"sourceRoleName": "string",
"targetRoleId": 0,
"targetRoleName": "string",
"systemKey": "string",
"matchType": "string",
"references": null,
"resourcesTargetWouldGain": 0
}

MemberRoleCleanupPlanResponse​

FieldTypeRequiredDescription
driftedArray<DriftedSystemRoleResponse>Default: []
isCleanBooleanDefault: True
missingSystemKeysArrayDefault: []
suggestionsArray<LegacyRoleSuggestionResponse>Default: []

Example:

{
"suggestions": [],
"drifted": [],
"missingSystemKeys": [],
"isClean": true
}

MemberRoleFileAccessResponse​

FieldTypeRequiredDescription
accessModeInteger✓
fileIdInteger✓

Example:

{
"fileId": 0,
"accessMode": 0
}

MemberRoleFolderAccessResponse​

FieldTypeRequiredDescription
accessModeInteger✓
folderIdInteger✓

Example:

{
"folderId": 0,
"accessMode": 0
}

MemberRoleResponse​

FieldTypeRequiredDescription
createdAtDateTime✓
dailyCreditLimitInteger
fileAccessArray<MemberRoleFileAccessResponse>Default: []
folderAccessArray<MemberRoleFolderAccessResponse>Default: []
grantedScopesArrayDefault: []
idInteger✓
isDefaultForNewMembersBooleanDefault: False
memberCountIntegerDefault: 0
nameString✓
siteAudienceArrayDefault: []
systemKeyString
updatedAtDateTime✓
uuidString✓

Example:

{
"id": 0,
"uuid": "string",
"name": "string",
"grantedScopes": [],
"siteAudience": [],
"fileAccess": [],
"folderAccess": [],
"memberCount": 0,
"isDefaultForNewMembers": false,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}

MergeMemberRolesRequest​

FieldTypeRequiredDescription
accessStrategyLiteral['union', 'target_only']Default: union
sourceRoleIdInteger✓
targetRoleIdInteger✓

Example:

{
"sourceRoleId": 0,
"targetRoleId": 0,
"accessStrategy": "union"
}

MergeMemberRolesResponse​

FieldTypeRequiredDescription
accessRowsDiscardedIntegerDefault: 0
accessRowsMergedIntegerDefault: 0
accessRowsMovedIntegerDefault: 0
anonymousPhoneNumbersMovedIntegerDefault: 0
invitationsMovedIntegerDefault: 0
memberSubscriptionsMovedIntegerDefault: 0
membersMovedIntegerDefault: 0
personasMovedIntegerDefault: 0
productsMovedIntegerDefault: 0
signupPhoneNumbersMovedIntegerDefault: 0
signupRoutingRulesMovedIntegerDefault: 0
signupSitesMovedIntegerDefault: 0
sourceRoleIdInteger✓
sourceRoleNameString✓
strategyString✓
targetRoleIdInteger✓
targetRoleNameString✓

Example:

{
"sourceRoleId": 0,
"sourceRoleName": "string",
"targetRoleId": 0,
"targetRoleName": "string",
"strategy": "string",
"membersMoved": 0,
"accessRowsMoved": 0,
"accessRowsMerged": 0,
"accessRowsDiscarded": 0,
"signupSitesMoved": 0,
"signupPhoneNumbersMoved": 0,
"signupRoutingRulesMoved": 0,
"anonymousPhoneNumbersMoved": 0,
"personasMoved": 0,
"invitationsMoved": 0,
"productsMoved": 0,
"memberSubscriptionsMoved": 0
}

RoleReferenceCountsResponse​

FieldTypeRequiredDescription
anonymousPhoneNumbersIntegerPhone numbers whose stored anonymous role names this role. The column is not read at runtime; routing rules name the role for new callers. (default: 0)
memberSubscriptionsIntegerPaid member subscriptions whose granted or previous role points at this role. (default: 0)
membersIntegerMembers holding the role. (default: 0)
pendingInvitationsIntegerInvitations not yet accepted or declined that would grant this role. (default: 0)
personasIntegerAgent personas that instantiate with this role. (default: 0)
productsIntegerMEMBER products whose checkout grants this role. (default: 0)
resourceAccessIntegerSite audience, File access and Folder access rows naming the role. (default: 0)
signupPhoneNumbersIntegerPhone numbers that assign this role on signup. (default: 0)
signupRoutingRulesIntegerRouting Rules that give this role to new callers. (default: 0)
signupSitesIntegerSites that assign this role on signup. (default: 0)
totalIntegerSum of every count above. (default: 0)

Example:

{
"members": 0,
"resourceAccess": 0,
"signupSites": 0,
"signupPhoneNumbers": 0,
"signupRoutingRules": 0,
"anonymousPhoneNumbers": 0,
"personas": 0,
"pendingInvitations": 0,
"products": 0,
"memberSubscriptions": 0,
"total": 0
}

UpdateMemberRoleRequest​

FieldTypeRequiredDescription
dailyCreditLimitInteger
fileAccessArray<dict[str, int]>
folderAccessArray<dict[str, int]>
grantedScopesArray
nameString
siteAudienceArray

Example:

{}

Endpoints​

List​

GET /api/v2/w/{workspace_uuid}/member-roles

Description:

List all member roles.

Authorization: Requires member-roles:read scope

Response: List of MemberRoleResponse


Create​

POST /api/v2/w/{workspace_uuid}/member-roles

Description:

Create a new member role.

Always creates a custom role. Returns 400 if the name is already taken, or if it matches one of the platform's default role names (case- and punctuation-insensitively) — those names are reserved.

Authorization: Requires member-roles:admin scope

Parameters:

Response: See MemberRoleResponse


Cleanup Plan​

GET /api/v2/w/{workspace_uuid}/member-roles/cleanup-plan

Description:

Describe the workspace's legacy default-role duplicates. Changes nothing.

Reports duplicates of the platform's default roles left behind by older versions of the product, how many members and references each would move, and any default role whose name or permissions have drifted.

Authorization: Requires member-roles:admin scope

Response: See MemberRoleCleanupPlanResponse


Merge​

POST /api/v2/w/{workspace_uuid}/member-roles/cleanup/merge

Description:

Move every member and reference from one role to another, then delete it.

accessStrategy controls the source role's resource access: union (default) copies it onto the target, so nobody who held the source loses access; target_only discards it, so nothing is widened for people who already held the target. Irreversible.

Returns 404 if either role does not exist, and 400 if the two are the same role, the source is a platform default (those are never deleted), or an accountless human would be moved into built-in Manager/User.

Authorization: Requires member-roles:admin scope

Parameters:

Response: See MergeMemberRolesResponse


Get Role Id Or Uuid​

GET /api/v2/w/{workspace_uuid}/member-roles/{role_id_or_uuid}

Description:

Get a specific member role by ID or UUID. Users can view their own role, managers can view any role.

Authorization: Requires member-roles:read scope

Parameters:

  • role_id_or_uuid (String)

Response: See MemberRoleResponse


Delete Role Id​

DELETE /api/v2/w/{workspace_uuid}/member-roles/{role_id}

Description:

Delete a member role.

Returns 403 for one of the platform's default roles, 400 if any members are still assigned to the role or any still-claimable invitation names it, and 404 if it does not exist.

Authorization: Requires member-roles:admin scope

Parameters:

  • role_id (Integer)

Response: None


Update Role Id​

PUT /api/v2/w/{workspace_uuid}/member-roles/{role_id}

Description:

Update an existing member role.

Returns 403 when the role is one of the platform's default roles and the request changes its name or granted scopes; those are fixed. Site audience and File/Folder access remain editable on every role. Returns 404 if the role does not exist, and 400 if the new name is already taken.

Authorization: Requires member-roles:admin scope

Parameters:

Response: See MemberRoleResponse