> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://okx-demo.ferndocs.com/api/api-reference/sub-account/get-list/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://okx-demo.ferndocs.com/_mcp/server. # Get sub-account list GET https://www.okx.com/api/v5/users/subaccount/list Retrieve the list of sub-accounts belonging to the master account, along with their status and metadata. Applies only to master accounts. Reference: https://okx-demo.ferndocs.com/api/api-reference/sub-account/get-list ## Authentication - `OK-ACCESS-KEY` header (required) — Your API key. - `OK-ACCESS-SIGN` header (required) — Base64-encoded HMAC-SHA256 signature of the prehash string. - `OK-ACCESS-TIMESTAMP` header (required) — ISO 8601 UTC timestamp, e.g. 2020-12-08T09:08:57.715Z. - `OK-ACCESS-PASSPHRASE` header (required) — The passphrase you set when creating the API key. ## Request ### Query parameters - `enable` (string, optional) — Sub-account status. true: Normal; false: Frozen. - `subAcct` (string, optional) — Sub-account name. - `after` (string, optional) — Query sub-accounts created before this timestamp (Unix timestamp in milliseconds), e.g. 1597026383085. - `before` (string, optional) — Query sub-accounts created after this timestamp (Unix timestamp in milliseconds), e.g. 1597026383085. - `limit` (string, optional) — Number of results per request. The maximum is 100 and the default is 100. ## Response ### 200 Successful response - `code` (string, optional) — Result code. `0` means success; any other value is an error code. - `msg` (string, optional) — Error message. Empty on success. - `data` (list of ApiV5UsersSubaccountListGetResponsesContentApplicationJsonSchemaDataItems, optional) ## Types ### ApiV5UsersSubaccountListGetResponsesContentApplicationJsonSchemaDataItems - `enable` (boolean, optional) — Sub-account status. true: Normal; false: Frozen. - `subAcct` (string, optional) — Sub-account name. - `type` (string, optional) — Sub-account type. 1: Standard sub-account; 2: Managed trading sub-account; 5: Custody trading sub-account (Copper); 9: Custody trading sub-account (Komainu); 12: Custody trading sub-account (Cactus). - `label` (string, optional) — Sub-account note. - `mobile` (string, optional) — Mobile number that linked with the sub-account. - `gAuth` (boolean, optional) — Whether the sub-account has Google Authenticator bound. true: Yes; false: No. - `canTransOut` (boolean, optional) — Whether the sub-account has the transfer-out permission. true: Yes; false: No. - `ts` (string, optional) — Sub-account creation time, Unix timestamp in milliseconds. ## Examples **Response** ```json { "code": "0", "msg": "", "data": [ { "enable": true, "subAcct": "D456DDDL", "type": "1", "label": "D456DDDLx", "mobile": "", "gAuth": false, "canTransOut": false, "ts": "1659334756000", "firstLvSubAcct": "D456DDDL", "frozenFunc": [], "ifDma": false, "subAcctLv": "1", "uid": "3400***********7413" } ] } ``` **SDK Code** ```python subAccount_getList_example import requests url = "https://www.okx.com/api/v5/users/subaccount/list" headers = {"OK-ACCESS-KEY": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript subAccount_getList_example const url = 'https://www.okx.com/api/v5/users/subaccount/list'; const options = {method: 'GET', headers: {'OK-ACCESS-KEY': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go subAccount_getList_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://www.okx.com/api/v5/users/subaccount/list" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("OK-ACCESS-KEY", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby subAccount_getList_example require 'uri' require 'net/http' url = URI("https://www.okx.com/api/v5/users/subaccount/list") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["OK-ACCESS-KEY"] = '' response = http.request(request) puts response.read_body ``` ```java subAccount_getList_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://www.okx.com/api/v5/users/subaccount/list") .header("OK-ACCESS-KEY", "") .asString(); ``` ```php subAccount_getList_example request('GET', 'https://www.okx.com/api/v5/users/subaccount/list', [ 'headers' => [ 'OK-ACCESS-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp subAccount_getList_example using RestSharp; var client = new RestClient("https://www.okx.com/api/v5/users/subaccount/list"); var request = new RestRequest(Method.GET); request.AddHeader("OK-ACCESS-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift subAccount_getList_example import Foundation let headers = ["OK-ACCESS-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://www.okx.com/api/v5/users/subaccount/list")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```