Template Code Generation

The template editor has a new Code button. It uses quicktype to turn your template's fields into typed model code, so your application can catch mistakes in submission data during development instead of in production.

Code button in the template editor toolbar

Choose TypeScript, JavaScript, Ruby, Python, PHP, Java, C#, Elixir or Go, then copy the code or download it as a file.

Template Code Generator modal

Fetch it with the API

You can also fetch the code from the new model_code API endpoint, for example to regenerate your models in a build step whenever the template changes.

The generated models describe the data object you send when you create a PDF submission. They don't replace the DocSpring API client: build your data with the model, then send it with the client.

Using the embedded template editor? The Code button is hidden there unless you turn on the showCode option.

Read more in Generate Model Code.

All updates

Try DocSpring with your own documents

Upload a PDF or create an HTML template, then fill it from our API. No credit card required.

Start Free Trial