API Reference / Filter sets
Create a filter set
Creates a named, reusable predicate fragment in the workspace that contracts can reference by ID.
/ contracts. v1. Contracts/ CreateFilterSetRequest body
application/jsonRequired
Request to create a named, reusable piece of predicate that contracts and other filter sets can reference.
description?stringFree-text description. May be empty.
namestringFilter set name. Required.
predicatePredicateThe predicate the filter set stands for. Required. May reference other filter sets in the workspace.
Show attributes
filterSet?FilterSetReferenceThis node is a reference to a named, reusable filter set, expanded into its fragment before evaluation.
Show attributes
filterSetId?stringIdentifier of the referenced filter set. Must belong to the same workspace as the contract. The contracts worker expands it into its predicate fragment before evaluation.
Format"byte" base64
group?PredicateGroupThis node is a group: an AND/OR combination of child predicate nodes.
Show attributes
condition?stringLogical combinator applied to rules: AND or OR.
Value in"PREDICATE_"PREDICATE_
rules?array<Predicate>Child predicate nodes combined by condition. Must be non-empty.
rule?PredicateRuleThis node is a leaf rule: a single subject-operator-value condition.
Show attributes
field?stringThis rule's subject is an item attribute, resolved against the items catalog.
Value in"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_
marketData?MarketDataFieldThis rule's subject is a (source, metric) market-observation value.
Show attributes
freshnessFreshnessMaximum age of the observation this rule reads. Required, exactly one positive unit: an observation older than now minus freshness is treated as unavailable and the rule does not match.
Show attributes
maximumAge?stringThe oldest market data to use. Must be positive.
metric?stringName of the market-observation metric to resolve, for example a source's 7-day sales volume.
source?stringMarket-data source the metric is resolved against.
operator?stringComparison operator applied to the subject's resolved value. Which operators are legal depends on the subject: field allows the full attribute operator set (narrowed to gte/gt for min_wear and lte/lt for max_wear), market_data allows only eq, neq, gt, gte, lt, lte and between (with a number_range_value, both ends inclusive), and value_field allows only gt, gte, lt, lte. The list operators in, not_in, contains_any and contains_none take a string_list_value. Contains_any and contains_none apply only to the text fields market_hash_name, weapon, paint and collection, and item_age_days also takes between.
Value in"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_
value?PredicateValueRight-hand side value the subject is compared against.
Show attributes
boolValue?booleanBoolean value, used when the subject's comparison is against a boolean item attribute such as has_stat_trak or has_souvenir.
decimalValue?stringExact decimal number as text, used for a float (wear) bound on min_wear or max_wear: digits, a point and up to 16 decimal places, with no sign and no exponent, from 0 to 1. Kept and returned exactly as given, so 0.2734 reads back as 0.2734 and 0.27340 as 0.27340. A float bound given as number_value is read as the shortest decimal that number prints as, and every float bound is returned as decimal_value.
numberRangeValue?NumberRangeNumber range, used with the between operator on a market-data or item_age_days rule: the rule matches when the value is at least minimum and at most maximum.
Show attributes
maximum?numberThe highest value inside the range, included. Must be at least minimum.
Format"double"
minimum?numberThe lowest value inside the range, included.
Format"double"
numberValue?numberNumeric value, used when the subject's comparison is against a number: a market-data bound, a computed-price bound, or a numeric item attribute.
Format"double"
stringListValue?StringListList of string values, used with the in, not_in, contains_any and contains_none operators.
Show attributes
values?array<string>The wrapped list of string values.
stringValue?stringString value, used when the subject's comparison is against text.
valueField?stringThis rule's subject is the valuation's combined computed price for the item.
Value in"PREDICATE_
Response body
application/json
Success
filterSet?FilterSetThe new filter set with its assigned identifier.
Show attributes
createdAt?stringWhen the filter set was created.
Format"date-time"
deletedAt?stringWhen the filter set was soft-deleted, if it has been.
Format"date-time"
description?stringFree-form filter set description.
id?stringOpaque 16-byte filter set identifier, base64-encoded in JSON.
Format"byte" base64
matchCount?stringDistinct catalog items the filter currently matches, computed when the list is read. Set on ListFilterSets only. Unset when the count could not be read.
Format"int64"
name?stringHuman-readable filter set name.
predicate?PredicateThe reusable predicate fragment this filter set expands into.
Show attributes
filterSet?FilterSetReferenceThis node is a reference to a named, reusable filter set, expanded into its fragment before evaluation.
Show attributes
filterSetId?stringIdentifier of the referenced filter set. Must belong to the same workspace as the contract. The contracts worker expands it into its predicate fragment before evaluation.
Format"byte" base64
group?PredicateGroupThis node is a group: an AND/OR combination of child predicate nodes.
Show attributes
condition?stringLogical combinator applied to rules: AND or OR.
Value in"PREDICATE_"PREDICATE_
rules?array<Predicate>Child predicate nodes combined by condition. Must be non-empty.
rule?PredicateRuleThis node is a leaf rule: a single subject-operator-value condition.
Show attributes
field?stringThis rule's subject is an item attribute, resolved against the items catalog.
Value in"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_
marketData?MarketDataFieldThis rule's subject is a (source, metric) market-observation value.
Show attributes
freshnessFreshnessMaximum age of the observation this rule reads. Required, exactly one positive unit: an observation older than now minus freshness is treated as unavailable and the rule does not match.
Show attributes
maximumAge?stringThe oldest market data to use. Must be positive.
metric?stringName of the market-observation metric to resolve, for example a source's 7-day sales volume.
source?stringMarket-data source the metric is resolved against.
operator?stringComparison operator applied to the subject's resolved value. Which operators are legal depends on the subject: field allows the full attribute operator set (narrowed to gte/gt for min_wear and lte/lt for max_wear), market_data allows only eq, neq, gt, gte, lt, lte and between (with a number_range_value, both ends inclusive), and value_field allows only gt, gte, lt, lte. The list operators in, not_in, contains_any and contains_none take a string_list_value. Contains_any and contains_none apply only to the text fields market_hash_name, weapon, paint and collection, and item_age_days also takes between.
Value in"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_"PREDICATE_
value?PredicateValueRight-hand side value the subject is compared against.
Show attributes
boolValue?booleanBoolean value, used when the subject's comparison is against a boolean item attribute such as has_stat_trak or has_souvenir.
decimalValue?stringExact decimal number as text, used for a float (wear) bound on min_wear or max_wear: digits, a point and up to 16 decimal places, with no sign and no exponent, from 0 to 1. Kept and returned exactly as given, so 0.2734 reads back as 0.2734 and 0.27340 as 0.27340. A float bound given as number_value is read as the shortest decimal that number prints as, and every float bound is returned as decimal_value.
numberRangeValue?NumberRangeNumber range, used with the between operator on a market-data or item_age_days rule: the rule matches when the value is at least minimum and at most maximum.
Show attributes
maximum?numberThe highest value inside the range, included. Must be at least minimum.
Format"double"
minimum?numberThe lowest value inside the range, included.
Format"double"
numberValue?numberNumeric value, used when the subject's comparison is against a number: a market-data bound, a computed-price bound, or a numeric item attribute.
Format"double"
stringListValue?StringListList of string values, used with the in, not_in, contains_any and contains_none operators.
Show attributes
values?array<string>The wrapped list of string values.
stringValue?stringString value, used when the subject's comparison is against text.
valueField?stringThis rule's subject is the valuation's combined computed price for the item.
Value in"PREDICATE_
updatedAt?stringWhen the filter set was last modified.
Format"date-time"
version?stringOptimistic concurrency version. Incremented on every update.
Format"int64"
workspaceId?stringWorkspace the filter set belongs to.
Format"byte" base64
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/CreateFilterSet" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Asiimov watchlist",
"description": "Curated list of Asiimov market hash names tracked across selling contracts.",
"predicate": {
"rule": {
"field": "PREDICATE_FIELD_MARKET_HASH_NAME",
"operator": "PREDICATE_OPERATOR_IN",
"value": {
"stringListValue": {
"values": [
"AWP | Asiimov (Field-Tested)",
"AWP | Asiimov (Well-Worn)",
"M4A4 | Asiimov (Field-Tested)"
]
}
}
}
}
}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/CreateFilterSet", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Asiimov watchlist",
"description": "Curated list of Asiimov market hash names tracked across selling contracts.",
"predicate": {
"rule": {
"field": "PREDICATE_FIELD_MARKET_HASH_NAME",
"operator": "PREDICATE_OPERATOR_IN",
"value": {
"stringListValue": {
"values": [
"AWP | Asiimov (Field-Tested)",
"AWP | Asiimov (Well-Worn)",
"M4A4 | Asiimov (Field-Tested)"
]
}
}
}
}
}),
});
const data = await res.json();body := strings.NewReader(`{
"name": "Asiimov watchlist",
"description": "Curated list of Asiimov market hash names tracked across selling contracts.",
"predicate": {
"rule": {
"field": "PREDICATE_FIELD_MARKET_HASH_NAME",
"operator": "PREDICATE_OPERATOR_IN",
"value": {
"stringListValue": {
"values": [
"AWP | Asiimov (Field-Tested)",
"AWP | Asiimov (Well-Worn)",
"M4A4 | Asiimov (Field-Tested)"
]
}
}
}
}
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/CreateFilterSet", 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/CreateFilterSet",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"name": "Asiimov watchlist",
"description": "Curated list of Asiimov market hash names tracked across selling contracts.",
"predicate": {
"rule": {
"field": "PREDICATE_FIELD_MARKET_HASH_NAME",
"operator": "PREDICATE_OPERATOR_IN",
"value": {
"stringListValue": {
"values": [
"AWP | Asiimov (Field-Tested)",
"AWP | Asiimov (Well-Worn)",
"M4A4 | Asiimov (Field-Tested)"
]
}
}
}
}
},
)
data = res.json(){
"filterSet": {
"id": "ICEiIyQlJicoKSorLC0uLw==",
"workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
"name": "Asiimov watchlist",
"description": "Curated list of Asiimov market hash names tracked across selling contracts.",
"predicate": {
"rule": {
"field": "PREDICATE_FIELD_MARKET_HASH_NAME",
"operator": "PREDICATE_OPERATOR_IN",
"value": {
"stringListValue": {
"values": [
"AWP | Asiimov (Field-Tested)",
"AWP | Asiimov (Well-Worn)",
"M4A4 | Asiimov (Field-Tested)"
]
}
}
}
},
"version": "1",
"createdAt": "2026-06-29T10:00:00Z",
"updatedAt": "2026-06-29T10:00:00Z"
}
}{
"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."
}