All updates
API v2
API v2 is live at /api/v2. It checks every request strictly and says exactly what's wrong, returns one error format everywhere, and makes every resource consistent. API v1 keeps working, with the e-signature changes in Safer E-Signatures.
- Strict requests. An unknown property or query parameter, a value of the wrong type or a value outside a list is a
422that points at the value and says how to fix it. Submission data is checked when you create the submission, including barcode values, email addresses and field overrides, instead of failing later when the PDF is generated. - One error format,
{"error": {"code", "message", "details", "request_id"}}, for every error. - Consistent resources. Responses are the resource itself, every list is cursor-paginated, creates return
201, and every name is snake_case. - Signature requests. Data requests are now called signature requests, and a signer's
rolereplaces v1'sskippedplaceholders. - Webhooks created with v2 send each event's resource as v2 returns it.
API v2 also has endpoints that API v1 doesn't:
- Check before you create.
validateSubmissionchecks a submission's data and settings as creating it would, without creating it or using credits. - Images of the pages. Add
pngto a submission'soutput_formatsfor an image of each page of its PDF, or add the images to a processed submission withgenerateSubmissionFiles.getTemplatePageImagesreturns an image of each page of a template. - Templates from a URL. Create a template, or replace its PDF, from a
document_urlthat DocSpring downloads, or send the PDF asdocument_base64. - Template diffs.
getTemplateDiffshows what changed in a template's draft since its last published version.
Our SDKs use API v2 from version 4.0.0, and 4.1.0 adds the endpoints above. Each SDK checks a request against the API's own rules before sending it, so most mistakes show up in your code before they reach DocSpring.
Migrating to API v2 lists every difference from v1.