Can you create and export information to a new Pages file from an app?

Is there an API or has anyone seen swift code in relation to having an app interact with Pages on iPhone/iPad? My app takes inputs from a user and then partially fills out a template. I would like to export that template to a new Pages document for the user to continue filling out the items that the app is not intended to do for them. I can do this to pdf, but then user can't modify (at least not without a full version of acrobat). Thanks.