---
title: "Check Source Ancestry"
method: POST
path: "/v1/strategies/{strategy_id}/source-ancestry"
tags: ["strategies"]
---

# Check Source Ancestry

`POST /v1/strategies/{strategy_id}/source-ancestry`

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

How does a client source snapshot relate to this strategy's commits?

Batch-11 seam for chat-api: a snapshot byte-identical to a SUPERSEDED
main-line commit is provably historical — the caller should prefer the
saved head rather than silently reverting newer work. A snapshot
matching nothing is novel text and stays authoritative (fail-open).
The server computes the hash of the exact bytes; callers never hash.

## Path parameters

- `strategy_id` string, required

## Headers

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

## Request body

- SourceAncestryRequest: Body for POST /{id}/source-ancestry — the raw client snapshot. The SERVER hashes it (compute_source_hash of the exact bytes) so the client never computes a hash — the same one-owner rule as expected_source_hash (client hashes can never match stored/canonical text; the documented 409-storm landmine).
  - `source` string, required

## Response `200`

Successful Response

- SourceAncestryResponse: verdict: how the snapshot relates to this strategy's commit line. - "head": byte-identical to the current head commit - "ancestor": byte-identical to a superseded main-line commit — the snapshot is provably historical, not novel text - "unknown": matches no commit (novel text, or unhashable lineage)
  - `verdict` 'head' | 'ancestor' | 'unknown', required
  - `head_source_hash` string, nullable
  - `matched_sequence` integer, 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)
