Update Person
update_personUpdate an existing person's names, gender, attributes, addresses, URLs, associations, and links to events, families, citations, notes, media, or tags in a Gramps Web family tree.
Instructions
Change an existing person's names, gender, attributes, addresses, URLs, associations or links to events, families, citations, notes, media and tags. For a new person use create_person; to remove one, delete_object. Links live on one side: an event joins this person here through eventRefs (linkMode add) with the person's role, not on the event; to make the person a child, add them to the family's childRefs with update_family. alternateNames, attributes, addresses and urls replace their whole lists whatever linkMode says; sort reorders events, families, citations or media by date without changing which are linked. 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, though the linked records themselves stay in the tree. Returns the handle and Gramps ID; a missing person returns a not-found message. Writes run one at a time and need a Gramps Web account allowed to edit the tree; a locked or rate-limited write fails with the delay to wait before retrying it. Formats of every argument: get_reference(topic: "input-guide").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Lists to put in date order after the other changes: JSON array ["Events","Citations"] or one string such as "Events | Citations"; names are case-insensitive. Links are only moved, keeping their roles and other metadata; alone it sorts the stored lists. Omit to keep the order (linkMode add appends at the end). Lists: Events, Families, Citations, Media. Events: by event date; 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. Families (this person's marriages and other unions): by the Marriage date, else another marriage event (Engagement, Marriage Banns, …), else the earliest birth of a child. Citations and Media: by their own date; Gramps shows the first media as the person's picture, so sorting Media can change it. Undated families, citations and media go last; equal dates keep their order. | |
| 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 on a person, Family on a family), 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. | |
| 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: a plain string ("Married Name:: Jane|Smith", "Given Middle Surname") or a JSON object (not a quoted JSON string). Object fields: given (or first_name), surname (primary surname value), prefix (particle before the surname: von, de, van, del…), connector (joins compound surnames: - or y), origin_type (Gramps OriginType of that surname: Inherited, Given, Taken, Patronymic, Matronymic, Feudal, Pseudonym, Patrilineal, Matrilineal, Occupation, Location, Unknown), patronymic and matronymic (each stored as a surname entry of its own with that origin), title (Dr./Prof./Sir), suffix (Jr./Sr./III/PhD), call (preferred call name), nick, famnick, type (name type: Birth Name/Married Name/Also Known As/…), name (the whole name as one string, instead of given and surname), and native Gramps fields such as surname_list for several surnames ([{surname, prefix, connector, origintype, primary}], see gramps://input-guide). Name types and origins must be standard Gramps ones or custom ones the tree already uses. camelCase forms (firstName, surnameList, originType) work too; any other field is an error, not ignored. A plain string only splits into given name and surname: use object fields for a patronymic, prefix, title and the like. | |
| mediaHandles | No | Media. Omit to keep; applied per linkMode. Media handles, not Gramps IDs: JSON array ["h1","h2"], one handle, or a comma/semicolon/newline-separated string. To show only part of an image, such as one record on a page scan, give an object {"ref":"…","region":[left, top, right, bottom]} in place of the handle. A region is [left, top, right, bottom]: its edges in percent of the image width and height, 0 to 100, measured from the top-left corner; [10, 20, 60, 45] runs from 10% to 60% across and from 20% to 45% down. [0, 0, 100, 100] shows the whole image again; read_media with the same region shows what it covers. A plain handle keeps the region its link has. In add mode a media already shown keeps its link and takes the region given; to show two regions of one image, list it twice, each with its region. | |
| 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") or name objects. Object fields, as in primaryName: given (or first_name), surname, prefix (von/de/van), connector, origin_type (Gramps OriginType: Inherited, Given, Taken, Patronymic, Matronymic, Feudal, Pseudonym, Patrilineal, Matrilineal, Occupation, Location, Unknown), patronymic and matronymic (each a surname entry of its own), title, suffix (Jr./Sr./III), call, nick, famnick, type (name type), name (the whole name as one string), and native surname_list for several surnames. Name types and origins must be standard Gramps ones or custom ones the tree already uses. camelCase forms work too; any other field is an error, not ignored. 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":"…"}. |