Skip to content

Commit e359657

Browse files
committed
Update to version 4.2.0 on 2026-10-29
- **BREAKING CHANGE**: list_templates returns a shorter `TemplateSummary`: a template's name, description, type, folder (`parent_folder_id`, `path`), latest published version, whether it's `ready`, and its PDF's file name, state, error and page count (`document`, a `TemplateDocumentSummary`). get_template returns its settings and the rest. - **BREAKING CHANGE**: list_submissions and list_template_submissions return `SubmissionSummary` instead of `Submission`: without signature requests and uploads, with `data` only when you pass `include_data` (as before), and with `files` only when you pass the new `include_files` (without the links to page images). get_submission returns the whole submission. - New: the template webhook events (version 4) send the whole template, as get_template returns it, without its `embed_edit_token`. They sent the settings without the rest. - New: list_submissions and list_template_submissions take a `state` filter: one state, such as `invalid_data` or `error`. - New: get_template_model_code takes `just_types`, for the types alone, without the code that converts and checks JSON (TypeScript, Ruby, Python, Java, C#, Elixir and Go: JavaScript and PHP code is the same either way). - New: create_submission, create_submission_batch and create_combined_pdf take an `Idempotency-Key` header. A request repeated with the same key within 24 hours returns the first response and creates nothing. The same key with a different request is a 422, and a repeat while the first request is still running is a 409. - New: create_template_preview and get_template_preview fill an HTML or PDF template's draft (or a published version) with your data and return PNG images of its pages, not a PDF, so you can check how it prints before you publish it or send live data. A preview creates no submission and uses no credits. Get the preview until its `state` is `processed`. Previews are watermarked like test PDFs. - New: HTML templates' `html_escape_data` setting HTML-escapes the values they print (`{{ value }}`). It's on for new templates and off for existing ones; `{{ value | raw }}` prints a value as it is. - New: `docspring.verify_webhook_signature(payload, signature_header, secret)` (the payload as `str` or `bytes`) checks a webhook request's `X-DocSpring-Signature` header. Pass it the request body exactly as it was received. It returns true or false, accepts any `v1` that matches and rejects a timestamp more than 5 minutes old (`tolerance=` for another tolerance). - publish_template_version answers 409 when the draft hasn't changed since the latest published version, instead of publishing a copy of it (code `conflict`). A template's first publish always works. - Every operation documents the 429 rate limit response (with `Retry-After`), and the creates that the sync hosts wait for document their 504 (the record was saved: get it by the ID in the error). - Every optional field takes `null` in a submission's `data`, whatever its type, so model code that writes missing values as null works. A null checkbox or group of fields (an object or a list) gets its defaults, as a missing key does, and a null text, number, date, image or signature field prints blank, as before. Null in a required field is still an error. - Template and webhook names can be up to 512 characters, up from 255.
1 parent e9e096a commit e359657

68 files changed

