> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsidemax.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# revokeAgent: Remove an Authorized API Wallet

> Revoke a previously authorized agent wallet so it can no longer sign operations for your master account. The agent is invalidated immediately upon success.

The `revokeAgent` action immediately invalidates a previously authorized agent wallet. Once revoked, the agent can no longer submit orders, cancellations, or any other signed operations on behalf of your master account. The quota slot previously occupied by the agent is freed and can be reused.

Only the master account that originally approved the agent can revoke it. To view all currently active agents for your account, query [`userAgents`](/info/user-agents) via POST `/info`.

<Warning>
  Revocation takes effect immediately. Any in-flight requests signed by the agent that have not yet been processed by the exchange may still be accepted if they arrive before the revocation is recorded.
</Warning>

## Endpoint

```
POST https://dev.upsidemax.xyz/exchange
```

## Request

All requests must include an ECDSA signature and a millisecond-precision nonce. This request must be signed by the **master account**.

```json theme={"system"}
{
  "action": {
    "type": "revokeAgent",
    "agentAddress": "0xabc0000000000000000000000000000000000001"
  },
  "signature": { "r": "0x...", "s": "0x...", "v": 28 },
  "nonce": 1778859600000
}
```

### Action fields

<ParamField body="type" type="string" required>
  Fixed value: `"revokeAgent"`.
</ParamField>

<ParamField body="agentAddress" type="string" required>
  The Ethereum address of the agent wallet to revoke. Must match an agent previously approved by your master account.
</ParamField>

## Response

### Success

```json theme={"system"}
{
  "status": "ok",
  "response": {
    "type": "revokeAgent",
    "data": { "agentAddress": "0xabc0000000000000000000000000000000000001" }
  }
}
```

### Response fields

<ResponseField name="agentAddress" type="string">
  The address of the agent that was revoked, echoed back for confirmation.
</ResponseField>

## Error reference

Rejections return `status: "ok"` with an `errorCode` and `errorMessage` in `data`.

| Cause               | Description                                                                            |
| ------------------- | -------------------------------------------------------------------------------------- |
| Agent not found     | No agent with the given address is registered under your master account.               |
| Not owned by signer | The agent exists but was approved by a different master account; you cannot revoke it. |

<Tip>
  To authorize a new agent after revoking one, use [approveAgent](/exchange/approve-agent).
</Tip>
