Remove All Delegated Signers (WebSocket)
Remove all delegated signers from a subaccount through the WebSocket connection, revoking their ability to perform trading actions on behalf of the subaccount. This immediately terminates all trading permissions previously granted to any wallet addresses, providing a fast way to revoke all delegations at once.
Endpoint
ws.send() wss://api.synthetix.io/v1/ws/tradeRequest
Request Format
{
"id": "delegate-remove-all-1",
"method": "post",
"params": {
"action": "removeAllDelegatedSigners",
"subAccountId": "1867542890123456789",
"nonce": 1735689600000,
"expiresAfter": 1735689900,
"signature": {
"v": 28,
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
}
}Parameters
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Client-generated unique request identifier |
method | string | Yes | Must be "post" |
params | object | Yes | Contains all parameters for the request |
Params Object
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be "removeAllDelegatedSigners" |
subAccountId | string | Yes | Subaccount identifier |
nonce | integer | Yes | Positive integer, incrementing nonce |
expiresAfter | integer | No | Optional request expiration timestamp (Unix seconds) |
signature | object | Yes | EIP-712 signature |
Important: Only the master account owner can remove delegated signers.
EIP-712 Type Definition
const RemoveAllDelegatedSignersTypes = {
RemoveAllDelegatedSigners: [
{ name: "subAccountId", type: "uint256" },
{ name: "nonce", type: "uint256" },
{ name: "expiresAfter", type: "uint256" }
]
}Response Format
Success Response
{
"id": "delegate-remove-all-1",
"status": 200,
"result": {
"subAccountId": "1867542890123456789",
"removedSigners": [
"0x742d35Cc6634C0532925a3b844Bc9e7595f89590",
"0x8B3a9A6F8D1e2C4E5B7A9D0F1C3E5A7B9D1F3E5A",
"0x9C4b8E7F0A2D3B6C5E8A1F3D5B7C9E1A3F5D7B9E"
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
subAccountId | string | The subaccount ID that delegated signers were removed from |
removedSigners | string[] | Array of wallet addresses that were removed |
No Delegations Response
{
"id": "delegate-remove-all-1",
"status": 200,
"result": {
"subAccountId": "1867542890123456789",
"removedSigners": []
}
}Error Response
{
"id": "delegate-remove-all-1",
"status": 401,
"result": null,
"error": {
"code": 401,
"message": "Only master account can remove delegated signers"
}
}Implementation Example
import { ethers } from 'ethers';
async function removeAllDelegatedSigners(ws, signer, subAccountId) {
const nonce = Date.now();
const expiresAfter = Math.floor(Date.now() / 1000) + 300; // 5 minutes from now (Unix seconds)
const domain = {
name: "Synthetix",
version: "1",
chainId: 1,
verifyingContract: "0x0000000000000000000000000000000000000000"
};
const types = {
RemoveAllDelegatedSigners: [
{ name: "subAccountId", type: "uint256" },
{ name: "nonce", type: "uint256" },
{ name: "expiresAfter", type: "uint256" }
]
};
const message = {
subAccountId: BigInt(subAccountId),
nonce: BigInt(nonce),
expiresAfter: BigInt(expiresAfter)
};
const sig = await signer.signTypedData(domain, types, message);
const signature = ethers.Signature.from(sig);
ws.send(JSON.stringify({
id: `delegate-remove-all-${Date.now()}`,
method: "post",
params: {
action: "removeAllDelegatedSigners",
subAccountId,
nonce,
expiresAfter,
signature: { v: signature.v, r: signature.r, s: signature.s }
}
}));
}
// Usage: Emergency removal of all delegated signers
await removeAllDelegatedSigners(
ws,
signer,
"1867542890123456789"
);Code Examples
Emergency Revocation of All Signers
{
"id": "emergency-revoke",
"method": "post",
"params": {
"action": "removeAllDelegatedSigners",
"subAccountId": "1867542890123456789",
"nonce": 1735689600000,
"expiresAfter": 1735689900,
"signature": { "v": 28, "r": "0x...", "s": "0x..." }
}
}Implementation Notes
- Immediate Effect: All delegations are revoked immediately upon successful execution
- Access Requirements: Only master account owners can remove delegated signers
- Atomic Operation: Either all delegations are removed or none are (transaction is atomic)
- Idempotent: Calling when no delegations exist returns a success response with an empty
removedSignersarray - Signature Required: All removal operations require valid EIP-712 signatures
- Recovery: Removed signers can be re-added individually through the
addDelegatedSignerendpoint
Use Cases
- Emergency Lockdown: Quickly revoke all delegated access in a security event
- Account Reset: Clear all delegations before setting up new access patterns
- Team Offboarding: Remove all team member access when restructuring
- Security Rotation: Revoke all existing delegations before re-adding with new permissions
Common Errors
| Error Code | Message | Description |
|---|---|---|
| 401 | Only master account can remove delegated signers | Must be signed by master account owner |
| 404 | Subaccount not found | Invalid subaccount ID |
| 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
- Remove Delegated Signer - Remove a single delegated signer
- Get Delegated Signers - List all delegated signers
- Add Delegated Signer - Add new delegation
- Get Subaccounts - View all subaccounts with delegation info
- REST Alternative - REST API comparison