---
title: "Update Strategy"
method: PATCH
path: "/v1/strategies/{strategy_id}"
tags: ["strategies"]
---

# Update Strategy

`PATCH /v1/strategies/{strategy_id}`

## 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}`
- Auth: none declared

Update strategy metadata/source with optimistic concurrency + commits.

## Path parameters

- `strategy_id` string, required

## Headers

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

## Request body

- UpdateStrategyRequest
  - `name` string, nullable
  - `source` string, nullable
  - `format` 'dsl' | 'graph', nullable
  - `graph` object, nullable
  - `expected_source_hash` string, nullable
  - `parent_version` string, nullable
  - `expected_head_commit_id` string, nullable
  - `message` string, nullable
  - `description` string, nullable
  - `metadata` object, nullable
  - `machine_emitted` boolean
  - `commit_provenance` CommitProvenance: Agent-commit provenance recorded into ``strategy.commits.meta``. Expand-only attribution (agent-edit-persistence spec stage 0): the chat-api server-side writer stamps WHO authored the commit content (``actor="agent"``) and which run/conversation produced it, so an agent-minted commit is distinguishable at the data layer from the user typing the same text. ``actor`` is a closed vocabulary — commit meta is queryable provenance, never a free-text channel; new actors are added here deliberately. A real ``actor_principal_id`` column is the recorded later step (spec §5 decision point 3); meta keys need no DDL.
    - `actor` 'agent', required
    - `run_id` string, nullable
    - `conversation_id` string, nullable
  - `component_lock` object, nullable
  - `expected_lock_hash` string, nullable

## Response `200`

Successful Response

- StrategyResponse
  - `id` string, required
  - `name` string, required
  - `status` string, required
  - `visibility` string, nullable
  - `forked_from_id` string, nullable
  - `forked_from_name` string, nullable
  - `fork_count` integer
  - `description` string, nullable
  - `source` string, nullable
  - `source_hash` string, nullable
  - `created_via` string, nullable
  - `library_source_slug` string, nullable
  - `library_entry_version` string, nullable
  - `library_entry_name` string, nullable
  - `library_variant_id` string, nullable
  - `library_import_id` string, nullable
  - `library_source_hash` string, nullable
  - `backtested_page_slug` string, nullable
  - `backtested_cell_id` string, nullable
  - `backtested_page_subject` string, nullable
  - `head_commit_id` string, nullable
  - `head_source_hash` string, nullable
  - `compilation_error` string, nullable
  - `validation` object, nullable
  - `unchanged` boolean, nullable
  - `universe_resolution` object, nullable
  - `universe_state` object, nullable
  - `graph` object, nullable
  - `s3_key` string, nullable
  - `org_id` string, nullable
  - `component_lock` object, nullable
  - `deprecations` object[], nullable
  - `lock_hash` string, nullable
  - `current_sequence` integer, nullable
  - `deployed_sequence` integer, nullable
  - `deployed_version_string` string, nullable
  - `deployment_id` string, nullable
  - `deployment_schedule` string, nullable
  - `deployed_at` string, date-time, nullable
  - `latest_backtest_metrics` object, nullable
  - `latest_backtest_id` string, nullable
  - `latest_backtest_sequence` integer, nullable
  - `latest_backtest_start_date` string, date-time, nullable
  - `latest_backtest_end_date` string, date-time, nullable
  - `latest_backtest_sub_window` boolean, nullable
  - `backtest_state` string, nullable
  - `backtest_run_count` integer, nullable
  - `journey_projection` object, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, nullable

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