API Reference / Contracts
Update a contract
Applies partial edits to a contract, such as renaming it, changing its valuation or strategies, or activating and pausing it. Only the supplied fields are changed.
/ contracts. v1. Contracts/ UpdateContractRequest body
application/jsonRequired
Request to edit a contract, activate it or pause it. Fields left out are unchanged.
accountGroupId?stringLegacy field: nonempty sets the executing account group. Omitted or empty preserves it. New callers use patch.account_group_id for nullable updates.
Format"byte" base64
contractId?stringOpaque 16-byte identifier of the contract to edit, base64-encoded in JSON.
Format"byte" base64
description?stringNew description. Absent keeps the current description.
expectedVersion?stringOptional caller edit version. The server compares it against the locked current contract before applying any fields. A mismatch returns a conflict without mutation. Omission preserves existing client behaviour. This version is independent of worker snapshot and status changes.
Format"int64"
limits?ContractLimitsOmitted preserves the stored limits. A present empty message clears all limits.
Show attributes
maxOwnedAtLimit?stringWhat happens to the contract's resting orders, offers and bids for an item when the workspace holds max_owned_per_item of it. Unspecified cancels them.
Value in"LIMIT_"LIMIT_
maxOwnedPerItem?integerMaximum copies of one item the whole workspace may hold at once, across all of its contracts. Absent means no limit.
Format"int32"
purchaseWindow?PurchaseWindowLimit on this contract's own number of purchases in a rolling window. Absent means no limit.
Show attributes
atLimit?stringWhat happens to the contract's resting orders, offers and bids when this limit is reached. Unspecified cancels them.
Value in"LIMIT_"LIMIT_
count?integerMaximum number of purchases within the window. Must be greater than zero.
Format"int32"
length?stringLength of the rolling window. Must be positive.
overcommitFactor?numberHow many times the remaining purchases may rest in open orders on one market while there is room: 1 never rests more than is left. From 1 to 100. Absent uses the market's default.
Format"double"
spendWindow?SpendWindowLimit on this contract's own spend in a rolling window. Absent means no limit.
Show attributes
amountCents?stringMaximum spend within the window, in US cents. Must be greater than zero.
Format"int64"
atLimit?stringWhat happens to the contract's resting orders, offers and bids when this limit is reached. Unspecified cancels them.
Value in"LIMIT_"LIMIT_
length?stringLength of the rolling window. Must be positive.
overcommitFactor?numberHow many times the remaining spend may rest in open orders on one market while there is room: 1 never rests more than is left. From 1 to 100. Absent uses the market's default.
Format"double"
watchlist?WatchlistConfigWhether and how far above its price the contract watches listings it cannot buy yet, for price drops. Absent means no watching.
Show attributes
ceilingPct?numberHow far above the contract's maximum buy price, in percent, a listing can be and still be watched: 5 watches listings up to 5 percent over. Must be zero or more.
Format"double"
enabled?booleanTrue watches near-miss listings. False watches none.
name?stringNew name. Surrounding whitespace is trimmed and an empty name is rejected. Absent keeps the current name.
patch?ContractPatchChanges to the account group and limits that can also clear them. A field supplied both here and in the older top-level fields is rejected.
Show attributes
accountGroupId?objectOmitted leaves the executing group unchanged. JSON null removes it. A UUID string sets it. Cannot be supplied together with the legacy account_group_id field.
limits?objectOmitted leaves limits unchanged. JSON null clears all limits. A ContractLimits JSON object replaces them. Cannot be supplied together with the legacy limits field.
predicate?PredicateNew predicate, replacing the current one. Absent keeps the current predicate.
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_
selectedMarketplaces?ContractMarketplacesNew market selection, replacing the current one. Absent keeps the current selection. An empty list goes back to every market the workspace buys on, or for a selling contract with listing_sell every market the workspace sells on. On a buying contract each market must be one contracts can buy on, and on a selling contract with listing_sell one it can list on (csfloat, dmarket, market-csgo), or the request is rejected with invalid_argument. Any other selling contract must leave it empty.
Show attributes
marketplaces?array<string>Market keys, such as "csfloat". Empty means every market the workspace buys on.
status?stringMoves the contract between lifecycle states: draft pauses it from any state, and building activates a draft. Other values are rejected. The contract becomes active on its own after its first evaluation. Absent keeps the current status.
Value in"CONTRACT_"CONTRACT_"CONTRACT_
strategies?ContractStrategiesNew strategy list, replacing the current one. Absent keeps the current list. An empty list removes every strategy, which a live contract must be paused for.
Show attributes
strategies?array<ContractStrategy>The complete new list of strategies, replacing the current list. Empty removes every strategy.
Show attributes
csfloatAuction?CSFloatAuctionStrategyBuy by bidding on CSFloat auctions.
Show attributes
bidBeforeExpiry?stringHow long before an auction ends to place the bid. Absent uses the default.
maxConcurrentBids?integerAccepted and not read: how many auctions a workspace bids in at once is a limit staff set on the workspace.
Format"int32"
csfloatBuyOrder?CSFloatBuyOrderStrategyBuy by placing buy orders on CSFloat.
Show attributes
maxOrders?integerMaximum number of buy orders open at once. Absent uses the workspace default.
Format"int32"
maxPriceCents?stringMaximum price of one buy order, in US cents. Absent uses the workspace default.
Format"int64"
csfloatOffer?CSFloatOfferStrategyBuy by making offers on CSFloat listings.
Show attributes
expiry?stringHow long an offer stays open before it expires. Absent uses the workspace default.
maxDiscountPct?numberLargest discount below the listing price to offer, in percent. Absent uses the workspace default.
Format"double"
minPriceCents?stringLowest listing price to make offers on, in US cents. Absent uses the workspace default.
Format"int64"
csfloatScraping?CSFloatScrapingStrategyBuy matching CSFloat listings found by scanning the marketplace.
Show attributes
maxConcurrent?integerMaximum number of scan requests in flight at once. Absent uses the default.
Format"int32"
scrapeInterval?stringTime between scans. Absent uses the default.
csfloatSell?CSFloatSellStrategySell by listing held items on CSFloat.
Show attributes
priceSource?stringMarket source the listing price is based on, such as "buff163" or "steam". Absent uses the default.
undercutPct?numberHow far below the lowest competing CSFloat listing to list, in percent. Absent uses the workspace default.
Format"double"
dmarketListing?DMarketListingStrategyBuy matching DMarket listings found by searching the marketplace.
listingSell?ListingSellStrategySell by listing held items on the markets the selling contract names in selected_marketplaces, or on every market the workspace sells on when it names none.
Show attributes
ceilingPct?numberTop of the price range, in percent above the valuation price: 20 allows listing up to 20 percent above it. Must be zero or more. Absent uses the workspace default.
Format"double"
undercutPct?numberHow far below the cheapest competing listing to list, in percent. Must be at least zero and below 100. Absent lists one price step below it.
Format"double"
marketCsgoListing?MarketCSGOListingStrategyBuy matching Market.CSGO listings found by searching the marketplace.
offerHandling?OfferHandlingStrategySell-side handling of offers buyers make on listed items.
Show attributes
autoDecline?booleanTrue declines offers automatically. Checked before the accept threshold. Absent uses the workspace default.
minOfferAcceptPct?numberOffers at or above this percent of the listing price are accepted automatically. Zero or less turns automatic acceptance off. Absent uses the workspace default.
Format"double"
saleAccept?SaleAcceptStrategySell-side delay before a sale is accepted.
Show attributes
delay?stringHow long to wait before accepting a sale. Zero or absent accepts immediately.
type?stringMust equal the contract's current type, since the type cannot change. A different value is rejected with invalid_argument. Absent is the usual choice.
Value in"CONTRACT_"CONTRACT_
valuation?ValuationNew valuation, replacing the current one. Absent keeps the current valuation.
Show attributes
references?array<ValuationReference>The price sources to combine, each a market data lookup or a sale computation.
Show attributes
adjustment?numberFraction applied to the resolved price, which is multiplied by one plus this value: -0.3 pays 30 percent under, 0.1 pays 10 percent over. From -1 to 10.
Format"double"
aggregationAggregationHow the selected sales combine into one price. Required for a sale computation and not allowed on a market data lookup.
Show attributes
average?AverageOptionsOptions for an average. Only used when type is average.
Show attributes
weighted?booleanTrue weights each sale by its quantity. False averages sale prices equally.
type?stringThe combining function: average, median, minimum, maximum, mode or percentile. Percentile needs the reference's percentile field.
Value in"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_
freshnessFreshnessMaximum age of the observation a market-data lookup reads. Required for a market-data lookup (metric set). Rejected for a sale computation (window/aggregation set).
Show attributes
maximumAge?stringThe oldest market data to use. Must be positive.
lag?LagShifts an hours or days window into the past. Sale computation only. Absent prices on the latest sales.
Show attributes
shift?stringHow far to shift the window back from now. Only valid with a time window.
metric?stringMetric to read, such as "listing-price", which makes this a market data lookup. Absent for a sale computation.
outlier?OutlierDrops sales far from the typical price before combining them. Sale computation only. Absent keeps every sale.
Show attributes
sigma?numberSales more than this many standard deviations from the mean are dropped, such as 2.0.
Format"double"
percentileintegerPercentile to take, from 0 to 100. Required with the percentile aggregation and not allowed otherwise.
Format"int32"
source?stringMarket source to price from, such as "market-csgo".
truncatePercentage?booleanFor a market-data lookup, preserve the raw fractional USD cents until calculating trunc((100 + adjustment * 100) * (raw / 100)). False retains the ordinary nearest-cent rounding. True is rejected for sale computations.
window?WindowWhich recent sales to read, which together with aggregation makes this a sale computation. Absent for a market data lookup.
Show attributes
count?integerRead the most recent this many sales, whenever they happened. Cannot be combined with lag.
Format"int32"
length?stringRead sales from this long before now. Lag can shift the window into the past.
strategy?stringHow the references combine into one price. MIN is required for a buying contract and MAX for a selling contract. AVG is valid for either. Pairing the wrong extreme with a contract type risks overpaying (MAX on a buying contract) or underpricing (MIN on a selling contract).
Value in"VALUATION_"VALUATION_"VALUATION_
Response body
application/json
Success
contract?ContractThe contract with the update applied.
Show attributes
accountGroupId?stringOpaque 16-byte identifier of the account group whose Steam accounts carry out the contract, base64-encoded in JSON. Empty when no group is assigned.
Format"byte" base64
createdAt?stringWhen the contract was created.
Format"date-time"
createdBy?stringActor who created the contract. Unset when the actor carried no originating user.
Format"byte" base64
deletedAt?stringWhen the contract was deleted. Absent while it is live. Deleted contracts are not returned by reads.
Format"date-time"
description?stringFree-form contract description.
evaluatedAt?stringWhen the latest successful evaluation completed, including projection and rollup. Unset when no successful completion was recorded. An unchanged successful evaluation advances this time. A failed evaluation does not. This is independent of the configuration edit timestamp and snapshot creation time.
Format"date-time"
evaluatedConfigVersion?stringCaptured contract configuration version used by the latest successful evaluation. Preserved when a later configuration edit changes version. Unset when unknown. An explicit zero is a known version.
Format"int64"
evaluatedInputGeneration?stringOpaque completed-market-feed fingerprint used by the latest successful evaluation, including a successful empty or unchanged result. Unset when provenance is unknown. This is independent of the current snapshot's original generation and does not certify independently mutable catalog, primitive observations, sales, or exchange rates.
evaluatedMatchedCount?integerCatalog items the latest successful evaluation's rules matched, priced or not. Unset when no successful evaluation recorded it.
Format"int32"
evaluatedUnpricedCount?integerOf evaluated_matched_count, the items the valuation could not price, so the contract cannot buy or sell them. Unset when no successful evaluation recorded it.
Format"int32"
evaluationFailedAt?stringWhen the latest evaluation since the last success failed. Unset when no evaluation has failed since the last success: a successful evaluation clears it.
Format"date-time"
evaluationFailureReason?stringWhy the latest evaluation since the last success failed. Unspecified when evaluation_failed_at is unset. The customer-facing sentence is the client's copy for each value.
Value in"CONTRACT_"CONTRACT_"CONTRACT_"CONTRACT_"CONTRACT_
id?stringOpaque 16-byte contract identifier, base64-encoded in JSON.
Format"byte" base64
limits?ContractLimitsOwnership and spend limits and the watchlist setting. Absent means no limits.
Show attributes
maxOwnedAtLimit?stringWhat happens to the contract's resting orders, offers and bids for an item when the workspace holds max_owned_per_item of it. Unspecified cancels them.
Value in"LIMIT_"LIMIT_
maxOwnedPerItem?integerMaximum copies of one item the whole workspace may hold at once, across all of its contracts. Absent means no limit.
Format"int32"
purchaseWindow?PurchaseWindowLimit on this contract's own number of purchases in a rolling window. Absent means no limit.
Show attributes
atLimit?stringWhat happens to the contract's resting orders, offers and bids when this limit is reached. Unspecified cancels them.
Value in"LIMIT_"LIMIT_
count?integerMaximum number of purchases within the window. Must be greater than zero.
Format"int32"
length?stringLength of the rolling window. Must be positive.
overcommitFactor?numberHow many times the remaining purchases may rest in open orders on one market while there is room: 1 never rests more than is left. From 1 to 100. Absent uses the market's default.
Format"double"
spendWindow?SpendWindowLimit on this contract's own spend in a rolling window. Absent means no limit.
Show attributes
amountCents?stringMaximum spend within the window, in US cents. Must be greater than zero.
Format"int64"
atLimit?stringWhat happens to the contract's resting orders, offers and bids when this limit is reached. Unspecified cancels them.
Value in"LIMIT_"LIMIT_
length?stringLength of the rolling window. Must be positive.
overcommitFactor?numberHow many times the remaining spend may rest in open orders on one market while there is room: 1 never rests more than is left. From 1 to 100. Absent uses the market's default.
Format"double"
watchlist?WatchlistConfigWhether and how far above its price the contract watches listings it cannot buy yet, for price drops. Absent means no watching.
Show attributes
ceilingPct?numberHow far above the contract's maximum buy price, in percent, a listing can be and still be watched: 5 watches listings up to 5 percent over. Must be zero or more.
Format"double"
enabled?booleanTrue watches near-miss listings. False watches none.
name?stringHuman-readable contract name.
predicate?PredicateWhich items the contract buys or sells. May reference filter sets.
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_
problems?array<string>Health conditions the contract is in at read time, derived by the server in enum order from this row and the workspace's ownership coverage. Empty when the contract is healthy. The same derivation serves ContractFilter.problems, so a filtered list and the badge on each row never disagree.
Value in"CONTRACT_"CONTRACT_"CONTRACT_"CONTRACT_
selectedMarketplaces?array<string>The markets the contract buys or sells on, by market key such as "csfloat", "dmarket" or "market-csgo", in key order. On a buying contract, empty means every market the workspace buys on, including one it turns on later: the contract buys listings on each of them and also uses every other strategy it carries. A selection buys only on the markets it names, through the strategies the contract carries there. A contract never buys on a market where the workspace has buying off. On a selling contract with listing_sell, it is where the contract lists: empty means every market the workspace sells on, a selection only the markets it names. Always empty on any other selling contract.
snapshot?stringSnapshot sequence number used to bind evaluation runs to a contract state.
Format"int64"
status?stringContract lifecycle state.
Value in"CONTRACT_"CONTRACT_"CONTRACT_
strategies?array<ContractStrategy>The marketplace strategies the contract buys or sells with. Each must match the contract's type.
Show attributes
csfloatAuction?CSFloatAuctionStrategyBuy by bidding on CSFloat auctions.
Show attributes
bidBeforeExpiry?stringHow long before an auction ends to place the bid. Absent uses the default.
maxConcurrentBids?integerAccepted and not read: how many auctions a workspace bids in at once is a limit staff set on the workspace.
Format"int32"
csfloatBuyOrder?CSFloatBuyOrderStrategyBuy by placing buy orders on CSFloat.
Show attributes
maxOrders?integerMaximum number of buy orders open at once. Absent uses the workspace default.
Format"int32"
maxPriceCents?stringMaximum price of one buy order, in US cents. Absent uses the workspace default.
Format"int64"
csfloatOffer?CSFloatOfferStrategyBuy by making offers on CSFloat listings.
Show attributes
expiry?stringHow long an offer stays open before it expires. Absent uses the workspace default.
maxDiscountPct?numberLargest discount below the listing price to offer, in percent. Absent uses the workspace default.
Format"double"
minPriceCents?stringLowest listing price to make offers on, in US cents. Absent uses the workspace default.
Format"int64"
csfloatScraping?CSFloatScrapingStrategyBuy matching CSFloat listings found by scanning the marketplace.
Show attributes
maxConcurrent?integerMaximum number of scan requests in flight at once. Absent uses the default.
Format"int32"
scrapeInterval?stringTime between scans. Absent uses the default.
csfloatSell?CSFloatSellStrategySell by listing held items on CSFloat.
Show attributes
priceSource?stringMarket source the listing price is based on, such as "buff163" or "steam". Absent uses the default.
undercutPct?numberHow far below the lowest competing CSFloat listing to list, in percent. Absent uses the workspace default.
Format"double"
dmarketListing?DMarketListingStrategyBuy matching DMarket listings found by searching the marketplace.
listingSell?ListingSellStrategySell by listing held items on the markets the selling contract names in selected_marketplaces, or on every market the workspace sells on when it names none.
Show attributes
ceilingPct?numberTop of the price range, in percent above the valuation price: 20 allows listing up to 20 percent above it. Must be zero or more. Absent uses the workspace default.
Format"double"
undercutPct?numberHow far below the cheapest competing listing to list, in percent. Must be at least zero and below 100. Absent lists one price step below it.
Format"double"
marketCsgoListing?MarketCSGOListingStrategyBuy matching Market.CSGO listings found by searching the marketplace.
offerHandling?OfferHandlingStrategySell-side handling of offers buyers make on listed items.
Show attributes
autoDecline?booleanTrue declines offers automatically. Checked before the accept threshold. Absent uses the workspace default.
minOfferAcceptPct?numberOffers at or above this percent of the listing price are accepted automatically. Zero or less turns automatic acceptance off. Absent uses the workspace default.
Format"double"
saleAccept?SaleAcceptStrategySell-side delay before a sale is accepted.
Show attributes
delay?stringHow long to wait before accepting a sale. Zero or absent accepts immediately.
type?stringWhether the contract buys or sells. Chosen when the contract is created and cannot change.
Value in"CONTRACT_"CONTRACT_
updatedAt?stringWhen the user last edited contract configuration. System evaluation and lifecycle changes do not advance this timestamp.
Format"date-time"
updatedBy?stringActor who last updated the contract. Unset when the actor carried no originating user.
Format"byte" base64
valuation?ValuationHow the contract prices each matched item: the most it pays when buying, or its listing price when selling. Absent only on a draft. A contract cannot be activated without one.
Show attributes
references?array<ValuationReference>The price sources to combine, each a market data lookup or a sale computation.
Show attributes
adjustment?numberFraction applied to the resolved price, which is multiplied by one plus this value: -0.3 pays 30 percent under, 0.1 pays 10 percent over. From -1 to 10.
Format"double"
aggregationAggregationHow the selected sales combine into one price. Required for a sale computation and not allowed on a market data lookup.
Show attributes
average?AverageOptionsOptions for an average. Only used when type is average.
Show attributes
weighted?booleanTrue weights each sale by its quantity. False averages sale prices equally.
type?stringThe combining function: average, median, minimum, maximum, mode or percentile. Percentile needs the reference's percentile field.
Value in"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_
freshnessFreshnessMaximum age of the observation a market-data lookup reads. Required for a market-data lookup (metric set). Rejected for a sale computation (window/aggregation set).
Show attributes
maximumAge?stringThe oldest market data to use. Must be positive.
lag?LagShifts an hours or days window into the past. Sale computation only. Absent prices on the latest sales.
Show attributes
shift?stringHow far to shift the window back from now. Only valid with a time window.
metric?stringMetric to read, such as "listing-price", which makes this a market data lookup. Absent for a sale computation.
outlier?OutlierDrops sales far from the typical price before combining them. Sale computation only. Absent keeps every sale.
Show attributes
sigma?numberSales more than this many standard deviations from the mean are dropped, such as 2.0.
Format"double"
percentileintegerPercentile to take, from 0 to 100. Required with the percentile aggregation and not allowed otherwise.
Format"int32"
source?stringMarket source to price from, such as "market-csgo".
truncatePercentage?booleanFor a market-data lookup, preserve the raw fractional USD cents until calculating trunc((100 + adjustment * 100) * (raw / 100)). False retains the ordinary nearest-cent rounding. True is rejected for sale computations.
window?WindowWhich recent sales to read, which together with aggregation makes this a sale computation. Absent for a market data lookup.
Show attributes
count?integerRead the most recent this many sales, whenever they happened. Cannot be combined with lag.
Format"int32"
length?stringRead sales from this long before now. Lag can shift the window into the past.
strategy?stringHow the references combine into one price. MIN is required for a buying contract and MAX for a selling contract. AVG is valid for either. Pairing the wrong extreme with a contract type risks overpaying (MAX on a buying contract) or underpricing (MIN on a selling contract).
Value in"VALUATION_"VALUATION_"VALUATION_
version?stringThe contract's settings version shown to users, such as Version 12, and the optimistic concurrency token for edits. Every user edit increments it. System evaluation snapshot and status changes do not.
Format"int64"
workspaceId?stringWorkspace the contract 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 requested resource does not exist in 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/UpdateContract" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contractId": "EBESExQVFhcYGRobHB0eHw==",
"name": "AK-47 under $45",
"valuation": {
"references": [
{
"source": "buff163",
"metric": "sell_min"
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/UpdateContract", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"contractId": "EBESExQVFhcYGRobHB0eHw==",
"name": "AK-47 under $45",
"valuation": {
"references": [
{
"source": "buff163",
"metric": "sell_min"
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
}),
});
const data = await res.json();body := strings.NewReader(`{
"contractId": "EBESExQVFhcYGRobHB0eHw==",
"name": "AK-47 under $45",
"valuation": {
"references": [
{
"source": "buff163",
"metric": "sell_min"
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/UpdateContract", 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/UpdateContract",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"contractId": "EBESExQVFhcYGRobHB0eHw==",
"name": "AK-47 under $45",
"valuation": {
"references": [
{
"source": "buff163",
"metric": "sell_min"
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
},
)
data = res.json(){
"contract": {
"id": "EBESExQVFhcYGRobHB0eHw==",
"workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
"name": "AK-47 under $45",
"description": "Buy any AK-47 skin priced below $50 on CSFloat.",
"status": "CONTRACT_STATUS_ACTIVE",
"type": "CONTRACT_TYPE_BUYING",
"createdAt": "2026-02-10T09:00:00Z",
"updatedAt": "2026-06-29T11:00:00Z",
"version": "4",
"snapshot": "7",
"valuation": {
"references": [
{
"source": "buff163",
"metric": "sell_min"
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
}
}{
"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": "not_found",
"message": "The requested resource does not exist in this workspace."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}