{
  "components": {
    "schemas": {
      "Contract": {
        "properties": {
          "created_at": {
            "description": "When it was created.",
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "description": "The contract's description.",
            "type": "string"
          },
          "evaluated_at": {
            "description": "When its targets were last worked out.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The contract's id.",
            "examples": [
              "ctr_0190f3c2a1b47c3d8e9f0a1b2c3d4e5f"
            ],
            "type": "string"
          },
          "limits": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContractLimits"
              }
            ],
            "description": "The limits it trades within. An absent limit is no limit."
          },
          "markets": {
            "description": "The markets it trades on, by key, such as csfloat, dmarket and market-csgo.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "matched_items": {
            "description": "Items its rules matched in its latest evaluation, priced or not.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "name": {
            "description": "The contract's name.",
            "type": "string"
          },
          "prices_good_until": {
            "description": "When the prices behind its current targets stop holding.",
            "format": "date-time",
            "type": "string"
          },
          "problems": {
            "description": "Conditions that need a look, empty when there are none.",
            "items": {
              "enum": [
                "evaluation_failed",
                "holdings_unconfirmed",
                "targets_outdated",
                "unknown",
                "unpriced_items"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "description": "off: saved but not trading. starting: switched on, its first targets being worked out. on: trading.",
            "enum": [
              "off",
              "on",
              "starting",
              "unknown"
            ],
            "type": "string"
          },
          "type": {
            "description": "Whether it buys or sells.",
            "enum": [
              "buying",
              "selling",
              "unknown"
            ],
            "type": "string"
          },
          "unpriced_items": {
            "description": "Of the matched items, those it could not price and so cannot trade.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "updated_at": {
            "description": "When its settings were last changed.",
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "Its settings version. Every saved change adds one.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "status",
          "version",
          "markets",
          "limits",
          "problems",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ContractLimits": {
        "properties": {
          "most_owned_per_item": {
            "description": "The most copies of one item the workspace may hold at once.",
            "format": "int32",
            "type": "integer"
          },
          "purchases": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PurchaseLimit"
              }
            ],
            "description": "The most purchases it may make in a rolling window."
          },
          "spend": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SpendLimit"
              }
            ],
            "description": "The most it may spend in a rolling window."
          }
        },
        "required": [],
        "type": "object"
      },
      "ContractList": {
        "properties": {
          "data": {
            "description": "This page, in the list's order.",
            "items": {
              "$ref": "#/components/schemas/Contract"
            },
            "type": "array"
          },
          "has_more": {
            "description": "True when another page follows.",
            "type": "boolean"
          },
          "next_cursor": {
            "description": "The cursor of the next page. Absent on the last page.",
            "type": "string"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "type": "object"
      },
      "ErrorBody": {
        "properties": {
          "error": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ErrorObject"
              }
            ],
            "description": "What went wrong."
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "ErrorObject": {
        "properties": {
          "code": {
            "description": "The error's code. Codes never change meaning and are never reused.",
            "type": "string"
          },
          "message": {
            "description": "A sentence for a person. It may be reworded; branch on code, not on message.",
            "type": "string"
          },
          "name": {
            "description": "The code's name, for reading.",
            "type": "string"
          },
          "param": {
            "description": "The parameter the error is about, when it is about one.",
            "type": "string"
          },
          "request_id": {
            "description": "The id of this request. Quote it to support.",
            "type": "string"
          },
          "type": {
            "description": "The class of the error. Each type has one HTTP status.",
            "enum": [
              "authentication_error",
              "permission_error",
              "not_found_error",
              "conflict_error",
              "validation_error",
              "rate_limit_error",
              "api_error",
              "unavailable_error"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "code",
          "name",
          "message",
          "request_id"
        ],
        "type": "object"
      },
      "Listing": {
        "properties": {
          "closed_at": {
            "description": "When it closed: sold, taken down or ended.",
            "format": "date-time",
            "type": "string"
          },
          "contract_id": {
            "description": "The selling contract that listed it.",
            "type": "string"
          },
          "created_at": {
            "description": "When it was written, before it was sent.",
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "description": "When the market ends it by itself.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The listing's id.",
            "type": "string"
          },
          "item": {
            "description": "The item's market hash name.",
            "type": "string"
          },
          "market": {
            "description": "The market's key.",
            "type": "string"
          },
          "opened_at": {
            "description": "When the market took it.",
            "format": "date-time",
            "type": "string"
          },
          "phase": {
            "description": "The finish's phase, when the item has one.",
            "type": "string"
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Its price exactly as the market holds it, in the market's currency."
          },
          "price_usd": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Its price in US dollars, to the cent. Absent when no exchange rate was recorded."
          },
          "state": {
            "description": "Where it stands.",
            "enum": [
              "cancelled",
              "checking",
              "ended",
              "filled",
              "not_sent",
              "open",
              "placing",
              "refused",
              "stuck",
              "unknown"
            ],
            "type": "string"
          },
          "steam_account_name": {
            "description": "The Steam account the item is listed from.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "market",
          "state",
          "item",
          "price",
          "created_at"
        ],
        "type": "object"
      },
      "ListingList": {
        "properties": {
          "data": {
            "description": "This page, in the list's order.",
            "items": {
              "$ref": "#/components/schemas/Listing"
            },
            "type": "array"
          },
          "has_more": {
            "description": "True when another page follows.",
            "type": "boolean"
          },
          "next_cursor": {
            "description": "The cursor of the next page. Absent on the last page.",
            "type": "string"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "type": "object"
      },
      "Money": {
        "properties": {
          "amount": {
            "description": "The amount as a decimal string, exact, with at least two decimal places.",
            "examples": [
              "12.34"
            ],
            "type": "string"
          },
          "currency": {
            "description": "The ISO 4217 currency code.",
            "examples": [
              "USD"
            ],
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currency"
        ],
        "type": "object"
      },
      "Order": {
        "properties": {
          "closed_at": {
            "description": "When it closed.",
            "format": "date-time",
            "type": "string"
          },
          "contract_id": {
            "description": "The contract that asked for it.",
            "type": "string"
          },
          "created_at": {
            "description": "When it was written, before it was sent.",
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "description": "When the market ends it by itself.",
            "format": "date-time",
            "type": "string"
          },
          "filled_quantity": {
            "description": "How many have been bought.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "float_max": {
            "description": "The highest float it accepts.",
            "type": "number"
          },
          "float_min": {
            "description": "The lowest float it accepts.",
            "type": "number"
          },
          "id": {
            "description": "The order's id.",
            "type": "string"
          },
          "item": {
            "description": "The item's market hash name.",
            "type": "string"
          },
          "kind": {
            "description": "What it is.",
            "enum": [
              "auction_bid",
              "buy_order",
              "listing_buy",
              "offer",
              "unknown"
            ],
            "type": "string"
          },
          "market": {
            "description": "The market's key, such as csfloat, dmarket or market-csgo.",
            "type": "string"
          },
          "opened_at": {
            "description": "When the market took it.",
            "format": "date-time",
            "type": "string"
          },
          "phase": {
            "description": "The finish's phase, when the item has one.",
            "type": "string"
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Its price exactly as the market holds it, in the market's currency."
          },
          "price_usd": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Its price in US dollars, to the cent. Absent when no exchange rate was recorded."
          },
          "quantity": {
            "description": "How many it asks for.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "state": {
            "description": "Where it stands.",
            "enum": [
              "cancelled",
              "checking",
              "ended",
              "filled",
              "not_sent",
              "open",
              "placing",
              "refused",
              "stuck",
              "unknown"
            ],
            "type": "string"
          },
          "steam_account_name": {
            "description": "The Steam account whose market account it is on.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "market",
          "state",
          "item",
          "price",
          "quantity",
          "filled_quantity",
          "created_at"
        ],
        "type": "object"
      },
      "OrderList": {
        "properties": {
          "data": {
            "description": "This page, in the list's order.",
            "items": {
              "$ref": "#/components/schemas/Order"
            },
            "type": "array"
          },
          "has_more": {
            "description": "True when another page follows.",
            "type": "boolean"
          },
          "next_cursor": {
            "description": "The cursor of the next page. Absent on the last page.",
            "type": "string"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "type": "object"
      },
      "Purchase": {
        "properties": {
          "contract_id": {
            "description": "The contract it was bought for.",
            "type": "string"
          },
          "created_at": {
            "description": "When the purchase was recorded.",
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "description": "When the item arrived in the Steam account.",
            "format": "date-time",
            "type": "string"
          },
          "failed_at": {
            "description": "When it failed.",
            "format": "date-time",
            "type": "string"
          },
          "failure_reason": {
            "description": "Why it failed, when it did.",
            "enum": [
              "account_unavailable",
              "insufficient_balance",
              "listing_unavailable",
              "marketplace_rejected",
              "trade_not_completed",
              "trade_reversed",
              "unknown"
            ],
            "type": "string"
          },
          "float": {
            "description": "The item's float, when known.",
            "type": "number"
          },
          "id": {
            "description": "The purchase's id.",
            "type": "string"
          },
          "item": {
            "description": "The item's market hash name.",
            "type": "string"
          },
          "market": {
            "description": "The market it was bought on.",
            "type": "string"
          },
          "most_it_would_pay": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The most the contract would have paid for it when it was bought."
          },
          "paint_seed": {
            "description": "The item's pattern, 0 to 1000, when known.",
            "format": "int32",
            "type": "integer"
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What was paid, in US dollars, exact."
          },
          "purchased_at": {
            "description": "When the market confirmed the buy.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "pending: bought and on its way. delivered: in the Steam account. failed: not bought, or bought and reversed.",
            "enum": [
              "delivered",
              "failed",
              "pending",
              "unknown"
            ],
            "type": "string"
          },
          "steam_account_name": {
            "description": "The Steam account that bought it.",
            "type": "string"
          },
          "way": {
            "description": "How it was bought.",
            "enum": [
              "auction",
              "buy_order",
              "listing",
              "offer",
              "unknown"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "item",
          "market",
          "way",
          "status",
          "price",
          "most_it_would_pay",
          "created_at"
        ],
        "type": "object"
      },
      "PurchaseLimit": {
        "properties": {
          "count": {
            "description": "The most purchases in the window.",
            "format": "int32",
            "type": "integer"
          },
          "window_seconds": {
            "description": "The length of the rolling window, in seconds.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "window_seconds"
        ],
        "type": "object"
      },
      "PurchaseList": {
        "properties": {
          "data": {
            "description": "This page, in the list's order.",
            "items": {
              "$ref": "#/components/schemas/Purchase"
            },
            "type": "array"
          },
          "has_more": {
            "description": "True when another page follows.",
            "type": "boolean"
          },
          "next_cursor": {
            "description": "The cursor of the next page. Absent on the last page.",
            "type": "string"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "type": "object"
      },
      "Sale": {
        "properties": {
          "buying_contract_id": {
            "description": "The contract that bought the item.",
            "type": "string"
          },
          "cost": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What the item cost, when it was bought here."
          },
          "ended_at": {
            "description": "When it was delivered, failed or lost.",
            "format": "date-time",
            "type": "string"
          },
          "failure_reason": {
            "description": "Why it failed, when it did.",
            "enum": [
              "buyer_did_not_accept",
              "item_not_in_account",
              "market_cancelled",
              "not_sent_in_time",
              "sale_not_as_listed",
              "sold_on_another_market",
              "steam_refused",
              "trade_reversed",
              "unknown"
            ],
            "type": "string"
          },
          "id": {
            "description": "The sale's id.",
            "type": "string"
          },
          "item": {
            "description": "The item's market hash name.",
            "type": "string"
          },
          "list_price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The price it was listed at when it sold."
          },
          "loss_reason": {
            "description": "Why the item was lost, when it was.",
            "enum": [
              "reversed_not_returned",
              "settlement_missing",
              "taken_unpaid",
              "unknown",
              "voided_after_delivery",
              "written_off"
            ],
            "type": "string"
          },
          "market": {
            "description": "The market it sold on.",
            "type": "string"
          },
          "not_bought_here": {
            "description": "True when the item was not bought through this workspace's contracts, so it has no cost and no profit.",
            "type": "boolean"
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What the sale pays, after the market's fee, in US dollars."
          },
          "profit": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The price less the cost once delivered, minus the cost when lost, and zero while pending or failed."
          },
          "selling_contract_id": {
            "description": "The selling contract it sold under.",
            "type": "string"
          },
          "started_at": {
            "description": "When the buyer took the item.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "pending: a buyer took it and the trade is under way. delivered: the buyer accepted and the sale is booked. failed: no money came and the item is still yours. lost: the item left and no money came.",
            "enum": [
              "delivered",
              "failed",
              "lost",
              "pending",
              "unknown"
            ],
            "type": "string"
          },
          "steam_account_name": {
            "description": "The Steam account the item is sent from.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "item",
          "status",
          "price",
          "profit",
          "not_bought_here",
          "started_at"
        ],
        "type": "object"
      },
      "SaleList": {
        "properties": {
          "data": {
            "description": "This page, in the list's order.",
            "items": {
              "$ref": "#/components/schemas/Sale"
            },
            "type": "array"
          },
          "has_more": {
            "description": "True when another page follows.",
            "type": "boolean"
          },
          "next_cursor": {
            "description": "The cursor of the next page. Absent on the last page.",
            "type": "string"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "type": "object"
      },
      "SpendLimit": {
        "properties": {
          "amount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The most it may spend in the window."
          },
          "window_seconds": {
            "description": "The length of the rolling window, in seconds.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "amount",
          "window_seconds"
        ],
        "type": "object"
      },
      "SteamAccount": {
        "properties": {
          "avatar_url": {
            "description": "The Steam profile picture, as last seen.",
            "type": "string"
          },
          "bans": {
            "description": "What the account's Steam bans mean for trading.",
            "enum": [
              "none",
              "stops_trading",
              "unknown",
              "warning"
            ],
            "type": "string"
          },
          "confirmations_enabled": {
            "description": "True when trades and market listings can be confirmed for it, because its mobile authenticator is saved.",
            "type": "boolean"
          },
          "created_at": {
            "description": "When it was added to the workspace.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The account's id: sac_ and its Steam account name.",
            "examples": [
              "sac_trader_bot_01"
            ],
            "type": "string"
          },
          "inventory": {
            "description": "Whether its Steam inventory can be read.",
            "enum": [
              "not_checked",
              "private",
              "readable"
            ],
            "type": "string"
          },
          "inventory_checked_at": {
            "description": "When its inventory was last read.",
            "format": "date-time",
            "type": "string"
          },
          "limited": {
            "description": "True when Steam limits the account, so it cannot use some trading features.",
            "type": "boolean"
          },
          "name": {
            "description": "The Steam account name it signs in with.",
            "type": "string"
          },
          "profile_name": {
            "description": "The Steam profile name, as last seen.",
            "type": "string"
          },
          "signed_in_at": {
            "description": "When its current stretch online began.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "Whether the account is signed in to Steam.",
            "enum": [
              "failed",
              "offline",
              "online",
              "reconnecting",
              "unknown"
            ],
            "type": "string"
          },
          "steam_id": {
            "description": "The 64-bit SteamID. Absent until the account has signed in once.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "bans",
          "limited",
          "inventory",
          "confirmations_enabled"
        ],
        "type": "object"
      },
      "SteamAccountList": {
        "properties": {
          "data": {
            "description": "This page, in the list's order.",
            "items": {
              "$ref": "#/components/schemas/SteamAccount"
            },
            "type": "array"
          },
          "has_more": {
            "description": "True when another page follows.",
            "type": "boolean"
          },
          "next_cursor": {
            "description": "The cursor of the next page. Absent on the last page.",
            "type": "string"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "type": "object"
      },
      "Target": {
        "properties": {
          "created_at": {
            "description": "When this target first appeared in this form.",
            "format": "date-time",
            "type": "string"
          },
          "float_max": {
            "description": "The highest float it accepts. 1 is no upper bound.",
            "type": "number"
          },
          "float_min": {
            "description": "The lowest float it accepts. 0 is no lower bound.",
            "type": "number"
          },
          "id": {
            "description": "The target's id. It stays the same while the target is unchanged across evaluations.",
            "type": "string"
          },
          "item": {
            "description": "The item's market hash name.",
            "examples": [
              "AK-47 | Redline (Field-Tested)"
            ],
            "type": "string"
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The most it pays when buying, or its listing price when selling. Absent when the item could not be priced."
          },
          "sell_only": {
            "description": "True on a selling contract's target listed only because one of the buying contracts it sells for bought the item.",
            "type": "boolean"
          },
          "updated_at": {
            "description": "When it last changed.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "item",
          "float_min",
          "float_max",
          "sell_only",
          "created_at"
        ],
        "type": "object"
      },
      "TargetList": {
        "properties": {
          "data": {
            "description": "This page, in the list's order.",
            "items": {
              "$ref": "#/components/schemas/Target"
            },
            "type": "array"
          },
          "has_more": {
            "description": "True when another page follows.",
            "type": "boolean"
          },
          "next_cursor": {
            "description": "The cursor of the next page. Absent on the last page.",
            "type": "string"
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "description": "An API key of the workspace.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Read your workspace's Steam accounts, contracts, targets, orders, listings, purchases and sales. Send an API key from the website's API keys page as Authorization: Bearer \u003ckey\u003e. Money is a decimal string beside its currency, never a number. Lists are paged with limit and cursor. Clients must ignore fields they do not know: new fields are added within v1.",
    "title": "Public API",
    "version": "1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/contracts": {
      "get": {
        "description": "The workspace's buying and selling contracts, newest first.",
        "operationId": "listContracts",
        "parameters": [
          {
            "description": "How many to return, 1 to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor of the previous page. Send the same other parameters with it.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only contracts of this type.",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "enum": [
                "buying",
                "selling"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only contracts in these states, comma separated.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "description": "A comma separated list of off, on, starting.",
              "type": "string"
            }
          },
          {
            "description": "Only contracts whose name, or an item they match, contains this text.",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractList"
                }
              }
            },
            "description": "The answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error. Its type says the class and its code the exact error."
          }
        },
        "summary": "List contracts",
        "tags": [
          "Contracts"
        ]
      }
    },
    "/v1/contracts/{id}": {
      "get": {
        "description": "One contract by its id.",
        "operationId": "getContract",
        "parameters": [
          {
            "description": "The id from a list answer.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contract"
                }
              }
            },
            "description": "The answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error. Its type says the class and its code the exact error."
          }
        },
        "summary": "Get a contract",
        "tags": [
          "Contracts"
        ]
      }
    },
    "/v1/contracts/{id}/targets": {
      "get": {
        "description": "The items the contract is trading now, by item name, each with the price it trades at, from its latest evaluation. Every page of one walk reads the same evaluation.",
        "operationId": "listTargets",
        "parameters": [
          {
            "description": "The id from a list answer.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many to return, 1 to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor of the previous page. Send the same other parameters with it.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only targets whose item name contains this text, ignoring case.",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetList"
                }
              }
            },
            "description": "The answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error. Its type says the class and its code the exact error."
          }
        },
        "summary": "List a contract's targets",
        "tags": [
          "Contracts"
        ]
      }
    },
    "/v1/listings": {
      "get": {
        "description": "The items the workspace listed for sale on the markets. Open ones by default, newest first.",
        "operationId": "listListings",
        "parameters": [
          {
            "description": "How many to return, 1 to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor of the previous page. Send the same other parameters with it.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "open: everything still open, newest first. closed: what closed in the window closed_from to closed_before, at most 90 days.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "default": "open",
              "enum": [
                "closed",
                "open"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only these markets, by key, comma separated.",
            "in": "query",
            "name": "market",
            "required": false,
            "schema": {
              "description": "A comma separated list.",
              "type": "string"
            }
          },
          {
            "description": "Only those this contract asked for.",
            "in": "query",
            "name": "contract_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only items whose name contains this text, ignoring case.",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With status closed: closed at or after this time. 30 days ago when absent.",
            "in": "query",
            "name": "closed_from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "With status closed: closed before this time. Now when absent.",
            "in": "query",
            "name": "closed_before",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingList"
                }
              }
            },
            "description": "The answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error. Its type says the class and its code the exact error."
          }
        },
        "summary": "List listings",
        "tags": [
          "Markets"
        ]
      }
    },
    "/v1/orders": {
      "get": {
        "description": "What the workspace asked the markets to buy: listing buys, buy orders, offers and auction bids. Open ones by default, newest first.",
        "operationId": "listOrders",
        "parameters": [
          {
            "description": "How many to return, 1 to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor of the previous page. Send the same other parameters with it.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "open: everything still open, newest first. closed: what closed in the window closed_from to closed_before, at most 90 days.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "default": "open",
              "enum": [
                "closed",
                "open"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only these markets, by key, comma separated.",
            "in": "query",
            "name": "market",
            "required": false,
            "schema": {
              "description": "A comma separated list.",
              "type": "string"
            }
          },
          {
            "description": "Only those this contract asked for.",
            "in": "query",
            "name": "contract_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only items whose name contains this text, ignoring case.",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With status closed: closed at or after this time. 30 days ago when absent.",
            "in": "query",
            "name": "closed_from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "With status closed: closed before this time. Now when absent.",
            "in": "query",
            "name": "closed_before",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderList"
                }
              }
            },
            "description": "The answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error. Its type says the class and its code the exact error."
          }
        },
        "summary": "List orders",
        "tags": [
          "Markets"
        ]
      }
    },
    "/v1/purchases": {
      "get": {
        "description": "The items the workspace's contracts bought, newest first.",
        "operationId": "listPurchases",
        "parameters": [
          {
            "description": "How many to return, 1 to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor of the previous page. Send the same other parameters with it.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only purchases for this contract.",
            "in": "query",
            "name": "contract_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only purchases in these states, comma separated.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "description": "A comma separated list of delivered, failed, pending.",
              "type": "string"
            }
          },
          {
            "description": "Only these markets, by key, comma separated.",
            "in": "query",
            "name": "market",
            "required": false,
            "schema": {
              "description": "A comma separated list.",
              "type": "string"
            }
          },
          {
            "description": "Only items whose name contains this text, ignoring case.",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only purchases recorded at or after this time.",
            "in": "query",
            "name": "created_from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Only purchases recorded before this time.",
            "in": "query",
            "name": "created_before",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseList"
                }
              }
            },
            "description": "The answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error. Its type says the class and its code the exact error."
          }
        },
        "summary": "List purchases",
        "tags": [
          "Trading"
        ]
      }
    },
    "/v1/sales": {
      "get": {
        "description": "The workspace's sales and lost items, newest first, with price, cost and profit.",
        "operationId": "listSales",
        "parameters": [
          {
            "description": "How many to return, 1 to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor of the previous page. Send the same other parameters with it.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only sales in these states, comma separated.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "description": "A comma separated list of delivered, failed, lost, pending.",
              "type": "string"
            }
          },
          {
            "description": "Only these markets, by key, comma separated.",
            "in": "query",
            "name": "market",
            "required": false,
            "schema": {
              "description": "A comma separated list.",
              "type": "string"
            }
          },
          {
            "description": "Only sales of items this contract bought.",
            "in": "query",
            "name": "buying_contract_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only items whose name contains this text, ignoring case.",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only sales that ended at or after this time. A pending sale always matches.",
            "in": "query",
            "name": "ended_from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Only sales that ended before this time. A pending sale always matches.",
            "in": "query",
            "name": "ended_before",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SaleList"
                }
              }
            },
            "description": "The answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error. Its type says the class and its code the exact error."
          }
        },
        "summary": "List sales",
        "tags": [
          "Trading"
        ]
      }
    },
    "/v1/steam-accounts": {
      "get": {
        "description": "The workspace's Steam accounts by name, with whether each is online, its bans and whether its inventory can be read.",
        "operationId": "listSteamAccounts",
        "parameters": [
          {
            "description": "How many to return, 1 to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor of the previous page. Send the same other parameters with it.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only accounts whose name contains this text, ignoring case.",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SteamAccountList"
                }
              }
            },
            "description": "The answer."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error. Its type says the class and its code the exact error."
          }
        },
        "summary": "List Steam accounts",
        "tags": [
          "Steam accounts"
        ]
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "servers": [
    {
      "url": "/"
    }
  ],
  "x-error-codes": [
    {
      "code": "E00101",
      "message": "Send your API key as Authorization: Bearer \u003ckey\u003e.",
      "name": "MissingAPIKey",
      "status": 401,
      "type": "authentication_error"
    },
    {
      "code": "E00102",
      "message": "The API key is not valid. It may have been removed or have expired.",
      "name": "InvalidAPIKey",
      "status": 401,
      "type": "authentication_error"
    },
    {
      "code": "E00201",
      "message": "This API key does not allow this request.",
      "name": "PermissionDenied",
      "status": 403,
      "type": "permission_error"
    },
    {
      "code": "E00301",
      "message": "Nothing with this id exists in the workspace.",
      "name": "NotFound",
      "status": 404,
      "type": "not_found_error"
    },
    {
      "code": "E00302",
      "message": "There is no endpoint at this address.",
      "name": "UnknownRoute",
      "status": 404,
      "type": "not_found_error"
    },
    {
      "code": "E00401",
      "message": "The request cannot be answered in the current state.",
      "name": "Conflict",
      "status": 409,
      "type": "conflict_error"
    },
    {
      "code": "E00501",
      "message": "The request has a parameter this endpoint does not take.",
      "name": "UnknownParameter",
      "status": 422,
      "type": "validation_error"
    },
    {
      "code": "E00502",
      "message": "A parameter has a value this endpoint does not accept.",
      "name": "InvalidParameter",
      "status": 422,
      "type": "validation_error"
    },
    {
      "code": "E00503",
      "message": "The cursor is not valid for this request. Send the same parameters as the page it came from, or start again without a cursor.",
      "name": "InvalidCursor",
      "status": 422,
      "type": "validation_error"
    },
    {
      "code": "E00504",
      "message": "The request is not valid.",
      "name": "InvalidRequest",
      "status": 422,
      "type": "validation_error"
    },
    {
      "code": "E00505",
      "message": "A parameter was sent more than once. Send a list as one value separated by commas.",
      "name": "RepeatedParameter",
      "status": 422,
      "type": "validation_error"
    },
    {
      "code": "E00601",
      "message": "This API key has sent too many requests. Wait for the time in Retry-After and send it again.",
      "name": "RateLimited",
      "status": 429,
      "type": "rate_limit_error"
    },
    {
      "code": "E00901",
      "message": "Something went wrong on our side. Send it again; if it keeps failing, contact support with the request id.",
      "name": "Internal",
      "status": 500,
      "type": "api_error"
    },
    {
      "code": "E00902",
      "message": "The service is briefly unavailable. Send it again in a few seconds.",
      "name": "ServiceUnavailable",
      "status": 503,
      "type": "unavailable_error"
    }
  ]
}
