Get Delegations For Delegate
Retrieve a list of all delegations granted to the authenticated wallet address. This endpoint allows a delegate wallet to discover which accounts have delegated permissions to it, enabling frontends to detect when a connected wallet is a delegate and allow switching to the delegator's account.
Endpoint
POST https://papi.synthetix.io/v1/tradeRequest
Request Format
{
"params": {
"action": "getDelegationsForDelegate",
"subAccountId": "1867542890123456789"
},
"expiresAfter": 1735689900,
"signature": {
"v": 28,
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Parameters object containing method details |
params.action | string | Yes | Must be "getDelegationsForDelegate" |
params.subAccountId | string | Yes | Subaccount ID included in the signed SubAccountAction payload |
params.owningAddress | string | No | Optional Ethereum address to query on behalf of. When provided and different from the signing wallet, the caller must have trading permission for that address |
expiresAfter | integer | No | Unix timestamp (seconds) when this request expires |
signature | object | Yes | EIP-712 signature object |
::::info Authentication
The delegate address is determined from the wallet that signed the request. By default, this returns delegations for the signing wallet. If you provide owningAddress, the caller must have trading permission for that address.
::::
Response
Success Response
{
"status": "ok",
"response": {
"delegatedAccounts": [
{
"subAccountId": "1867542890123456789",
"ownerAddress": "0x8B3a9A6F8D1e2C4E5B7A9D0F1C3E5A7B9D1F3E5A",
"accountName": "Main Trading Account",
"accountValue": "12500.50",
"permissions": ["trading"],
"expiresAt": null
},
{
"subAccountId": "2987654321098765432",
"ownerAddress": "0x9C4b8E7F0A2D3B6C5E8A1F3D5B7C9E1A3F5D7B9E",
"accountName": "Secondary Account",
"accountValue": "4300.00",
"permissions": ["trading"],
"expiresAt": 1767225600000
}
]
},
"request_id": "5ccf215d37e3ae6d"
}Response Fields
| Field | Type | Description |
|---|---|---|
delegatedAccounts | array | Array of delegated account objects |
Delegated Account Object
| Field | Type | Description |
|---|---|---|
subAccountId | string | Subaccount ID this delegation applies to |
ownerAddress | string | Ethereum wallet address of the account owner who granted the delegation |
accountName | string | Human-readable name of the delegated account |
accountValue | string | Total account value of the delegating subaccount in decimal USDT |
permissions | string[] | Array of permission levels granted. Currently supports: ["trading"] |
expiresAt | integer | null | Unix timestamp (milliseconds) when the delegation expires. null indicates no expiration |
Empty Response
{
"status": "ok",
"response": {
"delegatedAccounts": []
},
"request_id": "5ccf215d37e3ae6d"
}Error Response
{
"status": "error",
"error": {
"message": "Authentication failed",
"code": "UNAUTHORIZED"
},
"request_id": "5ccf215d37e3ae6d"
}Code Examples
Get All Delegations for Connected Wallet
{
"params": {
"action": "getDelegationsForDelegate",
"subAccountId": "1867542890123456789"
},
"expiresAfter": 1735689900,
"signature": {
"v": 28,
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
}Response with Multiple Delegated Accounts
{
"status": "ok",
"response": {
"delegatedAccounts": [
{
"subAccountId": "1867542890123456789",
"ownerAddress": "0x8B3a9A6F8D1e2C4E5B7A9D0F1C3E5A7B9D1F3E5A",
"accountName": "Main Trading Account",
"accountValue": "12500.50",
"permissions": ["trading"],
"expiresAt": null
},
{
"subAccountId": "2987654321098765432",
"ownerAddress": "0x9C4b8E7F0A2D3B6C5E8A1F3D5B7C9E1A3F5D7B9E",
"accountName": "Secondary Account",
"accountValue": "4300.00",
"permissions": ["trading"],
"expiresAt": null
},
{
"subAccountId": "3456789012345678901",
"ownerAddress": "0xA1B2C3D4E5F6A7B8C9D0E1F2A3B4C5D6E7F8A9B0",
"accountName": "Team Account",
"accountValue": "980.25",
"permissions": ["trading"],
"expiresAt": 1798761600000
}
]
},
"request_id": "5ccf215d37e3ae6d"
}EIP-712 Signature
const domain = {
name: "Synthetix",
version: "1",
chainId: 1,
verifyingContract: "0x0000000000000000000000000000000000000000"
};
const types = {
SubAccountAction: [
{ name: "subAccountId", type: "uint256" },
{ name: "action", type: "string" },
{ name: "expiresAfter", type: "uint256" }
]
};
const message = {
subAccountId: BigInt("1867542890123456789"),
action: "getDelegationsForDelegate",
expiresAfter: 0
};
const signature = await signer._signTypedData(domain, types, message);Implementation Notes
- Delegate-Centric Query: Unlike
getDelegatedSignerswhich queries by subaccount, this endpoint returns all accounts that have delegated permissions to the authenticated wallet - Access Control: Returns delegations for the signing wallet by default, or for
owningAddresswhen the caller hastradingpermission for that address - Real-time Data: Returns current active delegations only
- Expiration Handling: Expired delegations are automatically excluded from results
- No Pagination: All delegations are returned in a single response
- Owner Information: Includes the
ownerAddress,accountName, andaccountValueto help identify which accounts have granted delegation
Use Cases
- Wallet Detection: Frontend can detect when a connected wallet is a delegate and offer account switching
- Account Switching UI: Build interfaces allowing delegates to switch between delegated accounts
- Multi-Account Management: Delegates managing multiple accounts can see all their delegations in one place
- Access Verification: Confirm which accounts a delegate has permission to trade on
- Team Dashboard: Team members can see which accounts they have access to
Signing
All trading methods are signed using EIP-712. Each successful trading request will contain:
- A piece of structured data that includes the sender address
- A signature of the hash of that structured data, signed by the sender
For detailed information on EIP-712 signing, see EIP-712 Signing.
Error Handling
owningAddress-Specific Errors
| Status | Code | When it happens |
|---|---|---|
| 400 | VALIDATION_ERROR | owningAddress is not a valid hex Ethereum address |
| 403 | FORBIDDEN | Caller does not have trading permission for the specified owningAddress |
| Error Code | Description | Retryable |
|---|---|---|
UNAUTHORIZED | EIP-712 signature validation failed | No |
VALIDATION_ERROR | Request validation failed | No |
MISSING_REQUIRED_FIELD | Required field is missing | No |
INVALID_FORMAT | Field format is invalid | No |
INVALID_VALUE | Invalid parameter value | No |
RATE_LIMIT_EXCEEDED | Too many requests in time window | Yes |
INSUFFICIENT_MARGIN | Not enough margin for trade | No |
ORDER_NOT_FOUND | Order does not exist | No |
OPERATION_TIMEOUT | Operation timed out | Yes |
Next Steps
- Get Delegated Signers - Query delegations by subaccount
- Add Delegated Signer - Add new delegation
- Remove Delegated Signer - Revoke delegation
- Get Subaccount - Account details
- WebSocket Alternative - WebSocket API comparison