API Reference / Memberships
Invite a user to a workspace
Creates a membership inviting a user to a workspace with the given initial operational policies. The invitation always creates a member-role membership. Ownership cannot be granted through an invite. The invited user must accept before the membership becomes active.
/ accounts. v1. Accounts/ CreateMembershipRequest body
application/jsonRequired
Request to invite a user to the caller's workspace. The owner or an administrator can invite a member. Only the owner can invite an administrator. The invitation stays invited until the user accepts.
policies?array<string>Policies the member will hold once they accept: any of "trading", "steam", "proxies", "analytics" and "csfloat". Empty invites a read-only member.
role?stringThe role offered: MEMBERSHIP_ROLE_MEMBER (the default when unspecified) or MEMBERSHIP_ROLE_ADMINISTRATOR, which only the owner can offer. An administrator's policies must be empty, because the role holds every operational permission.
Value in"MEMBERSHIP_"MEMBERSHIP_"MEMBERSHIP_
userId?stringOpaque 16-byte identifier of the user to invite, base64-encoded in JSON. GetUserByEmail resolves an email address to this identifier.
Format"byte" base64
Response body
application/json
Success
membership?MembershipThe new membership, with the offered role and invited status.
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.
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
The resource already exists.
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 was rate limited. Slow down and retry later.
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/CreateMembership" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "q83vq83vEjRWeBI0VniQqg==",
"policies": [
"trading",
"analytics"
]
}'const res = await fetch("https://api.goldmine.to/accounts.v1.Accounts/CreateMembership", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"userId": "q83vq83vEjRWeBI0VniQqg==",
"policies": [
"trading",
"analytics"
]
}),
});
const data = await res.json();body := strings.NewReader(`{
"userId": "q83vq83vEjRWeBI0VniQqg==",
"policies": [
"trading",
"analytics"
]
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/accounts.v1.Accounts/CreateMembership", 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/CreateMembership",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"userId": "q83vq83vEjRWeBI0VniQqg==",
"policies": [
"trading",
"analytics"
]
},
)
data = res.json(){
"membership": {
"id": "ICEiIyQlJicoKSorLC0uLw==",
"userId": "q83vq83vEjRWeBI0VniQqg==",
"workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
"role": "MEMBERSHIP_ROLE_MEMBER",
"status": "MEMBERSHIP_STATUS_INVITED",
"createdAt": "2026-06-29T12:00:00Z",
"updatedAt": "2026-06-29T12:00:00Z",
"policies": [
"trading",
"analytics"
]
}
}{
"code": "invalid_argument",
"message": "The request was malformed, such as a missing required field or an unparseable cursor."
}{
"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": "already_exists",
"message": "The resource already exists."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}