Skip to content

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.

POST/accounts.v1.Accounts/ListAPIKeys

Request 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?string

Opaque cursor from a previous ListAPIKeysResponse.next_cursor. Empty for the first page.

descending?boolean

True orders the page descending. False orders it ascending.

filter?APIKeyFilter

Optional narrowing by free text. Absent returns every key the caller can see. Send the same filter with every page.

Show attributes
query?string

Free 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?integer

Maximum 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?string

Field to order the page by: creation time, name or last use. Unspecified orders by creation time.

Value in"API_KEY_SORT_FIELD_CREATED_AT""API_KEY_SORT_FIELD_NAME""API_KEY_SORT_FIELD_LAST_USED_AT"

Response body

application/json

Success

apiKeys?array<APIKey>

The API keys on this page, in the requested order.

Show attributes
createdAt?string

When the key was created.

Format"date-time"

createdBy?string

Opaque 16-byte identifier of the user who created the key and owns it, base64-encoded in JSON.

Format"byte" base64

expiresAt?string

When the key stops authenticating. Requests at or after this time are rejected as unauthenticated. Absent when the key never expires.

Format"date-time"

id?string

Opaque 16-byte identifier of the API key, assigned on creation. Base64-encoded in JSON.

Format"byte" base64

keyPrefix?string

The first 8 characters of the secret, kept so a key can be recognised in lists. Cannot authenticate on its own.

lastUsedAt?string

When the key last authenticated a request. Absent when the key has never been used.

Format"date-time"

name?string

Label 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?string

When 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?boolean

Whether RevealAPIKey can return this key's secret. False for a key created before secrets were stored. Rotate it to make it revealable.

workspaceId?string

Opaque 16-byte identifier of the workspace the key is confined to, base64-encoded in JSON.

Format"byte" base64

nextCursor?string

Cursor to pass as cursor to fetch the next page. Empty when this is the last page.

curl -X POST "https://api.goldmine.to/accounts.v1.Accounts/ListAPIKeys" \
  -H "Authorization: Bearer $CSTRADER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "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"
      ]
    }
  ]
}