getSubAccountIds
Returns all subaccount IDs associated with a wallet address.
Endpoint
POST https://papi.synthetix.io/v1/infoRequest
Request Format
{
"params": {
"action": "getSubAccountIds",
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be getSubAccountIds |
walletAddress | string | Yes | Ethereum wallet address to query |
Response
Success Response
{
"status": "ok",
"response": [
"1867542890123456789",
"1867542890123456790",
"1867542890123456791"
],
"request_id": "5ccf215d37e3ae6d"
}Response Fields
The response is an array of subaccount ID strings. Each ID is a uint64 represented as a string for precision.
Error Response
| Error | Description |
|---|---|
| Invalid signature | EIP-712 signature validation failed |
| Invalid market symbol | Market symbol not recognized |
| Nonce already used | Nonce must be greater than previous value |
| Rate limit exceeded | Too many requests in time window |
| Request expired | expiresAfter timestamp has passed |
Code Examples
TypeScript
const response = await fetch('https://papi.synthetix.io/v1/info', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
params: {
action: 'getSubAccountIds',
walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
}
})
});
const data = await response.json();
console.log('Subaccounts:', data.response); // Array of subaccount IDsImplementation Notes
- No authentication required (public endpoint)
- Returns all subaccounts ever created for the wallet address
- Subaccount IDs are returned as strings to preserve uint64 precision