Lines changed: 2645 additions & 405 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.openapi-generator/FILES‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ docs/CreateSignatureRequestEventRequest.md
2626
docs/CreateSignatureRequestTokenRequest.md
2727
docs/CreateSubmissionBatchRequest.md
2828
docs/CreateSubmissionRequest.md
29+
docs/CreateTemplatePreviewRequest.md
2930
docs/CreateTemplateRequest.md
3031
docs/CreateWebhookRequest.md
3132
docs/CustomFile.md
@@ -107,6 +108,7 @@ docs/SubmissionList.md
107108
docs/SubmissionSource.md
108109
docs/SubmissionSourcePdf.md
109110
docs/SubmissionState.md
111+
docs/SubmissionSummary.md
110112
docs/SubmissionValidation.md
111113
docs/Template.md
112114
docs/TemplateActor.md
@@ -117,6 +119,7 @@ docs/TemplateDiff.md
117119
docs/TemplateDiffSummary.md
118120
docs/TemplateDocument.md
119121
docs/TemplateDocumentState.md
122+
docs/TemplateDocumentSummary.md
120123
docs/TemplateFieldChange.md
121124
docs/TemplateFieldChanges.md
122125
docs/TemplateFieldDependency.md
@@ -137,6 +140,8 @@ docs/TemplatePageFieldsStatus.md
137140
docs/TemplatePageImageStatus.md
138141
docs/TemplatePageImages.md
139142
docs/TemplatePageProcessingStatus.md
143+
docs/TemplatePreview.md
144+
docs/TemplatePreviewState.md
140145
docs/TemplateSourcePdf.md
141146
docs/TemplateSummary.md
142147
docs/TemplateSummaryList.md
@@ -190,6 +195,7 @@ docspring/models/create_signature_request_event_request.py
190195
docspring/models/create_signature_request_token_request.py
191196
docspring/models/create_submission_batch_request.py
192197
docspring/models/create_submission_request.py
198+
docspring/models/create_template_preview_request.py
193199
docspring/models/create_template_request.py
194200
docspring/models/create_webhook_request.py
195201
docspring/models/custom_file.py
@@ -271,6 +277,7 @@ docspring/models/submission_list.py
271277
docspring/models/submission_source.py
272278
docspring/models/submission_source_pdf.py
273279
docspring/models/submission_state.py
280+
docspring/models/submission_summary.py
274281
docspring/models/submission_validation.py
275282
docspring/models/template.py
276283
docspring/models/template_actor.py
@@ -281,6 +288,7 @@ docspring/models/template_diff.py
281288
docspring/models/template_diff_summary.py
282289
docspring/models/template_document.py
283290
docspring/models/template_document_state.py
291+
docspring/models/template_document_summary.py
284292
docspring/models/template_field_change.py
285293
docspring/models/template_field_changes.py
286294
docspring/models/template_field_dependency.py
@@ -301,6 +309,8 @@ docspring/models/template_page_fields_status.py
301309
docspring/models/template_page_image_status.py
302310
docspring/models/template_page_images.py
303311
docspring/models/template_page_processing_status.py
312+
docspring/models/template_preview.py
313+
docspring/models/template_preview_state.py
304314
docspring/models/template_source_pdf.py
305315
docspring/models/template_summary.py
306316
docspring/models/template_summary_list.py
@@ -356,6 +366,7 @@ test/test_create_signature_request_event_request.py
356366
test/test_create_signature_request_token_request.py
357367
test/test_create_submission_batch_request.py
358368
test/test_create_submission_request.py
369+
test/test_create_template_preview_request.py
359370
test/test_create_template_request.py
360371
test/test_create_webhook_request.py
361372
test/test_custom_file.py
@@ -437,6 +448,7 @@ test/test_submission_list.py
437448
test/test_submission_source.py
438449
test/test_submission_source_pdf.py
439450
test/test_submission_state.py
451+
test/test_submission_summary.py
440452
test/test_submission_validation.py
441453
test/test_template.py
442454
test/test_template_actor.py
@@ -447,6 +459,7 @@ test/test_template_diff.py
447459
test/test_template_diff_summary.py
448460
test/test_template_document.py
449461
test/test_template_document_state.py
462+
test/test_template_document_summary.py
450463
test/test_template_field_change.py
451464
test/test_template_field_changes.py
452465
test/test_template_field_dependency.py
@@ -467,6 +480,8 @@ test/test_template_page_fields_status.py
467480
test/test_template_page_image_status.py
468481
test/test_template_page_images.py
469482
test/test_template_page_processing_status.py
483+
test/test_template_preview.py
484+
test/test_template_preview_state.py
470485
test/test_template_source_pdf.py
471486
test/test_template_summary.py
472487
test/test_template_summary_list.py

