> ## 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.

# Update Protocols

> Update the selected protocols for a wallet

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

## Description

Updates the list of protocols that the agent can use for optimization. The agent will rebalance according to the new protocol selection.

## Path Parameters

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

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

## Request Body

The request body should be a JSON array of protocol names:

```json theme={null}
["aave", "compound", "moonwell", "fluid"]
```

## Response

Returns `204 No Content` on success.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT "https://partners-backend-1038109371738.europe-west1.run.app/api/v1/8453/wallets/0x.../protocols" \
    -H "Content-Type: application/json" \
    -H "X-Partner-API-Key: your-api-key" \
    -H "X-Partner-Name: your-partner-name" \
    -d '["aave", "compound", "moonwell", "fluid"]'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://partners-backend-1038109371738.europe-west1.run.app/api/v1/8453/wallets/0x.../protocols',
    {
      method: 'PUT',
      headers: {
        'Content-Type': 'application/json',
        'X-Partner-API-Key': 'your-api-key',
        'X-Partner-Name': 'your-partner-name',
      },
      body: JSON.stringify(['aave', 'compound', 'moonwell', 'fluid']),
    }
  );
  ```
</RequestExample>

<ResponseExample>
  ```text 204 No Content theme={null}
  (empty response body)
  ```

  ```json 400 Bad Request theme={null}
  {
    "detail": "Invalid protocol name"
  }
  ```
</ResponseExample>
