Regarding Figma API

I am creating a Gen AI and want to use Figma api for creating a sample template. The Ai will generate output in json / xml so i want that as input in API to create a Figma file with a template can that be done and if yes how also if there is any particular input required to the API that can be changed accordingly.