Update Place
update_placeModify an existing place's names, coordinates, type, and links to notes/media/citations in Gramps Web; changes apply to all events at that place.
Instructions
Change an existing place's names, type, coordinates, code, enclosing places or links to notes, media, citations and tags. The change shows on every event at this place: if only one event names the wrong place, give that event another placeHandle with update_event instead. For a new place use create_place; to remove one, delete_object. name, nameLang and nameDate each change one part of the primary name, alternateNames replaces all the other names, and an empty string clears lat, lon or nameDate. 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 with the stored name, type, coordinates and enclosing places; a missing place returns a not-found message, and an unknown type or unreadable date is rejected before anything is saved. 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 |
|---|---|---|---|
| lat | No | Latitude in decimal degrees, north positive (52.2297). Text value. JSON strings are accepted; JSON numbers are also accepted and sent as text. Omit to keep the current value; pass an empty string to remove it. | |
| lon | No | Longitude in decimal degrees, east positive (21.0122). Text value. JSON strings are accepted; JSON numbers are also accepted and sent as text. Omit to keep the current value; pass an empty string to remove it. | |
| code | No | New place code. Omit to leave unchanged. | |
| name | No | New primary name. Omit to leave unchanged. | |
| handle | Yes | The place 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 |
| nameDate | No | When the primary name applies. Omit to keep the current date; pass an empty string to remove it. Gramps shows the first name, primary first, whose date is empty or matches the event date, so an undated primary name hides dated alternate names: date the primary name too ("from 1937-02-10"). Dashes are spans; open "1991-" / "from 1991" are From. Unreadable dates are rejected. | |
| nameLang | No | Language code of the primary name. Omit to leave unchanged. | |
| isPrivate | No | true makes the record private, false public. Omit to leave unchanged. | |
| placeType | No | New place type. Omit to leave unchanged. Must be a standard Gramps type or a custom one the tree already uses; anything else is rejected with suggestions. List: get_reference(topic: "types"). | |
| enclosedBy | No | Places that contain this one. Omit to keep; applied per linkMode. Parent place refs via enclosedBy (not enclosedByHandles): handle or Gramps ID, array of them, JSON array of {ref, date?}, or shorthand "HANDLE::1920-1950" (date optional). Place dashes are spans (from…to); open "1991-" / "from 1991" are From. English months OK: "HANDLE::from 1 Oct 1929 to 27 Sep 1937". Examples: [{ref:"…", date:"1708-1927"}], "HANDLE::1991-", date "1703-1914-08-31". Unrecognized dates fail validation. Smaller region → larger region order. See get_reference(topic: "input-guide", section: "dates"). | |
| 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":"…"}. | |
| 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. | |
| alternateNames | No | Alternate names. Omit to keep; a value replaces the whole list and [] clears it, whatever linkMode says. Alternate place names: array of strings ("Old Name" or "Old Name::de"), simple objects {value, lang?, date?}, or JSON array. Dated example: [{value:"New York", date:"1914-08-31-1924-01-26"}] or date "from 5 Jul 1944". Place dashes are spans (from…to); open "1991-" / "from 1991" are From. Unrecognized dates fail validation (see get_reference(topic: "input-guide", section: "dates")). | |
| 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":"…"}. |