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

# Patch strategy preferences

> Patches the strategy's stored preference overrides.

Patches the strategy's stored preference overrides. Swap settings live under
the `swap` namespace: `slippageBps`, `priceImpactBps`, and `thresholdUsd`.

* Auth: `x-api-key` header (required)
* Required scope: `strategies:write`

### Patch semantics

Patches are applied per inner field within `swap`:

* **Omitted field** — preserve the current value
* **Explicit `null`** — clear the field
* **Explicit value** — set the field

Empty body `{}` and `{ "swap": {} }` are both 200 no-ops.

### Clearing all preferences

To remove every per-strategy override and fall back to the tenant
defaults, send a PATCH with all swap fields set to `null`:

```jsonc theme={null}
{
  "swap": {
    "slippageBps": null,
    "priceImpactBps": null,
    "thresholdUsd": null
  }
}
```

The strategy's schedule is unaffected. There is no dedicated `DELETE`
endpoint.

### Schedule is rejected

This endpoint patches **preferences only**. To change the schedule, call
`PUT /v2/strategies/{strategyId}/schedule`. Sending a `schedule` field
here returns `400`.

### Cross-tenant access

Returns `404` — strategies you don't own are not exposed.

<RequestExample>
  ```bash cURL — set slippage and threshold theme={null}
  curl --request PATCH \
    --url 'https://api.glider.fi/v2/strategies/01JWZEE2MF30KVRMRX53N88VA4/preferences' \
    --header 'x-api-key: gldr_sk_your_api_key' \
    --header 'content-type: application/json' \
    --data '{ "swap": { "slippageBps": 300, "thresholdUsd": "5.00" } }'
  ```

  ```bash cURL — clear a single field theme={null}
  curl --request PATCH \
    --url 'https://api.glider.fi/v2/strategies/01JWZEE2MF30KVRMRX53N88VA4/preferences' \
    --header 'x-api-key: gldr_sk_your_api_key' \
    --header 'content-type: application/json' \
    --data '{ "swap": { "thresholdUsd": null } }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.glider.fi/v2/strategies/01JWZEE2MF30KVRMRX53N88VA4/preferences",
    {
      method: "PATCH",
      headers: {
        "x-api-key": "gldr_sk_your_api_key",
        "content-type": "application/json",
      },
      body: JSON.stringify({ swap: { slippageBps: 300 } }),
    },
  );
  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json After patch theme={null}
  {
    "success": true,
    "data": {
      "swap": {
        "slippageBps": 300,
        "priceImpactBps": null,
        "thresholdUsd": "5.00"
      }
    }
  }
  ```
</ResponseExample>
