{
  "openapi": "3.0.3",
  "info": {
    "title": "9CEX Centralized Exchange API",
    "version": "1.0.0-cex",
    "description": "Mainnet-only custodial CEX. No wallet connection or DEX routes. CEX prices/volume derive from executed internal trades; /v1/global-markets provides separate non-executable CoinGecko reference quotes and charts. Read/trade HMAC keys cannot approve withdrawals. Withdrawal requires user email confirmation followed by admin approval. Some non-browser clients may still encounter hosting Anti-Bot challenges. HMAC: lowercase hex SHA256 HMAC over METHOD + newline + exact path including /platform-api and query + newline + 13-digit timestamp + newline + nonce + newline + SHA256-hex(raw body). Timestamp window 30 seconds; nonce unique. Amounts/prices are decimal strings."
  },
  "servers": [
    {
      "url": "https://9cex.com/platform-api"
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "summary": "health",
        "security": [],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/bootstrap": {
      "get": {
        "summary": "bootstrap",
        "security": [],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/markets": {
      "get": {
        "summary": "markets",
        "security": [],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/assets": {
      "get": {
        "summary": "assets",
        "security": [],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/markets/{id}/book": {
      "get": {
        "summary": "Real internal order book and executions",
        "security": [],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/balances": {
      "get": {
        "summary": "Owned balances",
        "security": [
          {
            "SessionCookie": []
          },
          {
            "ApiKey": [],
            "ApiTimestamp": [],
            "ApiNonce": [],
            "ApiSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/wallets": {
      "get": {
        "summary": "Owned wallets",
        "security": [
          {
            "SessionCookie": []
          },
          {
            "ApiKey": [],
            "ApiTimestamp": [],
            "ApiNonce": [],
            "ApiSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      },
      "post": {
        "summary": "Create wallets",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Wallet"
              }
            }
          }
        }
      }
    },
    "/v1/deposits": {
      "get": {
        "summary": "Owned deposits",
        "security": [
          {
            "SessionCookie": []
          },
          {
            "ApiKey": [],
            "ApiTimestamp": [],
            "ApiNonce": [],
            "ApiSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/withdrawals": {
      "get": {
        "summary": "Owned withdrawals",
        "security": [
          {
            "SessionCookie": []
          },
          {
            "ApiKey": [],
            "ApiTimestamp": [],
            "ApiNonce": [],
            "ApiSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      },
      "post": {
        "summary": "Create withdrawals",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Withdrawal"
              }
            }
          }
        }
      }
    },
    "/v1/orders": {
      "get": {
        "summary": "Owned orders",
        "security": [
          {
            "SessionCookie": []
          },
          {
            "ApiKey": [],
            "ApiTimestamp": [],
            "ApiNonce": [],
            "ApiSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      },
      "post": {
        "summary": "Reserve funds and match limit order",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          },
          {
            "ApiKey": [],
            "ApiTimestamp": [],
            "ApiNonce": [],
            "ApiSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Order"
              }
            }
          }
        }
      }
    },
    "/v1/launches": {
      "get": {
        "summary": "Owned launches",
        "security": [
          {
            "SessionCookie": []
          },
          {
            "ApiKey": [],
            "ApiTimestamp": [],
            "ApiNonce": [],
            "ApiSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      },
      "post": {
        "summary": "Create launches",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Launch"
              }
            }
          }
        }
      }
    },
    "/v1/api-keys": {
      "post": {
        "summary": "Create api-keys",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKey"
              }
            }
          }
        }
      }
    },
    "/v1/orders/{id}": {
      "delete": {
        "summary": "Cancel owned order and release remaining reservation",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          },
          {
            "ApiKey": [],
            "ApiTimestamp": [],
            "ApiNonce": [],
            "ApiSignature": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/withdrawals/{id}/confirm-email": {
      "post": {
        "summary": "Confirm exact withdrawal using user email code",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailConfirmation"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/withdrawals/{id}/resend": {
      "post": {
        "summary": "Resend withdrawal email",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/withdrawals/{id}": {
      "delete": {
        "summary": "Cancel before approval/signing",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/overview": {
      "get": {
        "summary": "Owner console overview",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/admin/users": {
      "get": {
        "summary": "Owner console users",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/admin/launches": {
      "get": {
        "summary": "Owner console launches",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        }
      }
    },
    "/v1/admin/networks": {
      "post": {
        "summary": "Admin networks",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NetworkPolicy"
              }
            }
          }
        }
      }
    },
    "/v1/admin/assets": {
      "post": {
        "summary": "Admin assets",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetRegistration"
              }
            }
          }
        }
      }
    },
    "/v1/admin/markets": {
      "post": {
        "summary": "Admin markets",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pair"
              }
            }
          }
        }
      }
    },
    "/v1/admin/treasury": {
      "post": {
        "summary": "Admin treasury",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Treasury"
              }
            }
          }
        }
      }
    },
    "/v1/admin/assets/{id}": {
      "post": {
        "summary": "Admin asset deposit/withdraw/trading policy",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetPolicy"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/markets/{id}": {
      "post": {
        "summary": "Admin activate/pause pair",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PairState"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/users/{id}": {
      "post": {
        "summary": "Admin freeze/unfreeze user",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserState"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/withdrawals/{id}/approve": {
      "post": {
        "summary": "Admin approve withdrawals",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminDecision"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/withdrawals/{id}/reject": {
      "post": {
        "summary": "Admin reject withdrawals",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminDecision"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/launches/{id}/approve": {
      "post": {
        "summary": "Admin approve launches",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminDecision"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/launches/{id}/reject": {
      "post": {
        "summary": "Admin reject launches",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminDecision"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/wallets/{id}/request-export": {
      "post": {
        "summary": "Request owner-only key export; fresh TOTP and reason, followed by email",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminDecision"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/admin/key-exports/{id}/confirm": {
      "post": {
        "summary": "Consume owner email challenge once; private key response is no-store",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailConfirmation"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/auth/email/request": {
      "post": {
        "summary": "auth/email/request",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailLogin"
              }
            }
          }
        }
      }
    },
    "/v1/auth/email/verify": {
      "post": {
        "summary": "auth/email/verify",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailVerify"
              }
            }
          }
        }
      }
    },
    "/v1/auth/google": {
      "post": {
        "summary": "auth/google",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Google"
              }
            }
          }
        }
      }
    },
    "/v1/security/google/link": {
      "post": {
        "summary": "security/google/link",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Google"
              }
            }
          }
        }
      }
    },
    "/v1/security/totp/verify": {
      "post": {
        "summary": "security/totp/verify",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailConfirmation"
              }
            }
          }
        }
      }
    },
    "/v1/security/totp/confirm": {
      "post": {
        "summary": "security/totp/confirm",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^[0-9]{6}$"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout": {
      "post": {
        "summary": "auth/logout",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/security/totp/enroll": {
      "post": {
        "summary": "security/totp/enroll",
        "security": [
          {
            "SessionCookie": [],
            "CSRF": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: success, data, requestId"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Login/MFA/email code required"
          },
          "403": {
            "description": "Ownership/scope/admin denied"
          },
          "409": {
            "description": "Invalid state or duplicate intent"
          },
          "422": {
            "description": "Insufficient balance or precision"
          },
          "503": {
            "description": "Network or asset disabled/unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/global-markets": {
      "get": {
        "summary": "Top 50 global market-cap reference pairs; not executable 9CEX markets",
        "responses": {
          "200": {
            "description": "Provider snapshot, timestamps, staleness and reference-only pairs"
          }
        }
      }
    },
    "/v1/global-markets/{coinId}/book": {
      "get": {
        "summary": "Reference quote and provider seven-day USD sparkline, with empty 9CEX book/trades",
        "parameters": [
          {
            "name": "coinId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reference-only view; order placement unavailable"
          },
          "404": {
            "description": "Unknown or hidden coin"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "SessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-9cex_session"
      },
      "CSRF": {
        "type": "apiKey",
        "in": "header",
        "name": "X-CSRF-Token"
      },
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "ApiTimestamp": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Timestamp"
      },
      "ApiNonce": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Nonce"
      },
      "ApiSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Signature"
      }
    },
    "schemas": {
      "Order": {
        "type": "object",
        "properties": {
          "marketId": {
            "type": "string",
            "format": "uuid"
          },
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "LIMIT"
            ]
          },
          "side": {
            "type": "string",
            "enum": [
              "BUY",
              "SELL"
            ]
          },
          "price": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$"
          },
          "amount": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$"
          }
        },
        "required": [
          "marketId",
          "intentId",
          "side",
          "price",
          "amount"
        ]
      },
      "Wallet": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "enum": [
              "ethereum",
              "base",
              "bsc"
            ]
          },
          "label": {
            "type": "string",
            "maxLength": 60
          }
        },
        "required": [
          "network",
          "label"
        ]
      },
      "Withdrawal": {
        "type": "object",
        "properties": {
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "assetId": {
            "type": "string",
            "format": "uuid"
          },
          "destination": {
            "type": "string"
          },
          "amount": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "intentId",
          "assetId",
          "destination",
          "amount"
        ]
      },
      "EmailConfirmation": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^\\d{8}$"
          }
        },
        "required": [
          "code"
        ]
      },
      "AdminDecision": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          },
          "reason": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "code"
        ]
      },
      "NetworkPolicy": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "enum": [
              "ethereum",
              "base",
              "bsc"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "PAUSED"
            ]
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "network",
          "state",
          "code"
        ]
      },
      "AssetRegistration": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "enum": [
              "ethereum",
              "base",
              "bsc"
            ]
          },
          "contract": {
            "type": "string",
            "description": "native or exact mainnet token contract address"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "network",
          "contract",
          "code"
        ]
      },
      "AssetPolicy": {
        "type": "object",
        "properties": {
          "depositEnabled": {
            "type": "boolean"
          },
          "withdrawEnabled": {
            "type": "boolean"
          },
          "tradingEnabled": {
            "type": "boolean"
          },
          "withdrawFee": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "code"
        ]
      },
      "Pair": {
        "type": "object",
        "properties": {
          "baseAsset": {
            "type": "string",
            "format": "uuid"
          },
          "quoteAsset": {
            "type": "string",
            "format": "uuid"
          },
          "tick": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$"
          },
          "lot": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$"
          },
          "feeBps": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "baseAsset",
          "quoteAsset",
          "tick",
          "lot",
          "code"
        ]
      },
      "PairState": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "PAUSED"
            ]
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "state",
          "code"
        ]
      },
      "Launch": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "enum": [
              "ethereum",
              "base",
              "bsc"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 64
          },
          "symbol": {
            "type": "string",
            "maxLength": 12
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18
          },
          "supply": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$"
          }
        },
        "required": [
          "network",
          "name",
          "symbol",
          "decimals",
          "supply"
        ]
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 60
          },
          "scope": {
            "type": "string",
            "enum": [
              "read",
              "trade"
            ]
          }
        },
        "required": [
          "label"
        ]
      },
      "Treasury": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "enum": [
              "ethereum",
              "base",
              "bsc"
            ]
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "network",
          "code"
        ]
      },
      "UserState": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "FROZEN"
            ]
          },
          "reason": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "state",
          "reason",
          "code"
        ]
      },
      "EmailLogin": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          }
        },
        "required": [
          "email"
        ]
      },
      "EmailVerify": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          }
        },
        "required": [
          "challengeId",
          "code"
        ]
      },
      "Google": {
        "type": "object",
        "properties": {
          "credential": {
            "type": "string"
          }
        },
        "required": [
          "credential"
        ]
      }
    }
  }
}
