[api2] Add magic and random_key to repo