API Reference / Memberships
Leave a workspace
Removes the caller's own accepted membership of the named workspace, whichever workspace is current. The owner must transfer ownership first, and a pending invitation is declined rather than left.
/ accounts. v1. Accounts/ LeaveWorkspaceRequest body
application/jsonRequired
Request for the caller to leave a workspace they are an accepted member of. The owner transfers ownership first.
workspaceId?stringOpaque 16-byte identifier of the workspace to leave. It need not be the current workspace.
Format"byte" base64
Response body
application/json
Success
No fields.
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 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 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/LeaveWorkspace" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": "AAECAwQFBgcICQoLDA0ODw=="
}'const res = await fetch("https://api.goldmine.to/accounts.v1.Accounts/LeaveWorkspace", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"workspaceId": "AAECAwQFBgcICQoLDA0ODw=="
}),
});
const data = await res.json();body := strings.NewReader(`{
"workspaceId": "AAECAwQFBgcICQoLDA0ODw=="
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/accounts.v1.Accounts/LeaveWorkspace", 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/LeaveWorkspace",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"workspaceId": "AAECAwQFBgcICQoLDA0ODw=="
},
)
data = res.json(){}{
"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": "not_found",
"message": "The requested resource does not exist in this workspace."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}