Skip to content

Latest commit

History

History
2146 lines (1464 loc) · 65.2 KB

File metadata and controls

2146 lines (1464 loc) · 65.2 KB

DocSpring.Client

All URIs are relative to https://sync.api.docspring.com/api/v1

MethodHTTP requestDescription
addFieldsToTemplatePUT /templates/{template_id}/add_fieldsAdd new fields to a Template
batchGeneratePdfsPOST /submissions/batchesGenerate multiple PDFs
combinePdfsPOST /combined_submissionsMerge submission PDFs, template PDFs, or custom files
copyTemplatePOST /templates/{template_id}/copyCopy a template
createCustomFileFromUploadPOST /custom_filesCreate a new custom file from a cached S3 upload
createDataRequestEventPOST /data_requests/{data_request_id}/eventsCreate a new event for emailing a signee a request for signature
createDataRequestTokenPOST /data_requests/{data_request_id}/tokensCreate a new data request token for form authentication
createFolderPOST /folders/Create a folder
createHtmlTemplatePOST /templates?endpoint_variant=create_html_templateCreate a new HTML template
createPdfTemplatePOST /templatesCreate a new PDF template with a form POST file upload
createPdfTemplateFromUploadPOST /templates?endpoint_variant=create_template_from_cached_uploadCreate a new PDF template from a cached S3 file upload
deleteFolderDELETE /folders/{folder_id}Delete a folder
deleteTemplateDELETE /templates/{template_id}Delete a template
expireCombinedSubmissionDELETE /combined_submissions/{combined_submission_id}Expire a combined submission
expireSubmissionDELETE /submissions/{submission_id}Expire a PDF submission
generatePdfPOST /templates/{template_id}/submissionsGenerate a PDF
generatePreviewPOST /submissions/{submission_id}/generate_previewGenerate a preview PDF for partially completed data requests
getCombinedSubmissionGET /combined_submissions/{combined_submission_id}Check the status of a combined submission (merged PDFs)
getDataRequestGET /data_requests/{data_request_id}Look up a submission data request
getFullTemplateGET /templates/{template_id}?full=trueFetch the full attributes for a PDF template
getPresignUrlGET /uploads/presignGet a presigned S3 URL for direct file upload
getSubmissionGET /submissions/{submission_id}Check the status of a PDF
getSubmissionBatchGET /submissions/batches/{submission_batch_id}Check the status of a submission batch job
getTemplateGET /templates/{template_id}Check the status of an uploaded template
getTemplateSchemaGET /templates/{template_id}/schemaFetch the JSON schema for a template
listCombinedSubmissionsGET /combined_submissionsGet a list of all combined submissions
listFoldersGET /folders/Get a list of all folders
listSubmissionsGET /submissionsList all submissions
listTemplateSubmissionsGET /templates/{template_id}/submissionsList all submissions for a given template
listTemplatesGET /templatesGet a list of all templates
moveFolderToFolderPOST /folders/{folder_id}/moveMove a folder
moveTemplateToFolderPOST /templates/{template_id}/moveMove Template to folder
publishTemplateVersionPOST /templates/{template_id}/publish_versionPublish a template version
renameFolderPOST /folders/{folder_id}/renameRename a folder
restoreTemplateVersionPOST /templates/{template_id}/restore_versionRestore a template version
testAuthenticationGET /authenticationTest authentication
updateDataRequestPUT /data_requests/{data_request_id}Update a submission data request
updateTemplatePUT /templates/{template_id}Update a Template
updateTemplateDocumentPUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_postUpdate a template's document with a form POST file upload
updateTemplateDocumentFromUploadPUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_uploadUpdate a template's document with a cached S3 file upload

addFieldsToTemplate

TemplateAddFieldsResponse addFieldsToTemplate(template_id, data)

Add new fields to a Template

Adds fields to a PDF template. Configure field types, positions, defaults, and formatting options.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef02";// String | letdata=newDocSpring.AddFieldsData();// AddFieldsData | apiInstance.addFieldsToTemplate(template_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
dataAddFieldsData

Return type

TemplateAddFieldsResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

batchGeneratePdfs