‎AGENTS.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ keeps it.
6969
(https://docspring.com/docs/webhooks/overview/). A webhook created with API v2 sends events in API v2's format
7070
(version 4).
7171
- Verify each request's `X-DocSpring-Signature` header before acting on it: an HMAC-SHA256 of `{t}.{raw body}` with the
72-
webhook's signing secret, computed over the raw body exactly as received
73-
(https://docspring.com/docs/webhooks/verifying-signatures/).
72+
webhook's signing secret, where `t` must be within 5 minutes
73+
(https://docspring.com/docs/webhooks/verifying-signatures/). Pass the raw body exactly as received, not parsed JSON,
74+
to `docspring.verify_webhook_signature(payload, signature_header, secret)`, which returns true or false.
7475
- No webhook is sent when a submission starts waiting for credits.
7576

7677
## Signature requests

‎CHANGELOG.md‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
### 4.2.0 [October 29, 2026]
2+
3+
- **BREAKING CHANGE**: list_templates returns a shorter `TemplateSummary`: a template's name, description, type, folder
4+
(`parent_folder_id`, `path`), latest published version, whether it's `ready`, and its PDF's file name, state, error
5+
and page count (`document`, a `TemplateDocumentSummary`). get_template returns its settings and the rest.
6+
- **BREAKING CHANGE**: list_submissions and list_template_submissions return `SubmissionSummary` instead of
7+
`Submission`: without signature requests and uploads, with `data` only when you pass `include_data` (as before), and
8+
with `files` only when you pass the new `include_files` (without the links to page images). get_submission returns the
9+
whole submission.
10+
- New: the template webhook events (version 4) send the whole template, as get_template returns it, without its
11+
`embed_edit_token`. They sent the settings without the rest.
12+
- New: list_submissions and list_template_submissions take a `state` filter: one state, such as `invalid_data` or
13+
`error`.
14+
- New: get_template_model_code takes `just_types`, for the types alone, without the code that converts and checks JSON
15+
(TypeScript, Ruby, Python, Java, C#, Elixir and Go: JavaScript and PHP code is the same either way).
16+
- New: create_submission, create_submission_batch and create_combined_pdf take an `Idempotency-Key` header. A request
17+
repeated with the same key within 24 hours returns the first response and creates nothing. The same key with a
18+
different request is a 422, and a repeat while the first request is still running is a 409.
19+
- New: create_template_preview and get_template_preview fill an HTML or PDF template's draft (or a published version)
20+
with your data and return PNG images of its pages, not a PDF, so you can check how it prints before you publish it or
21+
send live data. A preview creates no submission and uses no credits. Get the preview until its `state` is
22+
`processed`. Previews are watermarked like test PDFs.
23+
- New: HTML templates' `html_escape_data` setting HTML-escapes the values they print (`{{ value }}`). It's on for new
24+
templates and off for existing ones; `{{ value | raw }}` prints a value as it is.
25+
- New: `docspring.verify_webhook_signature(payload, signature_header, secret)` (the payload as `str` or `bytes`) checks
26+
a webhook request's `X-DocSpring-Signature` header. Pass it the request body exactly as it was received. It returns
27+
true or false, accepts any `v1` that matches and rejects a timestamp more than 5 minutes old (`tolerance=` for another
28+
tolerance).
29+
- publish_template_version answers 409 when the draft hasn't changed since the latest published version, instead of
30+
publishing a copy of it (code `conflict`). A template's first publish always works.
31+
- Every operation documents the 429 rate limit response (with `Retry-After`), and the creates that the sync hosts wait
32+
for document their 504 (the record was saved: get it by the ID in the error).
33+
- Every optional field takes `null` in a submission's `data`, whatever its type, so model code that writes missing
34+
values as null works. A null checkbox or group of fields (an object or a list) gets its defaults, as a missing key
35+
does, and a null text, number, date, image or signature field prints blank, as before. Null in a required field is
36+
still an error.
37+
- Template and webhook names can be up to 512 characters, up from 255.
38+
139
### 4.1.0 [October 27, 2026]
240

341
- New: list_template_fields, add_template_fields, update_template_fields, remove_template_fields and

‎README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ templates with your data, generates PDFs from HTML templates, combines PDFs and
99
The code in this repository is generated from DocSpring's OpenAPI spec ([About this SDK](#about-this-sdk)). Issues and
1010
pull requests are welcome.
1111

12-
Version 4.1.0. Requires Python >=3.10.
12+
Version 4.2.0. Requires Python >=3.10.
1313

1414
## Install and configure
1515

@@ -90,6 +90,7 @@ Python code for every method.
9090
| [`create_submission`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#create_submission) | Generate a PDF |
9191
| [`create_submission_batch`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#create_submission_batch) | Generate PDFs in a batch |
9292
| [`create_template`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#create_template) | Create a template |
93+
| [`create_template_preview`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#create_template_preview) | Preview a template with data |
9394
| [`create_webhook`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#create_webhook) | Create a webhook |
9495
| [`delete_custom_file`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#delete_custom_file) | Delete a custom file |
9596
| [`delete_folder`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#delete_folder) | Delete a folder |
@@ -110,6 +111,7 @@ Python code for every method.
110111
| [`get_template_diff`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#get_template_diff) | Compare a version of a template with the one before it |
111112
| [`get_template_model_code`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#get_template_model_code) | Generate typed code for a template's submission data |
112113
| [`get_template_page_images`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#get_template_page_images) | Get images of a template's pages |
114+
| [`get_template_preview`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#get_template_preview) | Get a template preview |
113115
| [`get_template_schema`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#get_template_schema) | Get the JSON Schema of a template's submission data |
114116
| [`get_webhook`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#get_webhook) | Get a webhook |
115117
| [`list_combined_pdfs`](https://github.com/DocSpring/docspring-python/blob/main/docs/Client.md#list_combined_pdfs) | List combined PDFs |
@@ -169,6 +171,7 @@ The fork changes the Python generator:
169171
On top of the generated code, we add:
170172

171173
- A client constructor that reads your credentials, region and host from the environment.
174+
- `docspring.verify_webhook_signature(payload, signature_header, secret)` checks a webhook request's `X-DocSpring-Signature` header, with `tolerance` and `now` keyword arguments.
172175

173176
Each release regenerates every file, so a change made only here would be lost in the next one. Issues and pull
174177
requests are welcome all the same: [open an issue](https://github.com/DocSpring/docspring-python/issues) or a pull request, or email

0 commit comments

Comments
 (0)