---
title: "Fork Library Entry"
method: POST
path: "/v1/library/{slug}/fork"
tags: ["library"]
---

# Fork Library Entry

`POST /v1/library/{slug}/fork`

## 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/library/{slug}/fork`
- Auth: none declared

Fork a library entry's selected variant into the caller's org.

Creates a normal user strategy (S3 source + commit #0) with the selected
variant applied and library provenance recorded (spec 08 §5). The forked
strategy is a normal, editable, backtestable strategy from second one — no
library entry is mutated in place (entries are immutable, spec 03 B2.3).

## Path parameters

- `slug` string, required

## Headers

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

## Request body

- LibraryForkRequest: Fork a library entry's selected variant into the caller's org.
  - `variant_id` string, nullable
  - `name` string, nullable
  - `created_via` 'app' | 'cli' | 'mcp-local' | 'mcp-remote' | 'sdk' | 'chat' | 'api', nullable
  - `source_surface` string, nullable

## Response `201`

Successful Response

- LibraryForkResponse: Enough for the app to show 'loaded from Keel Library' and land the user.
  - `strategy_id` string, required
  - `name` string, required
  - `source_slug` string, required
  - `entry_version` string, nullable
  - `variant_id` string, required
  - `is_default_variant` boolean, required
  - `import_id` string, nullable
  - `library_source_hash` string, nullable
  - `applied` object[]
  - `config_summary` object
  - `headline` object, nullable
  - `basket_resolved_at` string, nullable
  - `delisted_members` object[]
  - `basket_note` string, nullable
  - `editor_path` string, required

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