Skip to content

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.

POST/contracts.v1.Contracts/GetFilterSetReferrers

Request 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?string

The referenced filter set, one of the request's filter_set_ids.

Format"byte" base64

kind?string

Whether the referrer is a contract or another filter set.

Value in"FILTER_SET_REFERRER_KIND_CONTRACT""FILTER_SET_REFERRER_KIND_FILTER_SET"

name?string

Current name of the referring contract or filter set.

referrerId?string

Identifier of the referring contract or filter set, base64-encoded in JSON.

Format"byte" base64

status?string

Lifecycle status of a referring contract. Unset when the referrer is a filter set, which has no lifecycle status.

Value in"CONTRACT_STATUS_DRAFT""CONTRACT_STATUS_BUILDING""CONTRACT_STATUS_ACTIVE"

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=="
    ]
  }'
{
  "referrers": [
    {
      "filterSetId": "EBESExQVFhcYGRobHB0eHw==",
      "kind": "FILTER_SET_REFERRER_KIND_CONTRACT",
      "referrerId": "ICEiIyQlJicoKSorLC0uLw==",
      "name": "AK-47 under $50",
      "status": "CONTRACT_STATUS_ACTIVE"
    }
  ]
}