Hi Siobhan,
API data is returned in json format. you can set up a json data source for Tableau and Tableau will infer a schema from it.
"When you connect Tableau to a JSON file, Tableau scans the data in the first 10,000 rows of the JSON file and infers the schema from that process. Tableau flattens the data using this inferred schema. The JSON file schema levels are listed in the Select Schema Levels dialog box."
https://help.tableau.com/current/pro/desktop/en-us/examplesjson.htm