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

# Updating Strategies

> Update B2B API strategy metadata, allocations, schedules, preferences, and fees.

Use the strategy update routes to change a reusable strategy after you create
it. These changes can affect every portfolio enrolled in the strategy.

For the complete provider workflow, see the
[Build and Distribute Strategies](/guides/strategy-providers).

## Choose the correct route

| Change                           | Route                                           | Effect                               |
| -------------------------------- | ----------------------------------------------- | ------------------------------------ |
| Name, description, or visibility | `PATCH /v2/strategies/{strategyId}`             | Changes strategy metadata            |
| Target allocation                | `POST /v2/strategies/{strategyId}/versions`     | Publishes a new active version       |
| Rebalance cadence                | `PUT /v2/strategies/{strategyId}/schedule`      | Updates enrolled portfolio schedules |
| Swap preferences                 | `PATCH /v2/strategies/{strategyId}/preferences` | Overrides tenant defaults            |
| Fees                             | `PATCH /v2/strategies/{strategyId}/fees`        | Overrides tenant fee defaults        |

All update routes require `strategies:write`. Cross-tenant access returns
`404`.

## Update metadata

Use `PATCH /v2/strategies/{strategyId}` to change `name`, `description`, or
`isPublic`. This route uses JSON Merge Patch.

```javascript theme={null}
await fetch(`https://api.glider.fi/v2/strategies/${strategyId}`, {
  method: "PATCH",
  headers: {
    "content-type": "application/json",
    "x-api-key": process.env.GLIDER_API_KEY,
  },
  body: JSON.stringify({
    name: "Balanced Growth",
    isPublic: true,
  }),
});
```

The strict body accepts only `name`, `description`, and `isPublic`.

## Change weights or assets

Allocation versions are immutable. Publish a new version with the complete
target allocation. The request is not a partial patch. If you omit an existing
asset, it is not part of the new target.

```javascript theme={null}
await fetch(
  `https://api.glider.fi/v2/strategies/${strategyId}/versions`,
  {
    method: "POST",
    headers: {
      "content-type": "application/json",
      "x-api-key": process.env.GLIDER_API_KEY,
    },
    body: JSON.stringify({
      allocation: {
        assets: [
          {
            assetId:
              "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            weight: "70",
          },
          {
            assetId:
              "eip155:1/erc20:0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            weight: "30",
          },
        ],
      },
      changeLog: "Reduced WETH target to 30%",
    }),
  },
);
```

<Warning>
  The new version becomes active immediately. Each enrolled portfolio uses it
  during its next rebalance. Coordinate with distributors before you publish a
  material change.
</Warning>

Previous versions remain available from
`GET /v2/strategies/{strategyId}/versions`. To restore an old allocation,
publish that allocation again as a new version.

## Change the schedule

Replace the configured cadence with an interval or cron schedule:

```javascript theme={null}
await fetch(
  `https://api.glider.fi/v2/strategies/${strategyId}/schedule`,
  {
    method: "PUT",
    headers: {
      "content-type": "application/json",
      "x-api-key": process.env.GLIDER_API_KEY,
    },
    body: JSON.stringify({ type: "interval", frequency: "weekly" }),
  },
);
```

The route also accepts a five-field cron expression and IANA timezone:

```json theme={null}
{
  "type": "cron",
  "cron": "30 9 * * 1-5",
  "timezone": "America/New_York"
}
```

Read the configured cadence with
`GET /v2/strategies/{strategyId}/schedule`. Read runtime values, such as
`nextDueAt`, from `GET /v2/portfolios/{portfolioId}`.

## Change preferences or fees

* `PATCH /v2/strategies/{strategyId}/preferences` merge-patches swap settings.
* `PATCH /v2/strategies/{strategyId}/fees` merge-patches strategy fee
  overrides.

Read the current values before you patch them. Omitted fields keep their
current values.

## Further reference

* [Patch strategy metadata](/api-reference/endpoints/v2-patch-strategy)
* [Publish strategy version](/api-reference/endpoints/v2-publish-strategy-version)
* [List strategy versions](/api-reference/endpoints/v2-list-strategy-versions)
* [Set strategy schedule](/api-reference/endpoints/v2-set-strategy-schedule)
* [Patch strategy preferences](/api-reference/endpoints/v2-patch-strategy-preferences)
* [Patch strategy fees](/api-reference/endpoints/v2-patch-strategy-fees)
