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

# Deactivate Wallet

> Deactivate an agent and optionally withdraw funds

<Note>
  **SDK Alternative**: Use `agent.deactivate()` for a simpler TypeScript interface. [See SDK docs](/sdk-reference/agent/lifecycle)
</Note>

## Description

Deactivates the agent for a specific wallet. This stops automatic rebalancing and optionally transfers remaining funds to the origin wallet.

## Path Parameters

<ParamField path="chain_id" type="integer" required>
  The blockchain chain ID
</ParamField>

<ParamField path="wallet" type="string" required>
  The wallet address
</ParamField>

## Query Parameters

<ParamField query="transfer" type="boolean" default="false">
  Whether to transfer remaining balance to the origin wallet
</ParamField>

## Response

Returns `201 Created` on success.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://partners-backend-1038109371738.europe-west1.run.app/api/v1/8453/wallets/0x...:deactivate?transfer=true" \
    -H "X-Partner-API-Key: your-api-key" \
    -H "X-Partner-Name: your-partner-name"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://partners-backend-1038109371738.europe-west1.run.app/api/v1/8453/wallets/0x...:deactivate?transfer=true',
    {
      method: 'POST',
      headers: {
        'X-Partner-API-Key': 'your-api-key',
        'X-Partner-Name': 'your-partner-name',
      },
    }
  );
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "message": "Wallet deactivation triggered"
  }
  ```

  ```json 403 Forbidden theme={null}
  {
    "detail": "Wallet is not active"
  }
  ```
</ResponseExample>
