Accounts
List Accounts
List all sub-accounts under your Prime Account
GET
/
accounts
List Accounts
curl --request GET \
--url https://api.example.com/accountsimport requests
url = "https://api.example.com/accounts"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/accounts"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/accounts")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyList Accounts
Returns all sub-accounts belonging to the authenticated Prime Account.Request
GET /accounts
Examples
curl https://prime-api.legend.xyz/accounts \
-H "Authorization: Bearer $LEGEND_QUERY_KEY"
const { accounts } = await client.accounts.list();
result = await client.accounts.list()
accounts = result["accounts"]
let accounts = client.accounts.list().await?;
Response
{
"accounts": [
{
"account_id": "acc_2o0yiljtp378",
"signer_type": "eoa",
"signer_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"legend_wallet_address": "0xc40897f38bc3d4e4d17f9daf46d2a13b4c47642f",
"created_at": "2025-06-15T10:30:00Z"
},
{
"account_id": "acc_gmi200ohuhq6",
"signer_type": "eoa",
"signer_address": "0x8Ba1f109551bD432803012645Ac136ddd64DBA72",
"legend_wallet_address": "0x8d63d02feb8910736c575808a1691cd70325bbe3",
"created_at": "2025-06-16T09:15:00Z"
}
]
}
Response fields
| Field | Type | Description |
|---|---|---|
accounts | array | List of sub-account objects |
accounts[].account_id | string | Unique identifier (acc_ prefix) |
accounts[].signer_type | string | Signer type ("eoa") |
accounts[].signer_address | string | Signer’s Ethereum address |
accounts[].legend_wallet_address | string | On-chain wallet address |
accounts[].created_at | string | ISO 8601 timestamp |
⌘I
List Accounts
curl --request GET \
--url https://api.example.com/accountsimport requests
url = "https://api.example.com/accounts"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/accounts"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/accounts")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body