All URIs are relative to https://sync.api.docspring.com/api/v1
| Method | HTTP request | Description |
|---|---|---|
| addFieldsToTemplate | PUT /templates/{template_id}/add_fields | Add new fields to a Template |
| batchGeneratePdfs | POST /submissions/batches | Generate multiple PDFs |
| combinePdfs | POST /combined_submissions | Merge submission PDFs, template PDFs, or custom files |
| copyTemplate | POST /templates/{template_id}/copy | Copy a template |
| createCustomFileFromUpload | POST /custom_files | Create a new custom file from a cached S3 upload |
| createDataRequestEvent | POST /data_requests/{data_request_id}/events | Create a new event for emailing a signee a request for signature |
| createDataRequestToken | POST /data_requests/{data_request_id}/tokens | Create a new data request token for form authentication |
| createFolder | POST /folders/ | Create a folder |
| createHtmlTemplate | POST /templates?endpoint_variant=create_html_template | Create a new HTML template |
| createPdfTemplate | POST /templates | Create a new PDF template with a form POST file upload |
| createPdfTemplateFromUpload | POST /templates?endpoint_variant=create_template_from_cached_upload | Create a new PDF template from a cached S3 file upload |
| deleteFolder | DELETE /folders/{folder_id} | Delete a folder |
| deleteTemplate | DELETE /templates/{template_id} | Delete a template |
| expireCombinedSubmission | DELETE /combined_submissions/{combined_submission_id} | Expire a combined submission |
| expireSubmission | DELETE /submissions/{submission_id} | Expire a PDF submission |
| generatePdf | POST /templates/{template_id}/submissions | Generate a PDF |
| generatePreview | POST /submissions/{submission_id}/generate_preview | Generate a preview PDF for partially completed data requests |
| getCombinedSubmission | GET /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs) |
| getDataRequest | GET /data_requests/{data_request_id} | Look up a submission data request |
| getFullTemplate | GET /templates/{template_id}?full=true | Fetch the full attributes for a PDF template |
| getPresignUrl | GET /uploads/presign | Get a presigned S3 URL for direct file upload |
| getSubmission | GET /submissions/{submission_id} | Check the status of a PDF |
| getSubmissionBatch | GET /submissions/batches/{submission_batch_id} | Check the status of a submission batch job |
| getTemplate | GET /templates/{template_id} | Check the status of an uploaded template |
| getTemplateSchema | GET /templates/{template_id}/schema | Fetch the JSON schema for a template |
| listCombinedSubmissions | GET /combined_submissions | Get a list of all combined submissions |
| listFolders | GET /folders/ | Get a list of all folders |
| listSubmissions | GET /submissions | List all submissions |
| listTemplateSubmissions | GET /templates/{template_id}/submissions | List all submissions for a given template |
| listTemplates | GET /templates | Get a list of all templates |
| moveFolderToFolder | POST /folders/{folder_id}/move | Move a folder |
| moveTemplateToFolder | POST /templates/{template_id}/move | Move Template to folder |
| publishTemplateVersion | POST /templates/{template_id}/publish_version | Publish a template version |
| renameFolder | POST /folders/{folder_id}/rename | Rename a folder |
| restoreTemplateVersion | POST /templates/{template_id}/restore_version | Restore a template version |
| testAuthentication | GET /authentication | Test authentication |
| updateDataRequest | PUT /data_requests/{data_request_id} | Update a submission data request |
| updateTemplate | PUT /templates/{template_id} | Update a Template |
| updateTemplateDocument | PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_post | Update a template's document with a form POST file upload |
| updateTemplateDocumentFromUpload | PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload | Update a template's document with a cached S3 file upload |
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef02"; // String |
let data = new DocSpring.AddFieldsData(); // AddFieldsData |
apiInstance.addFieldsToTemplate(template_id, data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| data | AddFieldsData |
- Content-Type: application/json
- Accept: application/json
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
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data = new DocSpring.SubmissionBatchData(); // SubmissionBatchData |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data | SubmissionBatchData | ||
| wait | Boolean | Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) | [optional] [default to true] |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data = new DocSpring.CombinePdfsData(); // CombinePdfsData |
apiInstance.combinePdfs(data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data | CombinePdfsData |
CreateCombinedSubmissionResponse
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef01"; // String |
let opts = {
'options': new DocSpring.CopyTemplateOptions() // CopyTemplateOptions |
};
apiInstance.copyTemplate(template_id, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| options | CopyTemplateOptions | [optional] |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data = new DocSpring.CreateCustomFileData(); // CreateCustomFileData |
apiInstance.createCustomFileFromUpload(data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data | CreateCustomFileData |
- Content-Type: application/json
- Accept: application/json
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
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data_request_id = "drq_1234567890abcdef01"; // String |
let event = new DocSpring.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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data_request_id | String | ||
| event | CreateSubmissionDataRequestEventRequest |
CreateSubmissionDataRequestEventResponse
- Content-Type: application/json
- Accept: application/json
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
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data_request_id = "drq_1234567890abcdef01"; // String |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data_request_id | String | ||
| type | String | [optional] |
CreateSubmissionDataRequestTokenResponse
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data = new DocSpring.CreateFolderData(); // CreateFolderData |
apiInstance.createFolder(data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data | CreateFolderData |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data = new DocSpring.CreateHtmlTemplate(); // CreateHtmlTemplate |
apiInstance.createHtmlTemplate(data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data | CreateHtmlTemplate |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_document = "/path/to/file"; // File |
let template_name = "template_name_example"; // String |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_document | File | ||
| template_name | String | ||
| wait | Boolean | Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) | [optional] [default to true] |
| template_description | String | [optional] | |
| template_parent_folder_id | String | [optional] |
- Content-Type: multipart/form-data
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data = new DocSpring.CreatePdfTemplate(); // CreatePdfTemplate |
apiInstance.createPdfTemplateFromUpload(data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data | CreatePdfTemplate |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let folder_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| folder_id | String |
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef01"; // String |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| version | String | [optional] |
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let combined_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| combined_submission_id | String |
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let submission_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| submission_id | String |
- Content-Type: Not defined
- Accept: application/json
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
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef01"; // String |
let submission = new DocSpring.CreatePdfSubmissionData(); // CreatePdfSubmissionData |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| submission | CreatePdfSubmissionData | ||
| wait | Boolean | Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) | [optional] [default to true] |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let submission_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| submission_id | String |
- Content-Type: Not defined
- Accept: application/json
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).
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let combined_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| combined_submission_id | String |
- Content-Type: Not defined
- Accept: application/json
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
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data_request_id | String |
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String |
- Content-Type: Not defined
- Accept: application/json
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
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
apiInstance.getPresignUrl((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let submission_id = "sub_1234567890abcdef01"; // String |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| submission_id | String | ||
| include_data | Boolean | [optional] |
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let submission_batch_id = "sbb_1234567890abcdef01"; // String |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| submission_batch_id | String | ||
| include_submissions | Boolean | [optional] |
SubmissionBatchWithSubmissions
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String |
- Content-Type: Not defined
- Accept: application/json
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
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String |
- Content-Type: Not defined
- Accept: application/json
[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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| page | Number | Default: 1 | [optional] |
| per_page | Number | Default: 50 | [optional] |
- Content-Type: Not defined
- Accept: application/json
[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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| parent_folder_id | String | Filter By Folder Id | [optional] |
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| cursor | String | [optional] | |
| limit | Number | [optional] | |
| created_after | String | [optional] | |
| created_before | String | [optional] | |
| type | String | [optional] | |
| include_data | Boolean | [optional] |
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef02"; // String |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| cursor | String | [optional] | |
| limit | Number | [optional] | |
| created_after | String | [optional] | |
| created_before | String | [optional] | |
| type | String | [optional] | |
| include_data | Boolean | [optional] |
- Content-Type: Not defined
- Accept: application/json
[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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| query | String | Search By Name | [optional] |
| parent_folder_id | String | Filter By Folder Id | [optional] |
| page | Number | Default: 1 | [optional] |
| per_page | Number | Default: 50 | [optional] |
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let folder_id = "fld_1234567890abcdef01"; // String |
let data = new DocSpring.MoveFolderData(); // MoveFolderData |
apiInstance.moveFolderToFolder(folder_id, data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| folder_id | String | ||
| data | MoveFolderData |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef01"; // String |
let data = new DocSpring.MoveTemplateData(); // MoveTemplateData |
apiInstance.moveTemplateToFolder(template_id, data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| data | MoveTemplateData |
- Content-Type: application/json
- Accept: application/json
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).
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef01"; // String |
let data = new DocSpring.PublishVersionData(); // PublishVersionData |
apiInstance.publishTemplateVersion(template_id, data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| data | PublishVersionData |
TemplatePublishVersionResponse
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let folder_id = "fld_1234567890abcdef01"; // String |
let data = new DocSpring.RenameFolderData(); // RenameFolderData |
apiInstance.renameFolder(folder_id, data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| folder_id | String | ||
| data | RenameFolderData |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef01"; // String |
let data = new DocSpring.RestoreVersionData(); // RestoreVersionData |
apiInstance.restoreTemplateVersion(template_id, data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| data | RestoreVersionData |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
apiInstance.testAuthentication((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let data_request_id = "drq_1234567890abcdef01"; // String |
let data = new DocSpring.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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| data_request_id | String | ||
| data | UpdateSubmissionDataRequestData |
CreateSubmissionDataRequestResponse
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef03"; // String |
let data = new DocSpring.UpdateHtmlTemplate(); // UpdateHtmlTemplate |
apiInstance.updateTemplate(template_id, data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| data | UpdateHtmlTemplate |
- Content-Type: application/json
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef01"; // String |
let template_document = "/path/to/file"; // File |
let opts = {
'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);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| template_document | File | ||
| template_name | String | [optional] |
- Content-Type: multipart/form-data
- Accept: application/json
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.
import DocSpring from 'docspring';
let defaultClient = DocSpring.ApiClient.instance;
// Configure HTTP basic authorization: api_token_basic
let api_token_basic = defaultClient.authentications['api_token_basic'];
api_token_basic.username = 'YOUR USERNAME';
api_token_basic.password = 'YOUR PASSWORD';
let apiInstance = new DocSpring.Client();
let template_id = "tpl_1234567890abcdef01"; // String |
let data = new DocSpring.UpdatePdfTemplate(); // UpdatePdfTemplate |
apiInstance.updateTemplateDocumentFromUpload(template_id, data, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | ||
| data | UpdatePdfTemplate |
- Content-Type: application/json
- Accept: application/json