Closed eros404 closed 6 months ago
@eros404 it's possible to add fields using PUT /templates/{id} API but this API is not documented (only form builder UI component is using this API). https://github.com/docusealco/docuseal/blob/master/app/controllers/api/templates_controller.rb#L60
So it's possible to define fields via fields[] list - each field should contain uuid (you can generate it) and submitter_uuid (you can load submitters via /templates/{id}). Field areas should contain attachment_uuid (uuid of the document form the template.schema list).
It's possible to update the entire set of fields - adding/removing specific fields is not possible at the moment. The best way to use it would be if you load existing template fields via /templates/{id} and try to recreate a fields array for PUT request to update some new template.
Let me know if that's sufficient for your use case - alternatively you can use this API to upload a new template PDF and put fields with provided pixel values: https://www.docuseal.co/docs/api#create-a-template-from-existing-pdf
@eros404 please reopen if you need any further assistance with the API. We're not planning to make this api public/documented since there is /template/pdf which can be used to create a new template with fields from an existing PDF file,
Is there a way to add fields to an existing template with the API ?