Rust API Client
New versions of the DocSpring Rust API client. To install it, see Install an API Client. You can also get these release notes by email.
Changelog
Section titled “Changelog”Released on Oct 31, 2026
- New: Word templates (
template_typedocx). create_template makes one from a Word document (.docx, up to 50 MB) that you upload and pass as acache_id, or pass as adocument_urlordocument_base64; upload_template takes the file itself. update_template_document and upload_template_document replace its document the same ways. Each tag in the document, such as{{ customer.name }}, becomes a field. Each of them takes an OpenDocument text file (.odt) too, which DocSpring converts to a Word document. - New: a Word template’s
output_format, what its submissions make unless they setoutput_formats:docx(a Word document),odt(an OpenDocument file) orpdf. create_template and upload_template require it, and update_template changes it. A Word template that encrypts its PDFs makes PDFs, because Word documents and OpenDocument files can’t be password-protected. - New: the
docxandodtoutput formats, a Word template’s filled-in Word document (files.docx) and OpenDocument file (files.odt, converted from the Word document). Add them tooutput_formatsin create_submission or create_submission_batch to get more than one file, such as the Word document and the PDF. - generate_submission_files takes
pdf, the PDF of a Word template’s submission that didn’t make one (converted from its Word document),docx, the Word document of one that made only its PDF (made again from its data and the template version it used), andodt, its OpenDocument file. None of them uses credits again. Until the new file is ready, itsstateinfilesispending, and when it couldn’t be made, itserror_messagesays why. - A Word template’s
documentis its Word document:document.permanent_urldownloads it. Itsstateisprocessedonce it’s uploaded or downloaded (downloadingordownload_failedwhile adocument_urldownloads,convertingorconversion_failedwhile an OpenDocument file is converted), and get_template_diff’sdocument_changedsays whether it was edited. - get_template_page_images returns a 409 for a Word template, whose pages are only laid out when a document is made.
- create_template_preview previews Word templates too: images of the pages of the PDF that the template’s Word document makes with your data. A DocSpring server that can’t convert Word documents to PDF returns a 409.
Released on Oct 30, 2026
- The first release of the Rust SDK, for API v2.
docspring::Clienthas an async method for every operation (thedocspring::Apitrait), and each one takes its parameters from a builder, such asdocspring::CreateSubmissionParams::builder(). Requires Rust 1.88 or later. docspring::Client::builder()takes the API token and the host or region, anddocspring::Client::from_env()reads them fromDOCSPRING_TOKEN_ID,DOCSPRING_TOKEN_SECRET, andDOCSPRING_HOSTorDOCSPRING_REGION(USorEU).- Every request is checked against the API’s request schemas before it’s sent: one the API would reject fails with
docspring::Error::RequestValidation, which lists each problem.validate_requests(false)on the client builder turns this off. - An error response is decoded into the operation’s error type, by its status code.
- Enums are open: a value this version doesn’t know yet, such as a new submission state, is read as
Unknown(String)instead of failing the response. docspring::verify_webhook_signature(payload, signature_header, secret)checks a webhook request’sX-DocSpring-Signatureheader. Pass it the request body exactly as it was received.- The
mockallfeature addsdocspring::MockApi, a mock of theApitrait for your tests. HTTPS uses rustls by default. For the system’s TLS library, turn off the default features and turn onnative-tls.