Skip to content

API Reference / Memberships

Count memberships by status in the caller's own workspace

Returns the number of memberships in each status in the caller's own active workspace, optionally narrowed to a single user. There is no workspace_id request field. The result always means the caller's own workspace. Drives status-tab counts (Invited, Accepted) without loading every membership.

POST/accounts.v1.Accounts/CountMemberships

Request body

application/jsonRequired

Request for the number of memberships in each status in the caller's workspace.

filter?MembershipFilter

The same filter as ListMemberships.

Show attributes
query?string

Optional case-insensitive literal substring of the member's display name or email, matched server side. Absent or empty matches every membership.

userId?string

Optional filter: only memberships for this user.

Format"byte" base64

Response body

application/json

Success

counts?array<MembershipStatusCount>

Count of memberships in each status, scoped to the requested filters. A status with no memberships may be omitted.

Show attributes
count?integer

Number of memberships in this status.

Format"int32"

status?string

The membership status this count is for.

Value in"MEMBERSHIP_STATUS_INVITED""MEMBERSHIP_STATUS_ACCEPTED"

curl -X POST "https://api.goldmine.to/accounts.v1.Accounts/CountMemberships" \
  -H "Authorization: Bearer $CSTRADER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "counts": [
    {
      "status": "MEMBERSHIP_STATUS_INVITED",
      "count": 2
    },
    {
      "status": "MEMBERSHIP_STATUS_ACCEPTED",
      "count": 8
    }
  ]
}