API Reference / Proxy pools
Count proxy pools
Returns the number of proxy pools in your workspace, so a list page can render a count without loading and counting every row.
/ proxies. v1. Proxies/ CountPoolsRequest body
application/jsonRequired
Request for the number of proxy pools in the caller's workspace matching a filter.
filter?PoolFilterThe same filter as ListPools.
Show attributes
imported?booleanTrue selects imported pools, which have no provider. False selects only pools with a provider. With provider_types, true adds imported pools to the listed types. Unset includes both.
providerTypes?array<string>Provider types to include, OR within the field. With imported it forms one Type choice: a pool matches when its provider's type is listed or, when imported is true, it is an imported pool. Empty includes every provider type.
Value in"PROVIDER_"PROVIDER_"PROVIDER_"PROVIDER_"PROVIDER_
query?stringLiteral case-insensitive substring of the pool name. Absent or empty matches every pool.
sessionHealths?array<string>Session health states, OR within the field: a pool matches when at least one of its enabled sessions is in one of the listed states, so UNHEALTHY selects pools with some endpoints offline and UNPROBED pools with some still being checked. Empty does not restrict.
Value in"SESSION_"SESSION_"SESSION_
Response body
application/json
Success
count?integerNumber of live pools matching the filter.
Format"int32"
application/json
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 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.
application/json
The service is temporarily unavailable. Retry with backoff.
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/proxies.v1.Proxies/CountPools" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://api.goldmine.to/proxies.v1.Proxies/CountPools", {
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/proxies.v1.Proxies/CountPools", 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/proxies.v1.Proxies/CountPools",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={},
)
data = res.json(){
"count": 2
}{
"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": "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."
}{
"code": "unavailable",
"message": "The service is temporarily unavailable. Retry with backoff."
}