API Reference / API keys
List workspace API keys
Returns the API keys for a workspace. The secret key value is never returned. Only its prefix and metadata are shown.
/ accounts. v1. Accounts/ ListAPIKeysRequest body
application/jsonRequired
Request for one page of the API keys in the caller's workspace. A non-administrator sees only their own keys.
cursor?stringOpaque cursor from a previous ListAPIKeysResponse.next_cursor. Empty for the first page.
descending?booleanTrue orders the page descending. False orders it ascending.
filter?APIKeyFilterOptional narrowing by free text. Absent returns every key the caller can see. Send the same filter with every page.
Show attributes
query?stringFree text matched case-insensitively as a substring of the key's name or of any of its policy names, so "trading" finds a key with the trading policy. Absent or blank applies no search.
limit?integerMaximum number of keys to return, up to 100. Zero uses the default of 100. A larger value is rejected with invalid_argument.
Format"int32"
sortField?stringField to order the page by: creation time, name or last use. Unspecified orders by creation time.
Value in"API_"API_"API_
Response body
application/json
Success
apiKeys?array<APIKey>The API keys on this page, in the requested order.
Show attributes
createdAt?stringWhen the key was created.
Format"date-time"
createdBy?stringOpaque 16-byte identifier of the user who created the key and owns it, base64-encoded in JSON.
Format"byte" base64
expiresAt?stringWhen the key stops authenticating. Requests at or after this time are rejected as unauthenticated. Absent when the key never expires.
Format"date-time"
id?stringOpaque 16-byte identifier of the API key, assigned on creation. Base64-encoded in JSON.
Format"byte" base64
keyPrefix?stringThe first 8 characters of the secret, kept so a key can be recognised in lists. Cannot authenticate on its own.
lastUsedAt?stringWhen the key last authenticated a request. Absent when the key has never been used.
Format"date-time"
name?stringLabel chosen when the key was created, 1 to 256 characters, to tell keys apart.
policies?array<string>Names of the policies granted to the key, at least one, such as "trading" or "steam". ListPolicies lists the valid names and the permissions each grants.
previousKeyExpiresAt?stringWhen the secret this key had before its last rotation stops authenticating. A time in the past means it has stopped. Absent when the key was never rotated with a grace period, or was last rotated with none.
Format"date-time"
revealable?booleanWhether RevealAPIKey can return this key's secret. False for a key created before secrets were stored. Rotate it to make it revealable.
workspaceId?stringOpaque 16-byte identifier of the workspace the key is confined to, base64-encoded in JSON.
Format"byte" base64
nextCursor?stringCursor to pass as cursor to fetch the next page. Empty when this is the last page.
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 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/ListAPIKeys" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://api.goldmine.to/accounts.v1.Accounts/ListAPIKeys", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();body := strings.NewReader(`{}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/accounts.v1.Accounts/ListAPIKeys", 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/ListAPIKeys",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={},
)
data = res.json(){
"apiKeys": [
{
"id": "CgsMDQ4PEBESExQVFhcYGQ==",
"name": "CI deploy key",
"keyPrefix": "gm_live_8f3a",
"workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
"lastUsedAt": "2026-06-28T22:14:00Z",
"expiresAt": "2027-06-29T00:00:00Z",
"createdAt": "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": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}