API Reference / Proxy assignments
Count proxy assignments per filter option
Returns, for each requested facet field (pool, provider, health, pinned), how many assignments carry each value under the same AssignmentFilter as ListAssignments, with the field's own filter left out. Drives the assignments filter flyout.
/ proxies. v1. Proxies/ GetAssignmentFacetCountsRequest body
application/jsonRequired
Request for the per value counts of up to 8 assignment facet fields under the same filter as ListAssignments, so a filter flyout shows how many assignments each option would select.
fields?array<string>The facet fields to count, at most 8.
Value in"ASSIGNMENT_"ASSIGNMENT_"ASSIGNMENT_"ASSIGNMENT_"ASSIGNMENT_"ASSIGNMENT_
filter?AssignmentFilterThe same filter as ListAssignments. Each facet is counted with every other field applied but not its own, so choosing one pool still shows the counts of the other pools.
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
facets?array<AssignmentFacetCounts>One entry per requested field, in request order.
Show attributes
counts?FacetFieldCountsThe values ordered by count descending then value, at most 50, with truncated set when more exist.
Show attributes
truncated?booleanTrue when the field has more than 50 values, so the list shows only the 50 most common.
values?array<FacetValueCount>The values and their counts, ordered by count descending then by value, at most 50.
Show attributes
count?stringNumber of rows carrying the value under the facet's predicate. Returned as a JSON string to preserve integer precision.
Format"int64"
value?stringThe value as the list rows carry it: an enum name, a base64 id or an account name, so a client maps it to a label exactly as it maps a row.
field?stringThe facet field these counts are for.
Value in"ASSIGNMENT_"ASSIGNMENT_"ASSIGNMENT_"ASSIGNMENT_"ASSIGNMENT_"ASSIGNMENT_
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/GetAssignmentFacetCounts" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fields": [
"ASSIGNMENT_FACET_FIELD_HEALTH",
"ASSIGNMENT_FACET_FIELD_PINNED"
]
}'const res = await fetch("https://api.goldmine.to/proxies.v1.Proxies/GetAssignmentFacetCounts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"fields": [
"ASSIGNMENT_FACET_FIELD_HEALTH",
"ASSIGNMENT_FACET_FIELD_PINNED"
]
}),
});
const data = await res.json();body := strings.NewReader(`{
"fields": [
"ASSIGNMENT_FACET_FIELD_HEALTH",
"ASSIGNMENT_FACET_FIELD_PINNED"
]
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/proxies.v1.Proxies/GetAssignmentFacetCounts", 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/GetAssignmentFacetCounts",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"fields": [
"ASSIGNMENT_FACET_FIELD_HEALTH",
"ASSIGNMENT_FACET_FIELD_PINNED"
]
},
)
data = res.json(){
"facets": [
{
"field": "ASSIGNMENT_FACET_FIELD_HEALTH",
"counts": {
"values": [
{
"value": "SESSION_HEALTH_STATE_HEALTHY",
"count": "9"
}
],
"truncated": false
}
},
{
"field": "ASSIGNMENT_FACET_FIELD_PINNED",
"counts": {
"values": [
{
"value": "false",
"count": "8"
},
{
"value": "true",
"count": "1"
}
],
"truncated": false
}
}
]
}{
"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."
}