Modulify

Count the members on each role

get_role_member_counts

Counts how many people hold each role in a workspace.

POST /v1/get_role_member_countsScopeworkspaces:readRead only

Read it before delete_workspace_role, because deleting a role that people still hold moves them back to the stock Member role. Read it before changing a role's permissions with update_workspace_role too, so you know how many people the change reaches.

The answer maps each role to its count, keyed by owner, member or a custom role's id. Only people who have joined are counted, not pending invitations, and a role nobody holds is left out. See Members and roles.

Request

Call it with a POST to https://api.modulify.ai/v1/get_role_member_counts, sending the inputs below as a JSON object. The token needs the workspaces:read scope.

It only reads and changes nothing, so retrying it is safe.

curl -X POST https://api.modulify.ai/v1/get_role_member_counts \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"WORKSPACE_ID"}'

Over MCP, the same method is the get_role_member_counts tool.

Inputs

Input Type Required Description
workspaceId string Yes The workspace id.

Response

Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.