BatchGeneratePdfs201Response batchGeneratePdfs(data, opts)

Generate multiple PDFs

Generates up to 50 PDFs in a single request. Each submission can use a different template and data. Supports both synchronous (wait for all PDFs) and asynchronous processing. More efficient than individual requests when creating multiple PDFs. See also: - Batch and Combine PDFs - Generate and merge PDFs in one request

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata=newDocSpring.SubmissionBatchData();// SubmissionBatchData | letopts={'wait': true// Boolean | Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)};apiInstance.batchGeneratePdfs(data,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
dataSubmissionBatchData
waitBooleanWait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)[optional] [default to true]

Return type

BatchGeneratePdfs201Response

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

combinePdfs

CreateCombinedSubmissionResponse combinePdfs(data)

Merge submission PDFs, template PDFs, or custom files

Combines multiple PDFs from various sources into a single PDF file. Supports merging submission PDFs, template PDFs, custom files, other merged PDFs, and PDFs from URLs. Merges the PDFs in the order provided.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata=newDocSpring.CombinePdfsData();// CombinePdfsData | apiInstance.combinePdfs(data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
dataCombinePdfsData

Return type

CreateCombinedSubmissionResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

copyTemplate

TemplatePreview copyTemplate(template_id, opts)

Copy a template

Creates a copy of an existing template with all its fields and configuration. Optionally specify a new name and target folder. The copied template starts as a new draft that can be modified independently of the original.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | letopts={'options': newDocSpring.CopyTemplateOptions()// CopyTemplateOptions | };apiInstance.copyTemplate(template_id,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
optionsCopyTemplateOptions[optional]

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createCustomFileFromUpload

CreateCustomFileResponse createCustomFileFromUpload(data)

Create a new custom file from a cached S3 upload

The Custom Files API endpoint allows you to upload PDFs to DocSpring and then merge them with other PDFs. First upload your file using the presigned URL endpoint, then use the returned cache_id to create the custom file.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata=newDocSpring.CreateCustomFileData();// CreateCustomFileData | apiInstance.createCustomFileFromUpload(data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
dataCreateCustomFileData

Return type

CreateCustomFileResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createDataRequestEvent

CreateSubmissionDataRequestEventResponse createDataRequestEvent(data_request_id, event)

Create a new event for emailing a signee a request for signature

Records user notification events for data requests. Use this to create an audit trail showing when and how users were notified about data request forms. Supports email, SMS, and other notification types. Records the notification time for compliance tracking. See also: - Embedded Data Requests Guide - User notification workflow

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata_request_id="drq_1234567890abcdef01";// String | letevent=newDocSpring.CreateSubmissionDataRequestEventRequest();// CreateSubmissionDataRequestEventRequest | apiInstance.createDataRequestEvent(data_request_id,event,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
data_request_idString
eventCreateSubmissionDataRequestEventRequest

Return type

CreateSubmissionDataRequestEventResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createDataRequestToken

CreateSubmissionDataRequestTokenResponse createDataRequestToken(data_request_id, opts)

Create a new data request token for form authentication

Creates an authentication token for accessing a data request form. Tokens can be created for API access (1 hour expiration) or email links (30 day expiration). Returns a token and a pre-authenticated URL for the data request form. See also: - Embedded Data Requests Guide

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata_request_id="drq_1234567890abcdef01";// String | letopts={'type': "api"// String | };apiInstance.createDataRequestToken(data_request_id,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
data_request_idString
typeString[optional]

Return type

CreateSubmissionDataRequestTokenResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

createFolder

Folder createFolder(data)

Create a folder

Creates a new folder for organizing templates. Folders can be nested within other folders by providing a `parent_folder_id`. Folder names must be unique within the same parent.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata=newDocSpring.CreateFolderData();// CreateFolderData | apiInstance.createFolder(data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
dataCreateFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createHtmlTemplate

TemplatePreview createHtmlTemplate(data)

Create a new HTML template

Creates a new HTML template using HTML, CSS/SCSS, and Liquid templating. Allows complete control over PDF layout and styling. Supports headers, footers, and dynamic content using Liquid syntax for field values, conditions, loops, and filters.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata=newDocSpring.CreateHtmlTemplate();// CreateHtmlTemplate | apiInstance.createHtmlTemplate(data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
dataCreateHtmlTemplate

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createPdfTemplate

TemplatePreview createPdfTemplate(template_document, template_name, opts)

Create a new PDF template with a form POST file upload

Creates a new PDF template by uploading a PDF file. The uploaded PDF becomes the foundation for your template, and you can then add fillable fields using the template editor. Use the wait parameter to control whether the request waits for document processing to complete.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_document="/path/to/file";// File | lettemplate_name="template_name_example";// String | letopts={'wait': true,// Boolean | Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)'template_description': "template_description_example",// String | 'template_parent_folder_id': "template_parent_folder_id_example"// String | };apiInstance.createPdfTemplate(template_document,template_name,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_documentFile
template_nameString
waitBooleanWait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)[optional] [default to true]
template_descriptionString[optional]
template_parent_folder_idString[optional]

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

