Nevermind, I was able to figure this out using the documentation for the update_field() function.
Examples are given on that page for inserting/updating ACF fields including the repeater and flexible content fields.
Updating with the field_key
adds all the necessary reference fields as well, so this was much easier than I thought. Thanks!
OK, so I can set the key
field myself and it can be whatever I want it to be as long as it’s unique in the database? That’s perfect. Thanks!