API Reference / Filter sets
List the contracts and filter sets that use filter sets
Returns every live contract and filter set in the workspace whose predicate references any of the requested filter sets, so an editor can show who uses a saved filter and a delete can name what it would break. At most 100 filter sets per call.
/ contracts. v1. Contracts/ GetFilterSetReferrersRequest body
application/jsonRequired
Request for every live contract and filter set referencing each of several filter sets in the caller's workspace, in one call.
filterSetIds?array<string>Opaque 16-byte identifiers of the filter sets whose referrers to list, each base64-encoded in JSON. At most 100. More is rejected with invalid_argument.
Response body
application/json
Success
referrers?array<FilterSetReferrer>Every live referrer of every requested filter set, ordered by the request's filter set order, then contracts before filter sets, then name. A requested filter set with no referrers, or that does not exist in the workspace, contributes no rows.
Show attributes
filterSetId?stringThe referenced filter set, one of the request's filter_set_ids.
Format"byte" base64
kind?stringWhether the referrer is a contract or another filter set.
Value in"FILTER_"FILTER_
name?stringCurrent name of the referring contract or filter set.
referrerId?stringIdentifier of the referring contract or filter set, base64-encoded in JSON.
Format"byte" base64
status?stringLifecycle status of a referring contract. Unset when the referrer is a filter set, which has no lifecycle status.
Value in"CONTRACT_"CONTRACT_"CONTRACT_
application/json
The request was malformed, such as a missing required field or an unparseable cursor.
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.
curl -X POST "https://api.goldmine.to/contracts.v1.Contracts/GetFilterSetReferrers" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filterSetIds": [
"EBESExQVFhcYGRobHB0eHw=="
]
}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/GetFilterSetReferrers", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"filterSetIds": [
"EBESExQVFhcYGRobHB0eHw=="
]
}),
});
const data = await res.json();body := strings.NewReader(`{
"filterSetIds": [
"EBESExQVFhcYGRobHB0eHw=="
]
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/GetFilterSetReferrers", 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/contracts.v1.Contracts/GetFilterSetReferrers",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"filterSetIds": [
"EBESExQVFhcYGRobHB0eHw=="
]
},
)
data = res.json(){
"referrers": [
{
"filterSetId": "EBESExQVFhcYGRobHB0eHw==",
"kind": "FILTER_SET_REFERRER_KIND_CONTRACT",
"referrerId": "ICEiIyQlJicoKSorLC0uLw==",
"name": "AK-47 under $50",
"status": "CONTRACT_STATUS_ACTIVE"
}
]
}{
"code": "invalid_argument",
"message": "The request was malformed, such as a missing required field or an unparseable cursor."
}{
"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."
}