sortStash

Repack a stash page, optionally spilling into other pages.

Plans the whole repack first, then sends it move by move. Run it with `dry_run` to see the plan without touching anything — the reply is the same shape either way, with `sent: 0`. A page that cannot be repacked in place can borrow room from `extraInventories`, or from every other owned page with `autoExtras`.

In Inventory & stash.

Request

POST /api/v1/sessions/{accountKey}/actions/sortStash

Parameters

NameTypeRequiredDescription
sortOrder (sort_order)stringnoHow to order the result, e.g. `type,rarity,gearscore`. Defaults to the standard order.
inventoryId (inventory_id)integernoPage to sort; defaults to the main stash.
extraInventories (extra_inventories)integer[]noPages the planner may use as scratch space.
autoExtras (auto_extras)booleannoUse every other owned page as scratch space.
dry_runbooleannoReport the plan without moving anything.
premiumbooleannoAccepted for backwards compatibility and ignored.

Example request

{ "inventoryId": 4, "sortOrder": "type,rarity,gearscore", "dry_run": true }

Response

`{ plan, sent, dryRun, inventoryId, extraInventories }`.

FieldTypeMeaning
plan[]object[]Every move, in order: the item, where it comes from, where it lands, and its footprint.
plan[].parkingbooleanTrue for a move to a temporary slot — a repack needs somewhere to put an item mid-shuffle.
sentintegerHow many moves were actually sent. Always 0 under `dry_run`.

Example response

{
  "plan": [
    { "phase": "pack", "op": "move", "uid": "630211546215118851",
      "shortName": "AdventurerBoots", "from": 41, "to": 0,
      "fromInv": 4, "toInv": 4, "final": 0, "w": 2, "h": 2,
      "parking": false, "crossInventory": false }
  ],
  "sent": 0,
  "dryRun": true,
  "inventoryId": 4,
  "extraInventories": []
}

Errors

CodeWhen
action_failedNo character is in the lobby, the id is not a storage, or a move was refused mid-plan — `sent` says how far it got.
plan_limitNot on the free plan.

See also

DarkerAPI is an independent project. It is not affiliated with, endorsed by or associated with IRONMACE Co., Ltd. or Valve Corporation. “Dark and Darker” and related marks belong to their respective owners.