createPdfTemplateFromUpload

TemplatePreview createPdfTemplateFromUpload(data)

Create a new PDF template from a cached S3 file upload

Creates a new PDF template from a file previously uploaded to S3 using a presigned URL. This two-step process allows for more reliable large file uploads by first uploading the file to S3, then creating the template using the cached upload ID.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata=newDocSpring.CreatePdfTemplate();// CreatePdfTemplate | apiInstance.createPdfTemplateFromUpload(data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
dataCreatePdfTemplate

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteFolder

Folder deleteFolder(folder_id)

Delete a folder

Deletes an empty folder. The folder must not contain any templates or subfolders. Move or delete all contents before attempting to delete the folder.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letfolder_id="fld_1234567890abcdef01";// String | apiInstance.deleteFolder(folder_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
folder_idString

Return type

Folder

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

deleteTemplate

TemplateDeleteResponse deleteTemplate(template_id, opts)

Delete a template

Deletes a template or a specific template version. When no version is specified, deletes the entire template including all versions. When a version is specified, deletes only that version while preserving others. Returns remaining version information.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | letopts={'version': "0.1.0"// String | };apiInstance.deleteTemplate(template_id,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
versionString[optional]

Return type

TemplateDeleteResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

expireCombinedSubmission

CombinedSubmission expireCombinedSubmission(combined_submission_id)

Expire a combined submission

Expiring a combined submission deletes the PDF from our system. This is useful for invalidating sensitive documents.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letcombined_submission_id="com_1234567890abcdef01";// String | apiInstance.expireCombinedSubmission(combined_submission_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
combined_submission_idString

Return type

CombinedSubmission

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

expireSubmission

SubmissionPreview expireSubmission(submission_id)

Expire a PDF submission

Expiring a PDF submission deletes the PDF and removes the data from our database. This is useful for invalidating sensitive documents after they've been downloaded. You can also configure a data retention policy for your submissions so that they automatically expire.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letsubmission_id="sub_1234567890abcdef01";// String | apiInstance.expireSubmission(submission_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
submission_idString

Return type

SubmissionPreview

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

generatePdf

CreateSubmissionResponse generatePdf(template_id, submission, opts)

Generate a PDF

Creates a PDF submission by filling in a template with data. Supports both synchronous (default) and asynchronous processing. Set `wait: false` to return immediately. See also: - Customize the PDF Title and Filename - Set custom metadata - Handling Truncated Text - Handle text that doesn't fit in fields

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | letsubmission=newDocSpring.CreatePdfSubmissionData();// CreatePdfSubmissionData | letopts={'wait': true// Boolean | Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)};apiInstance.generatePdf(template_id,submission,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
submissionCreatePdfSubmissionData
waitBooleanWait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)[optional] [default to true]

Return type

CreateSubmissionResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

generatePreview

SuccessErrorResponse generatePreview(submission_id)

Generate a preview PDF for partially completed data requests

Generates a preview PDF for a submission with partially completed data requests. Useful for showing users what the final document will look like before all signatures or data have been collected. The preview includes any data collected so far.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letsubmission_id="sub_1234567890abcdef01";// String | apiInstance.generatePreview(submission_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
submission_idString

