Skip to content

API Reference / Filter sets

Update a filter set

Applies partial edits to a filter set, such as renaming it or replacing its predicate fragment. Only the supplied fields are changed.

POST/contracts.v1.Contracts/UpdateFilterSet

Request body

application/jsonRequired

Request to rename a filter set or replace its predicate. Fields left out are unchanged. Rejected with failed_precondition while a contract or another filter set references it.

description?string

New description. Absent keeps the current description.

expectedVersion?string

Optional caller edit version. A mismatch returns a conflict without mutation or retry. Omission preserves existing client behaviour.

Format"int64"

filterSetId?string

Opaque 16-byte identifier of the filter set to edit, base64-encoded in JSON.

Format"byte" base64

name?string

New name, which must not be empty. Absent keeps the current name.

predicate?Predicate

New predicate, replacing the current one. Absent keeps the current predicate.

Show attributes
filterSet?FilterSetReference

This node is a reference to a named, reusable filter set, expanded into its fragment before evaluation.

Show attributes
filterSetId?string

Identifier 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?PredicateGroup

This node is a group: an AND/OR combination of child predicate nodes.

Show attributes
condition?string

Logical combinator applied to rules: AND or OR.

Value in"PREDICATE_CONDITION_AND""PREDICATE_CONDITION_OR"

rules?array<Predicate>

Child predicate nodes combined by condition. Must be non-empty.

rule?PredicateRule

This node is a leaf rule: a single subject-operator-value condition.

Show attributes
field?string

This rule's subject is an item attribute, resolved against the items catalog.

Value in"PREDICATE_FIELD_MARKET_HASH_NAME""PREDICATE_FIELD_CATEGORY""PREDICATE_FIELD_WEAPON""PREDICATE_FIELD_PAINT""PREDICATE_FIELD_RARITY""PREDICATE_FIELD_COLLECTION""PREDICATE_FIELD_MIN_WEAR""PREDICATE_FIELD_MAX_WEAR""PREDICATE_FIELD_HAS_STAT_TRAK""PREDICATE_FIELD_HAS_SOUVENIR""PREDICATE_FIELD_ITEM_AGE_DAYS""PREDICATE_FIELD_WEAPON_TYPE"

marketData?MarketDataField

This rule's subject is a (source, metric) market-observation value.

Show attributes
freshnessFreshness

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

The oldest market data to use. Must be positive.

metric?string

Name of the market-observation metric to resolve, for example a source's 7-day sales volume.

source?string

Market-data source the metric is resolved against.

operator?string

Comparison 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_OPERATOR_EQ""PREDICATE_OPERATOR_NEQ""PREDICATE_OPERATOR_IN""PREDICATE_OPERATOR_NOT_IN""PREDICATE_OPERATOR_GT""PREDICATE_OPERATOR_GTE""PREDICATE_OPERATOR_LT""PREDICATE_OPERATOR_LTE""PREDICATE_OPERATOR_CONTAINS""PREDICATE_OPERATOR_NOT_CONTAINS""PREDICATE_OPERATOR_BETWEEN""PREDICATE_OPERATOR_CONTAINS_ANY""PREDICATE_OPERATOR_CONTAINS_NONE"

value?PredicateValue

Right-hand side value the subject is compared against.

Show attributes
boolValue?boolean

Boolean value, used when the subject's comparison is against a boolean item attribute such as has_stat_trak or has_souvenir.

decimalValue?string

Exact 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?NumberRange

Number 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?number

The highest value inside the range, included. Must be at least minimum.

Format"double"

minimum?number

The lowest value inside the range, included.

Format"double"

numberValue?number

Numeric 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?StringList

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

String value, used when the subject's comparison is against text.

valueField?string

This rule's subject is the valuation's combined computed price for the item.

Value in"PREDICATE_VALUE_FIELD_COMPUTED_PRICE"

Response body

application/json

Success

filterSet?FilterSet

The filter set with the update applied.

Show attributes
createdAt?string

When the filter set was created.

Format"date-time"

deletedAt?string

When the filter set was soft-deleted, if it has been.

Format"date-time"

description?string

Free-form filter set description.

id?string

Opaque 16-byte filter set identifier, base64-encoded in JSON.

Format"byte" base64

matchCount?string

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

Human-readable filter set name.

predicate?Predicate

The reusable predicate fragment this filter set expands into.

Show attributes
filterSet?FilterSetReference

This node is a reference to a named, reusable filter set, expanded into its fragment before evaluation.

Show attributes
filterSetId?string

Identifier 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?PredicateGroup

This node is a group: an AND/OR combination of child predicate nodes.

Show attributes
condition?string

Logical combinator applied to rules: AND or OR.

Value in"PREDICATE_CONDITION_AND""PREDICATE_CONDITION_OR"

rules?array<Predicate>

Child predicate nodes combined by condition. Must be non-empty.

rule?PredicateRule

This node is a leaf rule: a single subject-operator-value condition.

Show attributes
field?string

This rule's subject is an item attribute, resolved against the items catalog.

