API Reference / Memberships
Change a member's role
Makes a membership in the caller's workspace a member or an administrator. Only the owner can call it. The owner's own role is changed only by transferring ownership. The membership's policies are cleared, because an administrator holds every operational permission by role and a demoted administrator starts as a read-only member. Demoting an administrator also revokes the API keys they hold in the workspace, because a key never exceeds its holder's access.
/ accounts. v1. Accounts/ UpdateMembershipRoleRequest body
application/jsonRequired
Request by the owner to make an accepted or invited membership in the caller's workspace a member or an administrator. Ownership moves only through TransferWorkspaceOwnership.
membershipId?stringOpaque 16-byte identifier of the membership to change, base64-encoded in JSON. The owner's own membership is refused.
Format"byte" base64
role?stringThe new role: MEMBERSHIP_ROLE_MEMBER or MEMBERSHIP_ROLE_ADMINISTRATOR. Owner is refused.
Value in"MEMBERSHIP_"MEMBERSHIP_"MEMBERSHIP_
Response body
application/json
Success
membership?MembershipThe membership with its new role. Its policies are cleared either way: an administrator holds every operational permission by role, and a demoted administrator starts as a read-only member.
Show attributes
createdAt?stringWhen the membership was created, which for a member is when they were invited.
Format"date-time"
expiresAt?stringWhen a pending invitation stops being acceptable. Unset once accepted and for an owner.
Format"date-time"
id?stringOpaque 16-byte identifier of the membership, assigned when the invitation is created. Base64-encoded in JSON.
Format"byte" base64
invitedBy?stringOpaque 16-byte identifier of the user who sent the invitation. Unset for the workspace owner and for invitations sent before the inviter was recorded.
Format"byte" base64
lastActiveAt?stringWhen the member last used the workspace while signed in, to the minute. Unset for a member who has not used it since activity was recorded.
Format"date-time"
policies?array<string>Names of the policies a member holds: any of "trading", "steam", "proxies", "analytics" and "csfloat". Empty means a read-only member. Not used for an owner or an administrator, who hold every operational permission by role.
role?stringOwner for the one person who holds the workspace (its creator until ownership is transferred), administrator for someone who runs it with the owner but cannot delete it, hand it over or change roles, or member for everyone else.
Value in"MEMBERSHIP_"MEMBERSHIP_"MEMBERSHIP_
status?stringInvited until the invited user accepts, then accepted.
Value in"MEMBERSHIP_"MEMBERSHIP_
updatedAt?stringWhen the membership was last changed, such as accepted or given new policies.
Format"date-time"
userId?stringOpaque 16-byte identifier of the member user, base64-encoded in JSON.
Format"byte" base64
workspaceId?stringOpaque 16-byte identifier of the workspace, base64-encoded in JSON.
Format"byte" base64
application/json
The request was malformed, such as a missing required field or an unparseable cursor. The request cannot be carried out in the current system state.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The request lacks a valid API key in the Authorization header.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The API key is not allowed to perform this action on this workspace.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The requested resource does not exist in this workspace.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
An internal server error occurred.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
curl -X POST "https://api.goldmine.to/accounts.v1.Accounts/UpdateMembershipRole" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"membershipId": "ICEiIyQlJicoKSorLC0uLw==",
"role": "MEMBERSHIP_ROLE_ADMINISTRATOR"
}'const res = await fetch("https://api.goldmine.to/accounts.v1.Accounts/UpdateMembershipRole", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"membershipId": "ICEiIyQlJicoKSorLC0uLw==",
"role": "MEMBERSHIP_ROLE_ADMINISTRATOR"
}),
});
const data = await res.json();body := strings.NewReader(`{
"membershipId": "ICEiIyQlJicoKSorLC0uLw==",
"role": "MEMBERSHIP_ROLE_ADMINISTRATOR"
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/accounts.v1.Accounts/UpdateMembershipRole", body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CSTRADER_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)import os, requests
res = requests.post(
"https://api.goldmine.to/accounts.v1.Accounts/UpdateMembershipRole",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"membershipId": "ICEiIyQlJicoKSorLC0uLw==",
"role": "MEMBERSHIP_ROLE_ADMINISTRATOR"
},
)
data = res.json(){
"membership": {
"id": "ICEiIyQlJicoKSorLC0uLw==",
"userId": "q83vq83vEjRWeBI0VniQqg==",
"workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
"role": "MEMBERSHIP_ROLE_ADMINISTRATOR",
"status": "MEMBERSHIP_STATUS_ACCEPTED",
"createdAt": "2026-06-29T12:00:00Z",
"updatedAt": "2026-06-29T12:20:00Z"
}
}{
"code": "failed_precondition",
"message": "The request cannot be carried out in the current system state."
}{
"code": "unauthenticated",
"message": "The request lacks a valid API key in the Authorization header."
}{
"code": "permission_denied",
"message": "The API key is not allowed to perform this action on this workspace."
}{
"code": "not_found",
"message": "The requested resource does not exist in this workspace."
}{
"code": "internal",
"message": "An internal server error occurred."
}