---
title: "get the whole connected kinship component reachable from this person (ancestors, descendants, spouses, siblings), for the interactive family-tree chart"
method: GET
path: "/api/people/{id}/familytree"
tags: ["GanjoorRelatedPerson"]
---

# get the whole connected kinship component reachable from this person (ancestors, descendants, spouses, siblings), for the interactive family-tree chart

`GET /api/people/{id}/familytree`

## Request

- Base URL: `https://api.ganjoor.net` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ganjoor.net/api/people/{id}/familytree`
- Auth: none declared

## Path parameters

- `id` integer, required

## Query parameters

- `masterCatId` integer

## Response `200`

OK

- GanjoorFamilyTreeViewModel: the whole connected kinship component reachable from one person, for the interactive chart at /FamilyTree/{id} (client draws the layout; this just hands over every person and every edge in that connected subgraph - see GanjoorRelatedPersonService.GetFamilyTreeAsync). Deliberately not scoped to strict descendants of RootId: an ancestor several rows up, or a spouse's own side of the family, is part of the same connected component and is included too, exactly like akhakhafrasiyab.ir's chart isn't confined to the clicked node's own subtree.
  - `rootId` integer: the person id the chart was requested for (not necessarily the topmost node once rendered - the client walks Parent/Ancestor edges to find the actual top of each lineage in Persons)
  - `persons` GanjoorRelatedPerson[], nullable: every person in the connected component, including RootId itself
    - `id` integer: id
    - `name` string, nullable: name
    - `description` string, nullable: description
    - `wikiUrl` string, nullable: wikipedia url
    - `birthYearInLHijri` integer: birth year in lunar hijri
    - `deathYearInLHijri` integer: death year in lunar hijri
    - `validBirthDate` boolean: BirthYearInLHijri, for some poets it is only indicator of their century of birth and should not be relied as their valid birth date
    - `validDeathDate` boolean: DeathYearInLHijri, for some poets it is only indicator of their century of death and should not be relied as their valid death date
    - `birthLocationId` integer, nullable: birth location id
    - `birthLocation` GanjoorGeoLocation: Geo Locations (Cities) referred by Ganjoor Metadata
      - `id` integer: id
      - `name` string, nullable: name
      - `latitude` number, double: Latitude
      - `longitude` number, double: Longitude
      - `machineGenerated` boolean: AI generated
    - `deathLocationId` integer, nullable: death location id
    - `deathLocation` GanjoorGeoLocation: Geo Locations (Cities) referred by Ganjoor Metadata
      - `id` integer: id
      - `name` string, nullable: name
      - `latitude` number, double: Latitude
      - `longitude` number, double: Longitude
      - `machineGenerated` boolean: AI generated
    - `machineGenerated` boolean: AI generated
    - `familyTreeCaption` string, nullable: optional caption for the family tree this person is treated as the root of (e.g. "ساسانیان", "آل برمک") - purely a display label for whoever a tree is being browsed from; nothing enforces that this person actually has no recorded ancestors themselves, and most people will leave this null (only whichever person a tree is "named after" needs one set).
    - `importance` 0 | 1 | 2: how editorially prominent a GanjoorRelatedPerson is treated as - purely a display/sizing hint (see GanjoorRelatedPerson.Importance, GanjoorPersonGraphNode.Importance and peoplegraph.js's nodeRadius()), never used to filter, rank or otherwise affect query results. New values can be appended safely later (stored as int).
    - `gender` 0 | 1 | 2: a GanjoorRelatedPerson's gender - used only by the family-tree chart (familytree.js's buildLayout()) to break ties when a child has two recorded parents and both happen to have their own recorded ancestors (so neither side can be preferred on "continues a documented lineage" grounds alone): the father is preferred as the tree's spine parent, matching conventional patrilineal genealogy-chart practice, with the mother then drawn attached beside him. Never used to filter, rank or otherwise affect query results. New values can be appended safely later (stored as int).
    - `aliases` string, nullable: other names this person is known by (epithets, titles, alternative spellings), separated by the Persian comma (،) - e.g. for رستم: «تهمتن، رستم دستان، پور زال». Used by the AI tagging jobs to match a name in a poem to this person, and filled automatically when two people are merged
  - `relations` GanjoorFamilyTreeEdge[], nullable: every kinship edge touching any person in Persons
    - `person1Id` integer
    - `person2Id` integer
    - `relationType` 0 | 1 | 2 | 3: the kind of kinship edge a GanjoorPersonRelation represents between two GanjoorRelatedPerson rows. The graph is not a strict tree - siblings can be known without their parents, an ancestor can be known without the exact number of generations in between, etc. - so this is a small, deliberately open set rather than a rigid parent/child-only model.
    - `degreeHint` integer, nullable
    - `relationId` integer: the relation row's id
    - `state` string, nullable: only set when the tree was requested for a book (MasterCatId): "attested" (human evidence in this book), "otherBook" (evidence only in other books, nothing here contradicts it), "unattested" (no human evidence anywhere), or "contradicted" (a parent link that conflicts with a parent link attested in this book - same gender as an attested parent of the same child, or both parent slots already taken by attested parents). Null in the unfiltered view.
    - `attestedIn` string[], nullable: titles of the books that attest this relation (human evidence only), for tooltips
  - `masterCatId` integer, nullable: the book (master category) this view was computed for, or null for the unfiltered whole-tree view. Edges then carry a State, see GanjoorFamilyTreeEdge.State.
  - `books` GanjoorFamilyTreeBook[], nullable: every book that has at least one human-attached evidence row for a relation in this tree (what the book picker lists)
    - `id` integer: master category id
    - `title` string, nullable: category title
    - `relationCount` integer: number of this tree's relations attested in this book

## Other responses

- `400`: Bad Request

## Changes

- **2026-10-10** `330e7bb195c1`: 1 info
  - added the optional property `persons/items/aliases` to the response with the `200` status
- **2026-10-08** `234cbf41d38b`: 6 info
  - added the new optional `query` request parameter `masterCatId`
  - added the optional property `books` to the response with the `200` status
  - added the optional property `masterCatId` to the response with the `200` status
  - added the optional property `relations/items/attestedIn` to the response with the `200` status
  - …2 more
- **2026-10-03** `3812f6309404`: 2 info
  - added the optional property `persons/items/gender` to the response with the `200` status
  - added the optional property `persons/items/importance` to the response with the `200` status
- **2026-09-29** `35a7a85bc9dc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ganjoor/apis/rmuseum-api/changes/api/people/:id/familytree/get.md)

---

[API](https://skmtc.dev/ganjoor/apis/rmuseum-api.md) - [All operations](https://skmtc.dev/ganjoor/apis/rmuseum-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ganjoor/apis/rmuseum-api/revisions/143b912b1085?raw)