Value in"PREDICATE_FIELD_MARKET_HASH_NAME""PREDICATE_FIELD_CATEGORY""PREDICATE_FIELD_WEAPON""PREDICATE_FIELD_PAINT""PREDICATE_FIELD_RARITY""PREDICATE_FIELD_COLLECTION""PREDICATE_FIELD_MIN_WEAR""PREDICATE_FIELD_MAX_WEAR""PREDICATE_FIELD_HAS_STAT_TRAK""PREDICATE_FIELD_HAS_SOUVENIR""PREDICATE_FIELD_ITEM_AGE_DAYS""PREDICATE_FIELD_WEAPON_TYPE"

marketData?MarketDataField

This rule's subject is a (source, metric) market-observation value.

Show attributes
freshnessFreshness

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

The oldest market data to use. Must be positive.

metric?string

Name of the market-observation metric to resolve, for example a source's 7-day sales volume.

source?string

Market-data source the metric is resolved against.

operator?string

Comparison 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_OPERATOR_EQ""PREDICATE_OPERATOR_NEQ""PREDICATE_OPERATOR_IN""PREDICATE_OPERATOR_NOT_IN""PREDICATE_OPERATOR_GT""PREDICATE_OPERATOR_GTE""PREDICATE_OPERATOR_LT""PREDICATE_OPERATOR_LTE""PREDICATE_OPERATOR_CONTAINS""PREDICATE_OPERATOR_NOT_CONTAINS""PREDICATE_OPERATOR_BETWEEN""PREDICATE_OPERATOR_CONTAINS_ANY""PREDICATE_OPERATOR_CONTAINS_NONE"

value?PredicateValue

Right-hand side value the subject is compared against.

Show attributes
boolValue?boolean

Boolean value, used when the subject's comparison is against a boolean item attribute such as has_stat_trak or has_souvenir.

decimalValue?string

Exact 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?NumberRange

Number 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?number

The highest value inside the range, included. Must be at least minimum.

Format"double"

minimum?number

The lowest value inside the range, included.

Format"double"

numberValue?number

Numeric 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?StringList

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

String value, used when the subject's comparison is against text.

valueField?string

This rule's subject is the valuation's combined computed price for the item.

Value in"PREDICATE_VALUE_FIELD_COMPUTED_PRICE"

updatedAt?string

When the filter set was last modified.

Format"date-time"

version?string

Optimistic concurrency version. Incremented on every update.

Format"int64"

workspaceId?string

Workspace the filter set belongs to.

Format"byte" base64

curl -X POST "https://api.goldmine.to/contracts.v1.Contracts/UpdateFilterSet" \
  -H "Authorization: Bearer $CSTRADER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filterSetId": "EBESExQVFhcYGRobHB0eHw==",
    "name": "StatTrak AK-47 Redline, Minimal Wear or better",
    "predicate": {
      "group": {
        "condition": "PREDICATE_CONDITION_AND",
        "rules": [
          {
            "rule": {
              "field": "PREDICATE_FIELD_WEAPON",
              "operator": "PREDICATE_OPERATOR_EQ",
              "value": {
                "stringValue": "AK-47"
              }
            }
          },
          {
            "rule": {
              "field": "PREDICATE_FIELD_PAINT",
              "operator": "PREDICATE_OPERATOR_EQ",
              "value": {
                "stringValue": "Redline"
              }
            }
          },
          {
            "rule": {
              "field": "PREDICATE_FIELD_HAS_STAT_TRAK",
              "operator": "PREDICATE_OPERATOR_EQ",
              "value": {
                "boolValue": true
              }
            }
          },
          {
            "rule": {
              "field": "PREDICATE_FIELD_MAX_WEAR",
              "operator": "PREDICATE_OPERATOR_LTE",
              "value": {
                "numberValue": 0.15
              }
            }
          }
        ]
      }
    }
  }'
{
  "filterSet": {
    "id": "EBESExQVFhcYGRobHB0eHw==",
    "workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
    "name": "StatTrak AK-47 Redline, Minimal Wear or better",
    "description": "Reusable fragment matching StatTrak AK-47 Redline skins with a float of 0.27 or lower.",
    "predicate": {
      "group": {
        "condition": "PREDICATE_CONDITION_AND",
        "rules": [
          {
            "rule": {
              "field": "PREDICATE_FIELD_WEAPON",
              "operator": "PREDICATE_OPERATOR_EQ",
              "value": {
                "stringValue": "AK-47"
              }
            }
          },
          {
            "rule": {
              "field": "PREDICATE_FIELD_PAINT",
              "operator": "PREDICATE_OPERATOR_EQ",
              "value": {
                "stringValue": "Redline"
              }
            }
          },
          {
            "rule": {
              "field": "PREDICATE_FIELD_HAS_STAT_TRAK",
              "operator": "PREDICATE_OPERATOR_EQ",
              "value": {
                "boolValue": true
              }
            }
          },
          {
            "rule": {
              "field": "PREDICATE_FIELD_MAX_WEAR",
              "operator": "PREDICATE_OPERATOR_LTE",
              "value": {
                "numberValue": 0.15
              }
            }
          }
        ]
      }
    },
    "version": "3",
    "createdAt": "2026-03-05T14:30:00Z",
    "updatedAt": "2026-06-29T11:00:00Z"
  }
}