API Reference / Proxy assignments
Count proxy assignments
Returns the number of proxy assignments in your workspace matching the same filter ListAssignments takes, so a list page can render a count without loading and counting every row.
/ proxies. v1. Proxies/ CountAssignmentsRequest body
application/jsonRequired
Request for the number of proxy assignments in the caller's workspace matching a filter.
filter?AssignmentFilterThe same filter as ListAssignments.
Show attributes
accountName?stringDeprecated: use account_names. One Steam account name to limit results to, matched exactly after trimming. Setting both account_name and account_names is rejected with invalid_argument.
accountNames?array<string>Steam account names to limit results to, at most 100, each matched exactly after trimming. Empty includes assignments across all accounts.
accountSessionStatusesarray<string>Steam session statuses of the assigned account to include, OR within the field. An account whose status is not known yet matches none of them. Empty includes every account. Required.
Value in"SESSION_"SESSION_"SESSION_"SESSION_"SESSION_
countries?array<string>Exit countries of the bound session to include, as upper-case ISO 3166-1 alpha-2 codes, OR within the field. The empty string selects assignments whose country is not known: a pending assignment and a session whose provider reports none. Empty includes every country.
healths?array<string>Health states of the bound session to include. A pending assignment has no session and matches none of them. Empty includes assignments regardless of health.
Value in"SESSION_"SESSION_"SESSION_
pinned?booleanTrue selects only pinned assignments, false only unpinned ones. Unset includes both.
poolId?stringOptional pool id to limit results to a single pool. Unset includes assignments across all pools.
Format"byte" base64
providerIds?array<string>Opaque 16-byte provider identifiers, base64-encoded in JSON, to limit results to assignments whose bound session comes from one of them. Empty includes every provider.
sessionId?stringOptional session id to limit results to assignments bound to a single session. Unset includes assignments across all sessions.
Format"byte" base64
Response body
application/json
Success
count?integerNumber of live assignments matching the filter.
Format"int32"
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 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/CountAssignments" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filter": {
"poolId": "AY+MISIifMyN3T09PT09PQ=="
}
}'const res = await fetch("https://api.goldmine.to/proxies.v1.Proxies/CountAssignments", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"filter": {
"poolId": "AY+MISIifMyN3T09PT09PQ=="
}
}),
});
const data = await res.json();body := strings.NewReader(`{
"filter": {
"poolId": "AY+MISIifMyN3T09PT09PQ=="
}
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/proxies.v1.Proxies/CountAssignments", 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/CountAssignments",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"filter": {
"poolId": "AY+MISIifMyN3T09PT09PQ=="
}
},
)
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."
}