I use the Canvas API for batch creating questions with different data (e.g., different CSV files created within Python that are uploaded to Canvas), and adding them to a question group: Quiz Questions | Instructure Developer Documentation Portal
Two (or more) students may get the same file, though, as question groups pick random questions with replacement between students. More files and questions would lower that chance, but I'm not usually trying for uniqueness.
What type of file are you giving the students? If it is an Excel file (or other spreadsheet), and you are giving them the same questions, but different numbers, you could implement a pseudo random number generator (such as Lehmer's) where students add their ID numbers to a given cell, and the other cells would change based on these IDs. Just be careful if you are creating several lists of numbers with the same starting seed, to not make the lists somehow correlated unintentionally.