Return type

SuccessErrorResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getCombinedSubmission

CombinedSubmission getCombinedSubmission(combined_submission_id)

Check the status of a combined submission (merged PDFs)

Retrieves the details and status of a combined submission. Returns processing state, download URL (if processed), metadata, and information about any integrated actions (e.g., S3 uploads).

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letcombined_submission_id="com_1234567890abcdef01";// String | apiInstance.getCombinedSubmission(combined_submission_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
combined_submission_idString

Return type

CombinedSubmission

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDataRequest

SubmissionDataRequestShow getDataRequest(data_request_id)

Look up a submission data request

Retrieves the details and status of a data request. Returns information about the request state (pending, viewed, completed), authentication details, and metadata. Includes audit information like IP address, browseruser agent, and timestamps. See also: - Embedded Data Requests Guide - Complete guide to data request workflow

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata_request_id="drq_1234567890abcdef01";// String | apiInstance.getDataRequest(data_request_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
data_request_idString

Return type

SubmissionDataRequestShow

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getFullTemplate

Template getFullTemplate(template_id)

Fetch the full attributes for a PDF template

Retrieves complete template information including fields, defaults, settings, and HTML/SCSS content. Use this to get all template data needed for automated updates or analysis. Returns more detailed information than the basic `getTemplate` endpoint.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | apiInstance.getFullTemplate(template_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString

Return type

Template

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getPresignUrl

UploadPresignResponse getPresignUrl()

Get a presigned S3 URL for direct file upload

Returns a presigned S3 URL for uploading files directly to our S3 bucket. Use this endpoint to upload large files before creating templates or custom files. S3 will respond with a JSON object that you can include in your DocSpring API request. Uploaded files can be used to: - Create templates - Update templates - Create custom files and then merge them with other PDFs

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();apiInstance.getPresignUrl((error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

This endpoint does not need any parameter.

Return type

UploadPresignResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getSubmission

Submission getSubmission(submission_id, opts)

Check the status of a PDF

Retrieves the details and status of a PDF submission. Returns processing state, download URL (if processed), metadata, submission data (optional), and information about any integrated actions. Use this to poll for completion when using asynchronous processing.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letsubmission_id="sub_1234567890abcdef01";// String | letopts={'include_data': true// Boolean | };apiInstance.getSubmission(submission_id,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
submission_idString
include_dataBoolean[optional]

Return type

Submission

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getSubmissionBatch

SubmissionBatchWithSubmissions getSubmissionBatch(submission_batch_id, opts)

Check the status of a submission batch job

Retrieves the status and results of a batch PDF generation job. Returns processing state, completion statistics, and optionally includes all individual submission details. Use this to poll for completion when using asynchronous batch processing.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letsubmission_batch_id="sbb_1234567890abcdef01";// String | letopts={'include_submissions': true// Boolean | };apiInstance.getSubmissionBatch(submission_batch_id,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
submission_batch_idString
include_submissionsBoolean[optional]

Return type

SubmissionBatchWithSubmissions

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getTemplate

TemplatePreview getTemplate(template_id)

Check the status of an uploaded template

Retrieves information about a template including processing status and document URL. Use this to check if template is ready to view in the template editor or generate PDFs.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | apiInstance.getTemplate(template_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getTemplateSchema

JsonSchema getTemplateSchema(template_id)

Fetch the JSON schema for a template

Retrieves the JSON Schema definition for a template's fields. Use this to validate data before submitting it for PDF generation, or to build dynamic forms that match the template's field structure and validation requirements. See also: - Generate PDFs Guide - Use schema to validate submission data

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | apiInstance.getTemplateSchema(template_id,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString

Return type

JsonSchema

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listCombinedSubmissions

[CombinedSubmission] listCombinedSubmissions(opts)

Get a list of all combined submissions

Returns a paginated list of combined submissions (merged PDFs) for your account. Includes processing status, expiration details, and download URLs for processed PDFs.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letopts={'page': 3,// Number | Default: 1'per_page': 1// Number | Default: 50};apiInstance.listCombinedSubmissions(opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
pageNumberDefault: 1[optional]
per_pageNumberDefault: 50[optional]

Return type

[CombinedSubmission]

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listFolders

[Folder] listFolders(opts)

Get a list of all folders

Returns a list of folders in your account. Can be filtered by parent folder ID to retrieve subfolders. Folders help organize templates and maintain a hierarchical structure.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letopts={'parent_folder_id': "fld_1234567890abcdef02"// String | Filter By Folder Id};apiInstance.listFolders(opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
parent_folder_idStringFilter By Folder Id[optional]

Return type

[Folder]

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listSubmissions

ListSubmissionsResponse listSubmissions(opts)

List all submissions

Returns a paginated list of all PDF submissions across all templates in your account. Can be filtered by date range and submission type (test/live). Supports cursor-based pagination and optionally includes submission data for each result.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letopts={'cursor': "sub_1234567890abcdef12",// String | 'limit': 3,// Number | 'created_after': "2019-01-01T09:00:00-05:00",// String | 'created_before': "2020-01-01T09:00:00.000+0200",// String | 'type': "test",// String | 'include_data': true// Boolean | };apiInstance.listSubmissions(opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
cursorString[optional]
limitNumber[optional]
created_afterString[optional]
created_beforeString[optional]
typeString[optional]
include_dataBoolean[optional]

Return type

ListSubmissionsResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listTemplateSubmissions

ListSubmissionsResponse listTemplateSubmissions(template_id, opts)

List all submissions for a given template

Returns a paginated list of all submissions for a specific template. Can be filtered by date range, submission type (test/live), and optionally include submission data. Supports cursor-based pagination for efficient retrieval of large result sets.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef02";// String | letopts={'cursor': "cursor_example",// String | 'limit': 56,// Number | 'created_after': "created_after_example",// String | 'created_before': "created_before_example",// String | 'type': "type_example",// String | 'include_data': true// Boolean | };apiInstance.listTemplateSubmissions(template_id,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
cursorString[optional]
limitNumber[optional]
created_afterString[optional]
created_beforeString[optional]
typeString[optional]
include_dataBoolean[optional]

Return type

ListSubmissionsResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

listTemplates

[TemplatePreview] listTemplates(opts)

Get a list of all templates

Retrieves a list of your templates with search, filtering, and pagination options. Returns basic template information including ID, name, type (PDF or HTML), and folder location. Supports text search by name and filtering by parent folder.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letopts={'query': "2",// String | Search By Name'parent_folder_id': "fld_1234567890abcdef01",// String | Filter By Folder Id'page': 2,// Number | Default: 1'per_page': 1// Number | Default: 50};apiInstance.listTemplates(opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
queryStringSearch By Name[optional]
parent_folder_idStringFilter By Folder Id[optional]
pageNumberDefault: 1[optional]
per_pageNumberDefault: 50[optional]

Return type

[TemplatePreview]

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

moveFolderToFolder

Folder moveFolderToFolder(folder_id, data)

Move a folder

Moves a folder to a new parent folder or to the root level. All templates and subfolders within the folder are moved together. Cannot move a folder into one of its own subfolders.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letfolder_id="fld_1234567890abcdef01";// String | letdata=newDocSpring.MoveFolderData();// MoveFolderData | apiInstance.moveFolderToFolder(folder_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
folder_idString
dataMoveFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

moveTemplateToFolder

TemplatePreview moveTemplateToFolder(template_id, data)

Move Template to folder

Moves a template to a different folder or to the root level. Use this to organize templates within your folders. Provide a folder ID to move to a specific folder, or `null` to move to the root level.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | letdata=newDocSpring.MoveTemplateData();// MoveTemplateData | apiInstance.moveTemplateToFolder(template_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
dataMoveTemplateData

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

publishTemplateVersion

TemplatePublishVersionResponse publishTemplateVersion(template_id, data)

Publish a template version

Publishes the current draft version of a template and creates a new immutable version with semantic versioning (major.minor.patch).

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | letdata=newDocSpring.PublishVersionData();// PublishVersionData | apiInstance.publishTemplateVersion(template_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
dataPublishVersionData

Return type

TemplatePublishVersionResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

renameFolder

Folder renameFolder(folder_id, data)

Rename a folder

Renames an existing folder. The new name must be unique within the same parent folder. This operation only changes the folder name, not its location or contents.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letfolder_id="fld_1234567890abcdef01";// String | letdata=newDocSpring.RenameFolderData();// RenameFolderData | apiInstance.renameFolder(folder_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
folder_idString
dataRenameFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

restoreTemplateVersion

SuccessErrorResponse restoreTemplateVersion(template_id, data)

Restore a template version

Restores your template to a previously published version, copying that version's content and configuration to the current draft. Use this to revert changes or recover from an unwanted modification.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | letdata=newDocSpring.RestoreVersionData();// RestoreVersionData | apiInstance.restoreTemplateVersion(template_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
dataRestoreVersionData

Return type

SuccessErrorResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

testAuthentication

SuccessErrorResponse testAuthentication()

Test authentication

Checks whether your API token is valid by making an authenticated request. Returns a success response if authentication passes. This endpoint is useful for verifying credentials during setup or troubleshooting issues.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();apiInstance.testAuthentication((error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

This endpoint does not need any parameter.

Return type

SuccessErrorResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateDataRequest

CreateSubmissionDataRequestResponse updateDataRequest(data_request_id, data)

Update a submission data request

Updates authentication details for a data request. Use this when a user logs in to record their authentication method, provider, session information, and hashed identifiers. Updates metadata and tracks authentication state changes for auditing and compliance.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();letdata_request_id="drq_1234567890abcdef01";// String | letdata=newDocSpring.UpdateSubmissionDataRequestData();// UpdateSubmissionDataRequestData | apiInstance.updateDataRequest(data_request_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
data_request_idString
dataUpdateSubmissionDataRequestData

Return type

CreateSubmissionDataRequestResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateTemplate

SuccessMultipleErrorsResponse updateTemplate(template_id, data)

Update a Template

Updates template content and properties. For HTML templates, you can modify the HTML, SCSS, headers, footers, name, and description. Changes are applied to your draft template and do not affect published template versions.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef03";// String | letdata=newDocSpring.UpdateHtmlTemplate();// UpdateHtmlTemplate | apiInstance.updateTemplate(template_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
dataUpdateHtmlTemplate

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateTemplateDocument

SuccessMultipleErrorsResponse updateTemplateDocument(template_id, template_document, opts)

Update a template's document with a form POST file upload

Upload a new PDF file to update a PDF template's document. This replaces the template's PDF while preserving all of the existing fields. If you upload a PDF with fewer pages than the current document, any fields on the removed pages will be deleted.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | lettemplate_document="/path/to/file";// File | letopts={'template_name': "template_name_example"// String | };apiInstance.updateTemplateDocument(template_id,template_document,opts,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
template_documentFile
template_nameString[optional]

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

updateTemplateDocumentFromUpload

SuccessMultipleErrorsResponse updateTemplateDocumentFromUpload(template_id, data)

Update a template's document with a cached S3 file upload

Updates a PDF template's document using a cached file upload. This is a three-step process: First, request a presigned URL to upload your PDF file to our S3 bucket. Then, use that URL to upload your PDF file. Finally, submit the ID of the uploaded file to replace the template's document.

Example

importDocSpringfrom'docspring';letdefaultClient=DocSpring.ApiClient.instance;// Configure HTTP basic authorization: api_token_basicletapi_token_basic=defaultClient.authentications['api_token_basic'];api_token_basic.username='YOUR USERNAME';api_token_basic.password='YOUR PASSWORD';letapiInstance=newDocSpring.Client();lettemplate_id="tpl_1234567890abcdef01";// String | letdata=newDocSpring.UpdatePdfTemplate();// UpdatePdfTemplate | apiInstance.updateTemplateDocumentFromUpload(template_id,data,(error,data,response)=>{if(error){console.error(error);}else{console.log('API called successfully. Returned data: '+data);}});

Parameters

NameTypeDescriptionNotes
template_idString
dataUpdatePdfTemplate

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json