Skip to content

Remove All Delegated Signers

Remove all delegated signers from a subaccount in a single request, 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

POST https://papi.synthetix.io/v1/trade

Request

Request Format

{
  "params": {
    "action": "removeAllDelegatedSigners",
    "subAccountId": "1867542890123456789"
  },
  "nonce": 1735689600000,
  "expiresAfter": 1735689900,
  "signature": {
    "v": 28,
    "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
  }
}

Request Parameters

ParameterTypeRequiredDescription
paramsobjectYesAction object containing removal details
params.actionstringYesMust be "removeAllDelegatedSigners"
params.subAccountIdstringYesThe subaccount ID to remove all delegated signers from
expiresAfterintegerNoOptional request expiration timestamp (Unix seconds)
ParameterTypeRequiredDescription
nonceuint64Yes*Positive integer nonce (must be incrementing and unique per request)
signatureobjectYesEIP-712 signature object
expiresAfteruint64NoUnix milliseconds expiration timestamp (5x rate limit on stale cancels)

:::info Common Parameters These are top-level request parameters. The subAccountId parameter is specified within the params object (see each endpoint's parameter table). :::

:::info SubAccountAction Endpoints Endpoints using SubAccountAction signing (getPositions, getOpenOrders, getOrdersHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates) do not require the nonce parameter. Only signature and optional expiresAfter are needed. :::

EIP-712 Signature Structure

The request is signed using EIP-712 with the following type definition:

const RemoveAllDelegatedSignersTypes = {
  RemoveAllDelegatedSigners: [
    { name: "subAccountId", type: "uint256" },
    { name: "nonce", type: "uint256" },
    { name: "expiresAfter", type: "uint256" }
  ]
}

Response

Success Response

{
  "status": "ok",
  "response": {
    "subAccountId": "1867542890123456789",
    "removedSigners": [
      "0x742d35Cc6634C0532925a3b844Bc9e7595f89590",
      "0x8B3a9A6F8D1e2C4E5B7A9D0F1C3E5A7B9D1F3E5A",
      "0x9C4b8E7F0A2D3B6C5E8A1F3D5B7C9E1A3F5D7B9E"
    ]
  },
  "request_id": "5ccf215d37e3ae6d"
}

Response Fields

FieldTypeDescription
subAccountIdstringThe subaccount ID that delegated signers were removed from
removedSignersstring[]Array of wallet addresses that were removed

No Delegations Response

When there are no delegated signers to remove:

{
  "status": "ok",
  "response": {
    "subAccountId": "1867542890123456789",
    "removedSigners": []
  },
  "request_id": "5ccf215d37e3ae6d"
}

Error Response

{
  "status": "error",
  "error": {
    "message": "Only master account can remove delegated signers",
    "code": "UNAUTHORIZED"
  },
  "request_id": "5ccf215d37e3ae6d"
}

Common Error Cases

{
  "status": "error",
  "error": {
    "message": "Subaccount not found",
    "code": "NOT_FOUND"
  },
  "request_id": "5ccf215d37e3ae6d"
}

Code Examples

Emergency Revocation of All Signers

{
  "params": {
    "action": "removeAllDelegatedSigners",
    "subAccountId": "1867542890123456789"
  },
  "nonce": 1735689600000,
  "expiresAfter": 1735689900,
  "signature": {
    "v": 28,
    "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
  }
}

EIP-712 Signature

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 nonce = Date.now();
const expiresAfter = Math.floor(Date.now() / 1000) + 300; // 5 minutes from now (Unix seconds)
 
const message = {
  subAccountId: BigInt("1867542890123456789"),
  nonce: BigInt(nonce),
  expiresAfter: BigInt(expiresAfter)
};
 
const signature = await signer._signTypedData(domain, types, message);

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 removedSigners array
  • Signature Required: All removal operations require valid EIP-712 signatures
  • Recovery: Removed signers can be re-added individually through the addDelegatedSigner endpoint

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

Comparison with removeDelegatedSigner

FeatureremoveDelegatedSignerremoveAllDelegatedSigners
ScopeSingle delegate addressAll delegated signers
ParametersRequires delegateAddressNo address needed
Use CaseTargeted revocationBulk emergency revocation
ResponseSingle address confirmedList of all removed addresses

Related Endpoints

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.

Nonce Management

The nonce system prevents replay attacks and ensures order uniqueness:

  • Use any positive integer as nonce
  • Each nonce must be greater than the previous one (incrementing)
  • Date.now() is a convenient option, not a requirement
  • If nonce conflicts occur, increment by 1 and retry

:::note SubAccountAction Exception SubAccountAction endpoints (getPositions, getOpenOrders, getOrdersHistory, getTrades, getFundingPayments, getSubAccount, getSubAccounts, getDelegatedSigners, getBalanceUpdates) do not require a nonce. Only the signature and optional expiresAfter parameters are needed. :::

Error Handling

Error CodeDescriptionRetryable
UNAUTHORIZEDEIP-712 signature validation failedNo
VALIDATION_ERRORRequest validation failedNo
MISSING_REQUIRED_FIELDRequired field is missingNo
INVALID_FORMATField format is invalidNo
INVALID_VALUEInvalid parameter valueNo
RATE_LIMIT_EXCEEDEDToo many requests in time windowYes
INSUFFICIENT_MARGINNot enough margin for tradeNo
ORDER_NOT_FOUNDOrder does not existNo
OPERATION_TIMEOUTOperation timed outYes