Skip to content

Custom JSON format

Most users never need this page. If you just want to import or export a tree, the regular Import and Export panels handle GEDCOM and the built-in JSON without any of this. This reference is for power users who want to round-trip a tree through their own scripts or build tooling on top of Draw My Tree's data.

Overview

Draw My Tree uses a versioned JSON wrapper for imports and exports. Files start with a schemaVersion and a meta block, followed by a data object that holds people, relationships, and optional details, events, and media. Unknown fields are preserved on import but reported as warnings.

Top-level shape

FieldTypeRequiredDescription
schemaVersion"1"requiredFormat version. Currently only '1' is accepted.
metaobjectrequiredExport metadata. See Meta below.
dataobjectrequiredTree contents. See Data below.

Meta

FieldTypeRequiredDescription
exportedAtstring (ISO 8601)requiredWhen the export was produced.
appVersionstringoptionalVersion of Draw My Tree that produced the export.
treeNamestringoptionalHuman-readable tree name.

Data

The data block contains five arrays. Every array must be present, even if empty.

FieldTypeRequiredDescription
peoplePerson[]requiredIndividuals in the tree.
relationshipsRelationship[]requiredParent-child and partner links.
personDetailsPersonDetails[]requiredOptional life-event places and dates per person.
eventsPersonEvent[]requiredCensus, marriage, immigration, and other dated records.
mediaPersonMedia[]requiredPhotos, portraits, and documents linked to a person or relationship.

Person

FieldTypeRequiredDescription
idstringrequiredStable identifier referenced by relationships and details.
namestringrequiredDisplay name.
birthDatestringoptionalISO date or partial date (e.g. '1815' or '1815-12-10').
deathDatestringoptionalISO date or partial date.
gender'male' | 'female' | 'other'optionalUsed for visual styling and GEDCOM export.
prefixstringoptionalName prefix such as 'Dr.' or 'Sir'.
suffixstringoptionalName suffix such as 'Jr.' or 'III'.
tagsstring[]optionalFree-form labels.
aliasesstring[]optionalAlternate or former names (maiden name, nickname, anglicized spelling).
storystringoptionalLong-form biography. Markdown is supported in the UI.
profileMediaIdstringoptionalId of the media item used as this person's profile picture.

Relationship

Discriminated by type.

Parent-child

FieldTypeRequiredDescription
idstringrequiredStable identifier.
type"parent-child"requiredDiscriminator.
parentIdstringrequiredPerson id of the parent.
childIdstringrequiredPerson id of the child.
parentType'biological' | 'adoptive' | 'step' | 'guardian'optionalNature of the parental link.
confidence'certain' | 'probable' | 'possible'optionalHow certain the link is.

Partner

FieldTypeRequiredDescription
idstringrequiredStable identifier.
type"partner"requiredDiscriminator.
astringrequiredOne partner's person id.
bstringrequiredThe other partner's person id.
status'married' | 'divorced' | 'partnered'optionalCurrent state of the partnership.
startYearnumberoptionalYear the partnership began.
endYearnumberoptionalYear the partnership ended.

PersonDetails

One entry per person id. All fields except id are nullable.

FieldTypeRequiredDescription
idstringrequiredMatches a Person id.
birthDatestring | nulloptionalOverrides Person.birthDate when present.
deathDatestring | nulloptionalOverrides Person.deathDate when present.
birthPlacestring | nulloptionalPlace of birth.
deathPlacestring | nulloptionalPlace of death.
burialDatestring | nulloptionalDate of burial.
burialPlacestring | nulloptionalPlace of burial.
baptismDatestring | nulloptionalDate of baptism.
baptismPlacestring | nulloptionalPlace of baptism.
religionstring | nulloptionalReligious affiliation.

PersonEvent

FieldTypeRequiredDescription
idstringrequiredStable identifier.
type'marriage' | 'divorce' | 'census' | 'burial' | 'immigration' | 'newspaper' | 'probate' | 'property' | 'church' | 'record' | 'occupation' | 'residence'requiredEvent category.
datestring | nulloptionalISO date or partial date.
placestring | nulloptionalWhere the event occurred.
summarystring | nulloptionalShort note about the event.
urlstring | nulloptionalLink to a source record.
personIdstring | nulloptionalPerson the event is attached to.
relationshipIdstring | nulloptionalRelationship the event is attached to (e.g. marriage).

PersonMedia

FieldTypeRequiredDescription
idstringrequiredStable identifier.
type'photo' | 'portrait' | 'video' | 'document' | 'link' | 'text'requiredMedia category.
urlstringrequiredDirect URL to the media file. For 'text' items the content lives in body instead.
bodystring | nulloptionalInline content for 'text' items (transcripts, poems, recollections).
titlestring | nulloptionalShort human-readable label shown as the media's display name. Recommended under ~80 characters.
captionstring | nulloptionalLonger descriptive context, transcript snippet, or alt text. Shown beneath the title.
sourcestring | nulloptionalAttribution or archive reference.
sourceUrlstring | nulloptionalLink to the source the item was drawn from.
personIdstring | nulloptionalPerson the media is attached to.
relationshipIdstring | nulloptionalRelationship the media is attached to.

Files you uploaded through the app carry extra server-managed storage fields (storage, status, objectKey, contentType, bytes, width, height, checksum). They round-trip on export and re-import, but you don't set them by hand; for media you author yourself, a url (or body for text) is all you need.

Example

{
  "schemaVersion": "1",
  "meta": {
    "exportedAt": "2026-05-19T12:00:00.000Z",
    "appVersion": "1.12.0",
    "treeName": "My Lineage"
  },
  "data": {
    "people": [
      {
        "id": "p1",
        "name": "Ada Lovelace",
        "birthDate": "1815-12-10",
        "deathDate": "1852-11-27",
        "gender": "female",
        "tags": ["mathematician"],
        "story": "Wrote the first algorithm intended for a machine."
      }
    ],
    "relationships": [
      {
        "id": "r1",
        "type": "parent-child",
        "parentId": "p1",
        "childId": "p2",
        "parentType": "biological",
        "confidence": "certain"
      },
      {
        "id": "r2",
        "type": "partner",
        "a": "p1",
        "b": "p3",
        "status": "married",
        "startYear": 1835
      }
    ],
    "personDetails": [
      {
        "id": "p1",
        "birthPlace": "London, England",
        "religion": "Anglican"
      }
    ],
    "events": [
      {
        "id": "e1",
        "type": "census",
        "date": "1841-06-06",
        "place": "Surrey, England",
        "summary": "1841 UK Census",
        "personId": "p1"
      }
    ],
    "media": [
      {
        "id": "m1",
        "type": "portrait",
        "url": "https://example.com/ada.jpg",
        "title": "Ada at the writing desk",
        "caption": "Portrait, c. 1840, oil on canvas",
        "personId": "p1"
      }
    ]
  }
}

Import behavior

  • Files larger than 25 MB are rejected.
  • Unknown fields on a known object (for example a typo in a person field) are kept but surfaced as warnings in the import preview.
  • The chosen merge strategy controls how the import is reconciled with existing data. Pick a strategy in the Import sidebar before applying.