Skip to content

API Reference / API keys

Count workspace API keys

Returns the number of API keys in the workspace. Drives the API keys page's count badge without loading and counting every key.

POST/accounts.v1.Accounts/CountAPIKeys

Request body

application/jsonRequired

Request for the number of API keys the caller can see in their workspace: their own keys, or every key for a platform administrator.

filter?APIKeyFilter

Optional narrowing by free text, the same filter ListAPIKeys takes, so the count always matches the list it badges. Absent counts every key the caller can see.

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.

Response body

application/json

Success

count?integer

Number of API keys visible to the caller in the workspace.

Format"int32"

curl -X POST "https://api.goldmine.to/accounts.v1.Accounts/CountAPIKeys" \
  -H "Authorization: Bearer $CSTRADER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "count": 3
}