Update Person
update_personChange an existing person: names, gender, links to events, families, citations, notes, media and tags, attributes, addresses, URLs, associations or the private flag. Pass only what changes; omitted arguments stay as they are.
Instructions
Change an existing person: names, gender, links to events, families, citations, notes, media and tags, attributes, addresses, URLs, associations or the private flag. Pass only what changes; omitted arguments stay as they are. Link lists (…Handles, …Refs) follow linkMode: replace (default) sets the whole list, add appends, remove drops the given handles; in replace mode [] REMOVES every link of that kind. Returns the handle and Gramps ID; a missing person returns a not-found message. Links live on one side: to link an event to this person, update the person (linkMode add), not the event. Formats of every argument: get_reference(topic: "input-guide").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | No | URLs. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. URLs: JSON array of {type,path,desc}, or strings "Web Home: https://…" with optional " — note" after URL, or lines/| separated. A type must be a standard Gramps URL type (E-mail, Web Home, Web Search, FTP, Unknown) or a custom one the tree already uses. Grammar: gramps://input-guide. | |
| gender | No | Gender: Female, Male, or Unknown. Omit to leave unchanged. | |
| handle | Yes | The person to change. Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects. | |
| linkMode | No | How to apply all supplied link lists: replace (default) replaces each full list, and a link it keeps keeps its stored privacy, citations, notes and crop unless the call sends new values; add appends missing handles and preserves existing link metadata; remove removes all links matching supplied handles (reference metadata is ignored). Omitted lists stay unchanged; empty lists clear only in replace mode. Does not affect attributes, names, addresses or URLs. Use separate calls to add and remove, or replace to edit existing link metadata. | replace |
| addresses | No | Addresses. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. Addresses: JSON array of Gramps address objects; or text blocks with lines like street:, city:, … (blank line or --- between addresses); or one plain line = street only. Grammar: gramps://input-guide. | |
| eventRefs | No | Events this person takes part in, with roles. In replace mode the list must hold every event the person keeps. Omit to keep; applied per linkMode. Event references (handles, not Gramps IDs): JSON array of {ref, role}, strings "HANDLE::Role" (default role: Primary), comma/pipe/newline-separated, or a single handle. A role must be a standard Gramps role or a custom one the tree already uses; anything else is rejected with suggestions. JSON objects accept snake_case or camelCase list fields (note_list / noteList). | |
| isPrivate | No | true makes the record private, false public. Omit to leave unchanged. | |
| attributes | No | Attributes. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. Attributes: JSON array of objects {type,value,...}, or strings "Type: Value" (first colon), or one string with lines or | between entries. A type must be a standard Gramps attribute type or a custom one the tree already uses; anything else is rejected with suggestions. Full grammar: gramps://input-guide. | |
| sortEvents | No | true sorts all event links by event date after the other changes, keeping each link's role and metadata; alone it sorts the stored list. Undated Birth, Baptism and Christening go first and other undated events last, ending with Death, then Burial and Cremation. On the same date: "before" dates, then Residence and Occupation, Birth, Baptism, other events, Death, Burial, then "after" dates. Default false keeps the order (linkMode add appends at the end). | |
| tagHandles | No | Tags. Omit to keep; applied per linkMode. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. | |
| noteHandles | No | Notes. Omit to keep; applied per linkMode. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. | |
| primaryName | No | New primary name; replaces the whole current one. Omit to leave unchanged. Name: full Gramps name JSON (see gramps://input-guide), a plain string ("Married Name:: Jane|Smith"), or a simple object. Prefer a JSON object (not a quoted JSON string) when using structured name parts. Object fields: given/first (given name), surname/last (primary surname value), prefix/surname_prefix (particle before surname: von, de, van, del…), connector/surname_connector (joins compound surnames: - or y), origin_type/surname_origin (Gramps OriginType for the primary surname: Inherited, Given, Taken, Patronymic, Matronymic, Feudal, Pseudonym, Patrilineal, Matrilineal, Occupation, Location, Unknown), patronymic (shortcut: stored as a separate Patronymic surname entry), matronymic (shortcut: stored as a separate Matronymic surname entry), title (Dr./Prof./Sir), suffix (Jr./Sr./III/PhD), call (preferred call name), nick/nickname, famnick/family_nick, type (name type: Birth Name/Married Name/Also Known As/…). Name types and origins must be standard Gramps ones or custom ones the tree already uses. Plain full-name strings (name/text/full or "Given Middle Surname") only split into given + surname; they cannot create structured name parts such as patronymic, matronymic, prefix, connector, origin_type, title, suffix, call, nick, or famnick. Use object fields or native surname_list instead. For complex multi-surname cases use native Gramps surname_list format. Also accepts: name/text/full as a full-name string with optional type field. | |
| mediaHandles | No | Media. Omit to keep; applied per linkMode. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. | |
| familyHandles | No | Families where this person is a parent or spouse. Omit to keep; applied per linkMode. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. | |
| alternateNames | No | Alternate names. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. Alternate names: array of strings ("Married Name:: Jane|Smith"), simple objects, or full Gramps name objects. Object fields: given/first, surname/last, prefix/surname_prefix (von/de/van), connector/surname_connector, origin_type/surname_origin (Gramps OriginType: Inherited, Given, Taken, Patronymic, Matronymic, Feudal, Pseudonym, Patrilineal, Matrilineal, Occupation, Location, Unknown), patronymic (→ separate Patronymic surname entry), matronymic (→ separate Matronymic surname entry), title, suffix (Jr./Sr./III), call, nick, famnick, type (name type). Name types and origins must be standard Gramps ones or custom ones the tree already uses. For multi-surname names use native surname_list format. Multiple names in one string: separate with newlines (not |). | |
| citationHandles | No | Citations. Omit to keep; applied per linkMode. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. | |
| personAssociations | No | Associations with other people (godfather, friend, …). Omit to keep; applied per linkMode. Person associations (handles, not Gramps IDs): JSON array of {ref, rel, ...}, or strings "PERSON_HANDLE:: Godfather" (double colon after handle). JSON objects accept rel or relationship, and snake_case or camelCase list fields (note_list / noteList). Grammar: gramps://input-guide. | |
| parentFamilyHandles | No | Families where this person is a child. Omit to keep; applied per linkMode. Handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string; entries may also be objects {"ref":"…"}. |