Create Records
create_recordsCreate many linked genealogy records in one atomic transaction—people, families, events, places, sources, citations, notes and repositories—and link them together by #key.
Instructions
Create many linked records in one call: repositories, places, sources, notes, citations, events, people and families. Gramps Web saves them in one transaction, so either all are created or none, and undo_change on that transaction (get_recent_changes) removes them all again. Give a record that others link to a key and write "#key" wherever a handle is taken: a citation's sourceHandle "#src", an event's citationHandles ["#cit"], a person's eventRefs ["#birth"], a family's fatherHandle "#ivan" and childRefs ["#petr"]. Existing records are linked by handle, or by Gramps ID where the create tool accepts one. Each record takes the arguments of its create tool (create_person, create_event, …), except that people join families only through families: a new family's father, mother and children get the link back. Links from existing records to new ones, such as a new child of an existing family, are made afterwards with update_* and linkMode "add". Media and tags are not created here: create them first with create_media and create_tag. Each new person is checked for duplicates in the tree as in create_person: a possible duplicate stops the whole call with action "refused", and notDuplicateOf on that person lets it through; other record types are not checked, so search first. Up to 50 records per call; every record is checked before anything is saved, and an error names the record, e.g. people[1]. Returns each record's handle and Gramps ID. 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 |
|---|---|---|---|
| notes | No | New notes; fields as in create_note. Other records link them through noteHandles. | |
| events | No | New events; fields as in create_event. People and families link them through eventRefs. | |
| people | No | New people; fields as in create_person, without familyHandles and parentFamilyHandles: name a person in a family's fatherHandle, motherHandle or childRefs instead. | |
| places | No | New places; fields as in create_place. enclosedBy may name a place of this call by "#key". | |
| sources | No | New sources; fields as in create_source. | |
| families | No | New families; fields as in create_family. They are saved after the people, which get the link back. | |
| citations | No | New citations; fields as in create_citation. Other records link them through citationHandles. | |
| repositories | No | New repositories; fields as in create_repository. |