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`.
Request
POST /api/v1/sessions/{accountKey}/actions/sortStash
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
sortOrder (sort_order) | string | no | How to order the result, e.g. `type,rarity,gearscore`. Defaults to the standard order. |
inventoryId (inventory_id) | integer | no | Page to sort; defaults to the main stash. |
extraInventories (extra_inventories) | integer[] | no | Pages the planner may use as scratch space. |
autoExtras (auto_extras) | boolean | no | Use every other owned page as scratch space. |
dry_run | boolean | no | Report the plan without moving anything. |
premium | boolean | no | Accepted for backwards compatibility and ignored. |
Example request
{ "inventoryId": 4, "sortOrder": "type,rarity,gearscore", "dry_run": true }
Response
`{ plan, sent, dryRun, inventoryId, extraInventories }`.
| Field | Type | Meaning |
|---|---|---|
plan[] | object[] | Every move, in order: the item, where it comes from, where it lands, and its footprint. |
plan[].parking | boolean | True for a move to a temporary slot — a repack needs somewhere to put an item mid-shuffle. |
sent | integer | How 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
| Code | When |
|---|---|
action_failed | No 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_limit | Not 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.