Skip to main content
POST
/
account
/
migration
/
start
Start migration by retiring legacy orders
curl --request POST \
  --url https://api.context.markets/v2/account/migration/start \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "success": true,
  "retiredCount": 123,
  "restorableCount": 123,
  "legacyBalances": [
    {
      "token": "0x1111111111111111111111111111111111111111",
      "balance": "1000000"
    }
  ],
  "newBalances": [
    {
      "token": "0x1111111111111111111111111111111111111111",
      "balance": "1000000"
    }
  ],
  "fundsMigrationPlan": {
    "phase": "<string>",
    "callCount": 123,
    "chunkCount": 123,
    "calls": [
      null
    ],
    "tokens": [
      {
        "token": "0x1111111111111111111111111111111111111111",
        "amount": "1000000"
      }
    ],
    "chunks": [
      {
        "callCount": 123,
        "calls": [
          null
        ],
        "tokens": [
          {
            "token": "0x1111111111111111111111111111111111111111",
            "amount": "1000000"
          }
        ]
      }
    ]
  },
  "pendingRestorations": [
    {
      "id": 123,
      "legacyOrderId": 123,
      "legacyMarketId": "0x1111111111111111111111111111111111111111111111111111111111111111",
      "status": "<string>",
      "draft": {
        "type": "limit",
        "marketId": "0x1111111111111111111111111111111111111111111111111111111111111111",
        "side": 0,
        "price": "1000000",
        "remainingSize": "1000000",
        "outcomeIndex": 123,
        "expiry": "1000000",
        "maxFee": "1000000",
        "makerRoleConstraint": 0,
        "inventoryModeConstraint": 0,
        "reason": "<string>",
        "trader": "0x1111111111111111111111111111111111111111",
        "size": "1000000",
        "nonce": "0xabc123",
        "timeInForce": 0,
        "clientOrderType": "limit"
      }
    }
  ],
  "legacyOpenOrderCount": 123
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Body

application/json
address
string

Optional wallet address override for SDK/API flows. When omitted, the server uses the authenticated API account wallet.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x1111111111111111111111111111111111111111"

authorization
object

Required when address overrides the authenticated API account wallet. The requested wallet must sign the public migration authorization message.

Response

Migration started

success
enum<boolean>
required
Available options:
true
retiredCount
integer
required
restorableCount
integer
required
legacyBalances
object[]
required
newBalances
object[]
required
fundsMigrationPlan
object
required
pendingRestorations
object[]
required
legacyOpenOrderCount
integer
required