---
title: "Upgrade Strategy Lock"
method: POST
path: "/v1/strategies/{strategy_id}/lock/upgrade"
tags: ["strategies"]
---

# Upgrade Strategy Lock

`POST /v1/strategies/{strategy_id}/lock/upgrade`

## Request

- Base URL: `https://api.usekeel.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.usekeel.io/v1/strategies/{strategy_id}/lock/upgrade`
- Auth: none declared

Bump the NON-breaking pins and save them — a thin wrapper over PATCH.

Spec 02 (Contract): of the requested drifting pins (all when
``components`` is omitted), only those whose bump alone keeps the
strategy valid are moved; breaking ones (an interface change, a
deprecation, an unknown component) are listed in ``skipped_breaking`` for
a recomposition. The bumped lock is saved through ``PATCH`` (lock-only)
and only when it validates: an invalid combination writes nothing. The
caller names the version it read — ``expected_head_commit_id``, or both
content hashes — and a moved HEAD is a 409 before anything is computed.

## Path parameters

- `strategy_id` string, required

## Headers

- `Authorization` string, nullable
- `X-Org-Id` string, nullable

## Request body

- SrcSchemasStrategiesLockUpgradeRequest: Body for ``POST /{id}/lock/upgrade`` (spec 02, Contract): bump the non-breaking pins among ``components`` (every drifting pin when omitted) and save them. The upgrade is computed from exactly the version the caller read, so the caller must name it: ``expected_head_commit_id`` (Q-2227 S1 — a lock move is a commit, so the version covers both the source and the lock), or BOTH content hashes. Whatever is named and has moved is a 409; naming neither is a 422.
  - `components` string[], nullable
  - `expected_head_commit_id` string, nullable
  - `expected_source_hash` string, nullable
  - `expected_lock_hash` string, nullable

## Response `200`

Successful Response

- SrcSchemasStrategiesLockUpgradeResponse: ``POST /{id}/lock/upgrade``: the non-breaking pins it moved (saved through the PATCH path as one commit when the bumped lock validates and compiles) and the breaking ones it left for a recomposition.
  - `upgraded` object[], required
  - `component_lock` object, required
  - `lock_hash` string, required
  - `valid` boolean, nullable
  - `issues` object[]
  - `message` string, nullable
  - `persisted` boolean
  - `skipped_breaking` string[]

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/usekeel/apis/keel-api.md) · [All operations](https://skmtc.dev/usekeel/apis/keel-api/llms.txt) · [OpenAPI document](https://skmtc.dev/usekeel/apis/keel-api/revisions/3191ca10b0ab?raw)
