Skip to content

Latest commit

 

History

History
2947 lines (2104 loc) · 85.5 KB

File metadata and controls

2947 lines (2104 loc) · 85.5 KB

DocSpring::Client

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

Method HTTP request Description
add_fields_to_template PUT /templates/{template_id}/add_fields Add new fields to a Template
batch_generate_pdfs POST /submissions/batches Generate multiple PDFs
combine_pdfs POST /combined_submissions Merge submission PDFs, template PDFs, or custom files
copy_template POST /templates/{template_id}/copy Copy a template
create_custom_file_from_upload POST /custom_files Create a new custom file from a cached S3 upload
create_data_request_event POST /data_requests/{data_request_id}/events Create a new event for emailing a signee a request for signature
create_data_request_token POST /data_requests/{data_request_id}/tokens Create a new data request token for form authentication
create_folder POST /folders/ Create a folder
create_html_template POST /templates?endpoint_variant=create_html_template Create a new HTML template
create_pdf_template POST /templates Create a new PDF template with a form POST file upload
create_pdf_template_from_upload POST /templates?endpoint_variant=create_template_from_cached_upload Create a new PDF template from a cached S3 file upload
delete_folder DELETE /folders/{folder_id} Delete a folder
delete_template DELETE /templates/{template_id} Delete a template
expire_combined_submission DELETE /combined_submissions/{combined_submission_id} Expire a combined submission
expire_submission DELETE /submissions/{submission_id} Expire a PDF submission
generate_pdf POST /templates/{template_id}/submissions Generate a PDF
generate_preview POST /submissions/{submission_id}/generate_preview Generate a preview PDF for partially completed data requests
get_combined_submission GET /combined_submissions/{combined_submission_id} Check the status of a combined submission (merged PDFs)
get_data_request GET /data_requests/{data_request_id} Look up a submission data request
get_full_template GET /templates/{template_id}?full=true Fetch the full attributes for a PDF template
get_presign_url GET /uploads/presign Get a presigned S3 URL for direct file upload
get_submission GET /submissions/{submission_id} Check the status of a PDF
get_submission_batch GET /submissions/batches/{submission_batch_id} Check the status of a submission batch job
get_template GET /templates/{template_id} Check the status of an uploaded template
get_template_schema GET /templates/{template_id}/schema Fetch the JSON schema for a template
list_combined_submissions GET /combined_submissions Get a list of all combined submissions
list_folders GET /folders/ Get a list of all folders
list_submissions GET /submissions List all submissions
list_template_submissions GET /templates/{template_id}/submissions List all submissions for a given template
list_templates GET /templates Get a list of all templates
move_folder_to_folder POST /folders/{folder_id}/move Move a folder
move_template_to_folder POST /templates/{template_id}/move Move Template to folder
publish_template_version POST /templates/{template_id}/publish_version Publish a template version
rename_folder POST /folders/{folder_id}/rename Rename a folder
restore_template_version POST /templates/{template_id}/restore_version Restore a template version
test_authentication GET /authentication Test authentication
update_data_request PUT /data_requests/{data_request_id} Update a submission data request
update_template PUT /templates/{template_id} Update a Template
update_template_document PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_post Update a template's document with a form POST file upload
update_template_document_from_upload PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload Update a template's document with a cached S3 file upload

add_fields_to_template

add_fields_to_template(template_id, data)

Add new fields to a Template

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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef02' # String | 
data = DocSpring::AddFieldsData.new({fields: [3.56]}) # AddFieldsData | 

begin
  # Add new fields to a Template
  result = api_instance.add_fields_to_template(template_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->add_fields_to_template: #{e}"
end

Using the add_fields_to_template_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> add_fields_to_template_with_http_info(template_id, data)

begin
  # Add new fields to a Template
  data, status_code, headers = api_instance.add_fields_to_template_with_http_info(template_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplateAddFieldsResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->add_fields_to_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
data AddFieldsData

Return type

TemplateAddFieldsResponse

Authorization

api_token_basic

HTTP request headers

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

batch_generate_pdfs

batch_generate_pdfs(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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data = DocSpring::SubmissionBatchData.new({submissions: [3.56]}) # SubmissionBatchData | 
opts = {
  wait: true # Boolean | Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)
}

begin
  # Generate multiple PDFs
  result = api_instance.batch_generate_pdfs(data, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->batch_generate_pdfs: #{e}"
end

Using the batch_generate_pdfs_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> batch_generate_pdfs_with_http_info(data, opts)

begin
  # Generate multiple PDFs
  data, status_code, headers = api_instance.batch_generate_pdfs_with_http_info(data, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <BatchGeneratePdfs201Response>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->batch_generate_pdfs_with_http_info: #{e}"
end

Parameters

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]

Return type

BatchGeneratePdfs201Response

Authorization

api_token_basic

HTTP request headers

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

combine_pdfs

combine_pdfs(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data = DocSpring::CombinePdfsData.new({source_pdfs: [3.56]}) # CombinePdfsData | 

begin
  # Merge submission PDFs, template PDFs, or custom files
  result = api_instance.combine_pdfs(data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->combine_pdfs: #{e}"
end

Using the combine_pdfs_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> combine_pdfs_with_http_info(data)

begin
  # Merge submission PDFs, template PDFs, or custom files
  data, status_code, headers = api_instance.combine_pdfs_with_http_info(data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateCombinedSubmissionResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->combine_pdfs_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data CombinePdfsData

Return type

CreateCombinedSubmissionResponse

Authorization

api_token_basic

HTTP request headers

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

copy_template

copy_template(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 
opts = {
  options: DocSpring::CopyTemplateOptions.new({parent_folder_id: 'parent_folder_id_example'}) # CopyTemplateOptions | 
}

begin
  # Copy a template
  result = api_instance.copy_template(template_id, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->copy_template: #{e}"
end

Using the copy_template_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> copy_template_with_http_info(template_id, opts)

begin
  # Copy a template
  data, status_code, headers = api_instance.copy_template_with_http_info(template_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplatePreview>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->copy_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
options CopyTemplateOptions [optional]

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

create_custom_file_from_upload

create_custom_file_from_upload(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data = DocSpring::CreateCustomFileData.new({cache_id: 'cache_id_example'}) # CreateCustomFileData | 

begin
  # Create a new custom file from a cached S3 upload
  result = api_instance.create_custom_file_from_upload(data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_custom_file_from_upload: #{e}"
end

Using the create_custom_file_from_upload_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_custom_file_from_upload_with_http_info(data)

begin
  # Create a new custom file from a cached S3 upload
  data, status_code, headers = api_instance.create_custom_file_from_upload_with_http_info(data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateCustomFileResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_custom_file_from_upload_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data CreateCustomFileData

Return type

CreateCustomFileResponse

Authorization

api_token_basic

HTTP request headers

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

create_data_request_event

create_data_request_event(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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data_request_id = 'drq_1234567890abcdef01' # String | 
event = DocSpring::CreateSubmissionDataRequestEventRequest.new({event_type: 'send_request'}) # CreateSubmissionDataRequestEventRequest | 

begin
  # Create a new event for emailing a signee a request for signature
  result = api_instance.create_data_request_event(data_request_id, event)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_data_request_event: #{e}"
end

Using the create_data_request_event_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_data_request_event_with_http_info(data_request_id, event)

begin
  # Create a new event for emailing a signee a request for signature
  data, status_code, headers = api_instance.create_data_request_event_with_http_info(data_request_id, event)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateSubmissionDataRequestEventResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_data_request_event_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data_request_id String
event CreateSubmissionDataRequestEventRequest

Return type

CreateSubmissionDataRequestEventResponse

Authorization

api_token_basic

HTTP request headers

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

create_data_request_token

create_data_request_token(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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data_request_id = 'drq_1234567890abcdef01' # String | 
opts = {
  type: 'api' # String | 
}

begin
  # Create a new data request token for form authentication
  result = api_instance.create_data_request_token(data_request_id, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_data_request_token: #{e}"
end

Using the create_data_request_token_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_data_request_token_with_http_info(data_request_id, opts)

begin
  # Create a new data request token for form authentication
  data, status_code, headers = api_instance.create_data_request_token_with_http_info(data_request_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateSubmissionDataRequestTokenResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_data_request_token_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data_request_id String
type String [optional]

Return type

CreateSubmissionDataRequestTokenResponse

Authorization

api_token_basic

HTTP request headers

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

create_folder

create_folder(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data = DocSpring::CreateFolderData.new({folder: 3.56}) # CreateFolderData | 

begin
  # Create a folder
  result = api_instance.create_folder(data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_folder: #{e}"
end

Using the create_folder_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_folder_with_http_info(data)

begin
  # Create a folder
  data, status_code, headers = api_instance.create_folder_with_http_info(data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Folder>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_folder_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data CreateFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

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

create_html_template

create_html_template(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data = DocSpring::CreateHtmlTemplate.new({template: 3.56}) # CreateHtmlTemplate | 

begin
  # Create a new HTML template
  result = api_instance.create_html_template(data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_html_template: #{e}"
end

Using the create_html_template_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_html_template_with_http_info(data)

begin
  # Create a new HTML template
  data, status_code, headers = api_instance.create_html_template_with_http_info(data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplatePreview>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_html_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data CreateHtmlTemplate

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

create_pdf_template

create_pdf_template(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_document = File.new('/path/to/some/file') # File | 
template_name = 'template_name_example' # String | 
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 | 
}

begin
  # Create a new PDF template with a form POST file upload
  result = api_instance.create_pdf_template(template_document, template_name, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_pdf_template: #{e}"
end

Using the create_pdf_template_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_pdf_template_with_http_info(template_document, template_name, opts)

begin
  # Create a new PDF template with a form POST file upload
  data, status_code, headers = api_instance.create_pdf_template_with_http_info(template_document, template_name, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplatePreview>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_pdf_template_with_http_info: #{e}"
end

Parameters

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]

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

create_pdf_template_from_upload

create_pdf_template_from_upload(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data = DocSpring::CreatePdfTemplate.new({template: 3.56}) # CreatePdfTemplate | 

begin
  # Create a new PDF template from a cached S3 file upload
  result = api_instance.create_pdf_template_from_upload(data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_pdf_template_from_upload: #{e}"
end

Using the create_pdf_template_from_upload_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_pdf_template_from_upload_with_http_info(data)

begin
  # Create a new PDF template from a cached S3 file upload
  data, status_code, headers = api_instance.create_pdf_template_from_upload_with_http_info(data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplatePreview>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->create_pdf_template_from_upload_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data CreatePdfTemplate

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

delete_folder

delete_folder(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
folder_id = 'fld_1234567890abcdef01' # String | 

begin
  # Delete a folder
  result = api_instance.delete_folder(folder_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->delete_folder: #{e}"
end

Using the delete_folder_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> delete_folder_with_http_info(folder_id)

begin
  # Delete a folder
  data, status_code, headers = api_instance.delete_folder_with_http_info(folder_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Folder>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->delete_folder_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
folder_id String

Return type

Folder

Authorization

api_token_basic

HTTP request headers

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

delete_template

delete_template(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 
opts = {
  version: '0.1.0' # String | 
}

begin
  # Delete a template
  result = api_instance.delete_template(template_id, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->delete_template: #{e}"
end

Using the delete_template_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> delete_template_with_http_info(template_id, opts)

begin
  # Delete a template
  data, status_code, headers = api_instance.delete_template_with_http_info(template_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplateDeleteResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->delete_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
version String [optional]

Return type

TemplateDeleteResponse

Authorization

api_token_basic

HTTP request headers

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

expire_combined_submission

expire_combined_submission(combined_submission_id)

Expire a combined submission

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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
combined_submission_id = 'com_1234567890abcdef01' # String | 

begin
  # Expire a combined submission
  result = api_instance.expire_combined_submission(combined_submission_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->expire_combined_submission: #{e}"
end

Using the expire_combined_submission_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> expire_combined_submission_with_http_info(combined_submission_id)

begin
  # Expire a combined submission
  data, status_code, headers = api_instance.expire_combined_submission_with_http_info(combined_submission_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CombinedSubmission>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->expire_combined_submission_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
combined_submission_id String

Return type

CombinedSubmission

Authorization

api_token_basic

HTTP request headers

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

expire_submission

expire_submission(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
submission_id = 'sub_1234567890abcdef01' # String | 

begin
  # Expire a PDF submission
  result = api_instance.expire_submission(submission_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->expire_submission: #{e}"
end

Using the expire_submission_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> expire_submission_with_http_info(submission_id)

begin
  # Expire a PDF submission
  data, status_code, headers = api_instance.expire_submission_with_http_info(submission_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SubmissionPreview>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->expire_submission_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
submission_id String

Return type

SubmissionPreview

Authorization

api_token_basic

HTTP request headers

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

generate_pdf

generate_pdf(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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 
submission = DocSpring::CreatePdfSubmissionData.new({data: 3.56}) # CreatePdfSubmissionData | 
opts = {
  wait: true # Boolean | Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)
}

begin
  # Generate a PDF
  result = api_instance.generate_pdf(template_id, submission, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->generate_pdf: #{e}"
end

Using the generate_pdf_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> generate_pdf_with_http_info(template_id, submission, opts)

begin
  # Generate a PDF
  data, status_code, headers = api_instance.generate_pdf_with_http_info(template_id, submission, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateSubmissionResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->generate_pdf_with_http_info: #{e}"
end

Parameters

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]

Return type

CreateSubmissionResponse

Authorization

api_token_basic

HTTP request headers

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

generate_preview

generate_preview(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
submission_id = 'sub_1234567890abcdef01' # String | 

begin
  # Generate a preview PDF for partially completed data requests
  result = api_instance.generate_preview(submission_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->generate_preview: #{e}"
end

Using the generate_preview_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> generate_preview_with_http_info(submission_id)

begin
  # Generate a preview PDF for partially completed data requests
  data, status_code, headers = api_instance.generate_preview_with_http_info(submission_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SuccessErrorResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->generate_preview_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
submission_id String

Return type

SuccessErrorResponse

Authorization

api_token_basic

HTTP request headers

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

get_combined_submission

get_combined_submission(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).

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
combined_submission_id = 'com_1234567890abcdef01' # String | 

begin
  # Check the status of a combined submission (merged PDFs)
  result = api_instance.get_combined_submission(combined_submission_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_combined_submission: #{e}"
end

Using the get_combined_submission_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_combined_submission_with_http_info(combined_submission_id)

begin
  # Check the status of a combined submission (merged PDFs)
  data, status_code, headers = api_instance.get_combined_submission_with_http_info(combined_submission_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CombinedSubmission>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_combined_submission_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
combined_submission_id String

Return type

CombinedSubmission

Authorization

api_token_basic

HTTP request headers

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

get_data_request

get_data_request(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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data_request_id = 'drq_1234567890abcdef01' # String | 

begin
  # Look up a submission data request
  result = api_instance.get_data_request(data_request_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_data_request: #{e}"
end

Using the get_data_request_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_data_request_with_http_info(data_request_id)

begin
  # Look up a submission data request
  data, status_code, headers = api_instance.get_data_request_with_http_info(data_request_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SubmissionDataRequestShow>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_data_request_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data_request_id String

Return type

SubmissionDataRequestShow

Authorization

api_token_basic

HTTP request headers

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

get_full_template

get_full_template(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 

begin
  # Fetch the full attributes for a PDF template
  result = api_instance.get_full_template(template_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_full_template: #{e}"
end

Using the get_full_template_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_full_template_with_http_info(template_id)

begin
  # Fetch the full attributes for a PDF template
  data, status_code, headers = api_instance.get_full_template_with_http_info(template_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Template>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_full_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String

Return type

Template

Authorization

api_token_basic

HTTP request headers

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

get_presign_url

get_presign_url

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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new

begin
  # Get a presigned S3 URL for direct file upload
  result = api_instance.get_presign_url
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_presign_url: #{e}"
end

Using the get_presign_url_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_presign_url_with_http_info

begin
  # Get a presigned S3 URL for direct file upload
  data, status_code, headers = api_instance.get_presign_url_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <UploadPresignResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_presign_url_with_http_info: #{e}"
end

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

get_submission

get_submission(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
submission_id = 'sub_1234567890abcdef01' # String | 
opts = {
  include_data: true # Boolean | 
}

begin
  # Check the status of a PDF
  result = api_instance.get_submission(submission_id, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_submission: #{e}"
end

Using the get_submission_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_submission_with_http_info(submission_id, opts)

begin
  # Check the status of a PDF
  data, status_code, headers = api_instance.get_submission_with_http_info(submission_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Submission>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_submission_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
submission_id String
include_data Boolean [optional]

Return type

Submission

Authorization

api_token_basic

HTTP request headers

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

get_submission_batch

get_submission_batch(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
submission_batch_id = 'sbb_1234567890abcdef01' # String | 
opts = {
  include_submissions: true # Boolean | 
}

begin
  # Check the status of a submission batch job
  result = api_instance.get_submission_batch(submission_batch_id, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_submission_batch: #{e}"
end

Using the get_submission_batch_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_submission_batch_with_http_info(submission_batch_id, opts)

begin
  # Check the status of a submission batch job
  data, status_code, headers = api_instance.get_submission_batch_with_http_info(submission_batch_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SubmissionBatchWithSubmissions>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_submission_batch_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
submission_batch_id String
include_submissions Boolean [optional]

Return type

SubmissionBatchWithSubmissions

Authorization

api_token_basic

HTTP request headers

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

get_template

get_template(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 

begin
  # Check the status of an uploaded template
  result = api_instance.get_template(template_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_template: #{e}"
end

Using the get_template_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_template_with_http_info(template_id)

begin
  # Check the status of an uploaded template
  data, status_code, headers = api_instance.get_template_with_http_info(template_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplatePreview>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

get_template_schema

get_template_schema(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

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 

begin
  # Fetch the JSON schema for a template
  result = api_instance.get_template_schema(template_id)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_template_schema: #{e}"
end

Using the get_template_schema_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_template_schema_with_http_info(template_id)

begin
  # Fetch the JSON schema for a template
  data, status_code, headers = api_instance.get_template_schema_with_http_info(template_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <JsonSchema>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->get_template_schema_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String

Return type

JsonSchema

Authorization

api_token_basic

HTTP request headers

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

list_combined_submissions

<Array> list_combined_submissions(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
opts = {
  page: 3, # Integer | Default: 1
  per_page: 1 # Integer | Default: 50
}

begin
  # Get a list of all combined submissions
  result = api_instance.list_combined_submissions(opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_combined_submissions: #{e}"
end

Using the list_combined_submissions_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> list_combined_submissions_with_http_info(opts)

begin
  # Get a list of all combined submissions
  data, status_code, headers = api_instance.list_combined_submissions_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<CombinedSubmission>>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_combined_submissions_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
page Integer Default: 1 [optional]
per_page Integer Default: 50 [optional]

Return type

Array<CombinedSubmission>

Authorization

api_token_basic

HTTP request headers

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

list_folders

<Array> list_folders(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
opts = {
  parent_folder_id: 'fld_1234567890abcdef02' # String | Filter By Folder Id
}

begin
  # Get a list of all folders
  result = api_instance.list_folders(opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_folders: #{e}"
end

Using the list_folders_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> list_folders_with_http_info(opts)

begin
  # Get a list of all folders
  data, status_code, headers = api_instance.list_folders_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<Folder>>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_folders_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
parent_folder_id String Filter By Folder Id [optional]

Return type

Array<Folder>

Authorization

api_token_basic

HTTP request headers

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

list_submissions

list_submissions(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
opts = {
  cursor: 'sub_1234567890abcdef12', # String | 
  limit: 3, # Integer | 
  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 | 
}

begin
  # List all submissions
  result = api_instance.list_submissions(opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_submissions: #{e}"
end

Using the list_submissions_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_submissions_with_http_info(opts)

begin
  # List all submissions
  data, status_code, headers = api_instance.list_submissions_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListSubmissionsResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_submissions_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
cursor String [optional]
limit Integer [optional]
created_after String [optional]
created_before String [optional]
type String [optional]
include_data Boolean [optional]

Return type

ListSubmissionsResponse

Authorization

api_token_basic

HTTP request headers

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

list_template_submissions

list_template_submissions(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef02' # String | 
opts = {
  cursor: 'cursor_example', # String | 
  limit: 56, # Integer | 
  created_after: 'created_after_example', # String | 
  created_before: 'created_before_example', # String | 
  type: 'type_example', # String | 
  include_data: true # Boolean | 
}

begin
  # List all submissions for a given template
  result = api_instance.list_template_submissions(template_id, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_template_submissions: #{e}"
end

Using the list_template_submissions_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_template_submissions_with_http_info(template_id, opts)

begin
  # List all submissions for a given template
  data, status_code, headers = api_instance.list_template_submissions_with_http_info(template_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListSubmissionsResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_template_submissions_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
cursor String [optional]
limit Integer [optional]
created_after String [optional]
created_before String [optional]
type String [optional]
include_data Boolean [optional]

Return type

ListSubmissionsResponse

Authorization

api_token_basic

HTTP request headers

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

list_templates

<Array> list_templates(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
opts = {
  query: '2', # String | Search By Name
  parent_folder_id: 'fld_1234567890abcdef01', # String | Filter By Folder Id
  page: 2, # Integer | Default: 1
  per_page: 1 # Integer | Default: 50
}

begin
  # Get a list of all templates
  result = api_instance.list_templates(opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_templates: #{e}"
end

Using the list_templates_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> list_templates_with_http_info(opts)

begin
  # Get a list of all templates
  data, status_code, headers = api_instance.list_templates_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<TemplatePreview>>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->list_templates_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
query String Search By Name [optional]
parent_folder_id String Filter By Folder Id [optional]
page Integer Default: 1 [optional]
per_page Integer Default: 50 [optional]

Return type

Array<TemplatePreview>

Authorization

api_token_basic

HTTP request headers

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

move_folder_to_folder

move_folder_to_folder(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
folder_id = 'fld_1234567890abcdef01' # String | 
data = DocSpring::MoveFolderData.new # MoveFolderData | 

begin
  # Move a folder
  result = api_instance.move_folder_to_folder(folder_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->move_folder_to_folder: #{e}"
end

Using the move_folder_to_folder_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> move_folder_to_folder_with_http_info(folder_id, data)

begin
  # Move a folder
  data, status_code, headers = api_instance.move_folder_to_folder_with_http_info(folder_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Folder>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->move_folder_to_folder_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
folder_id String
data MoveFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

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

move_template_to_folder

move_template_to_folder(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 
data = DocSpring::MoveTemplateData.new({parent_folder_id: 'parent_folder_id_example'}) # MoveTemplateData | 

begin
  # Move Template to folder
  result = api_instance.move_template_to_folder(template_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->move_template_to_folder: #{e}"
end

Using the move_template_to_folder_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> move_template_to_folder_with_http_info(template_id, data)

begin
  # Move Template to folder
  data, status_code, headers = api_instance.move_template_to_folder_with_http_info(template_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplatePreview>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->move_template_to_folder_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
data MoveTemplateData

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

publish_template_version

publish_template_version(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).

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 
data = DocSpring::PublishVersionData.new({version_type: 'version_type_example'}) # PublishVersionData | 

begin
  # Publish a template version
  result = api_instance.publish_template_version(template_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->publish_template_version: #{e}"
end

Using the publish_template_version_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> publish_template_version_with_http_info(template_id, data)

begin
  # Publish a template version
  data, status_code, headers = api_instance.publish_template_version_with_http_info(template_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <TemplatePublishVersionResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->publish_template_version_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
data PublishVersionData

Return type

TemplatePublishVersionResponse

Authorization

api_token_basic

HTTP request headers

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

rename_folder

rename_folder(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
folder_id = 'fld_1234567890abcdef01' # String | 
data = DocSpring::RenameFolderData.new({name: 'name_example'}) # RenameFolderData | 

begin
  # Rename a folder
  result = api_instance.rename_folder(folder_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->rename_folder: #{e}"
end

Using the rename_folder_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> rename_folder_with_http_info(folder_id, data)

begin
  # Rename a folder
  data, status_code, headers = api_instance.rename_folder_with_http_info(folder_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Folder>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->rename_folder_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
folder_id String
data RenameFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

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

restore_template_version

restore_template_version(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 
data = DocSpring::RestoreVersionData.new({version: 'version_example'}) # RestoreVersionData | 

begin
  # Restore a template version
  result = api_instance.restore_template_version(template_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->restore_template_version: #{e}"
end

Using the restore_template_version_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> restore_template_version_with_http_info(template_id, data)

begin
  # Restore a template version
  data, status_code, headers = api_instance.restore_template_version_with_http_info(template_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SuccessErrorResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->restore_template_version_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
data RestoreVersionData

Return type

SuccessErrorResponse

Authorization

api_token_basic

HTTP request headers

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

test_authentication

test_authentication

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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new

begin
  # Test authentication
  result = api_instance.test_authentication
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->test_authentication: #{e}"
end

Using the test_authentication_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> test_authentication_with_http_info

begin
  # Test authentication
  data, status_code, headers = api_instance.test_authentication_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SuccessErrorResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->test_authentication_with_http_info: #{e}"
end

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

update_data_request

update_data_request(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
data_request_id = 'drq_1234567890abcdef01' # String | 
data = DocSpring::UpdateSubmissionDataRequestData.new # UpdateSubmissionDataRequestData | 

begin
  # Update a submission data request
  result = api_instance.update_data_request(data_request_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->update_data_request: #{e}"
end

Using the update_data_request_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_data_request_with_http_info(data_request_id, data)

begin
  # Update a submission data request
  data, status_code, headers = api_instance.update_data_request_with_http_info(data_request_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <CreateSubmissionDataRequestResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->update_data_request_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
data_request_id String
data UpdateSubmissionDataRequestData

Return type

CreateSubmissionDataRequestResponse

Authorization

api_token_basic

HTTP request headers

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

update_template

update_template(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef03' # String | 
data = DocSpring::UpdateHtmlTemplate.new({template: 3.56}) # UpdateHtmlTemplate | 

begin
  # Update a Template
  result = api_instance.update_template(template_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->update_template: #{e}"
end

Using the update_template_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_template_with_http_info(template_id, data)

begin
  # Update a Template
  data, status_code, headers = api_instance.update_template_with_http_info(template_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SuccessMultipleErrorsResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->update_template_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
data UpdateHtmlTemplate

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

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

update_template_document

update_template_document(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 
template_document = File.new('/path/to/some/file') # File | 
opts = {
  template_name: 'template_name_example' # String | 
}

begin
  # Update a template's document with a form POST file upload
  result = api_instance.update_template_document(template_id, template_document, opts)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->update_template_document: #{e}"
end

Using the update_template_document_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_template_document_with_http_info(template_id, template_document, opts)

begin
  # Update a template's document with a form POST file upload
  data, status_code, headers = api_instance.update_template_document_with_http_info(template_id, template_document, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SuccessMultipleErrorsResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->update_template_document_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
template_document File
template_name String [optional]

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

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

update_template_document_from_upload

update_template_document_from_upload(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.

Examples

require 'time'
require 'docspring'
# setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef01' # String | 
data = DocSpring::UpdatePdfTemplate.new({template: 3.56}) # UpdatePdfTemplate | 

begin
  # Update a template's document with a cached S3 file upload
  result = api_instance.update_template_document_from_upload(template_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Error when calling Client->update_template_document_from_upload: #{e}"
end

Using the update_template_document_from_upload_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_template_document_from_upload_with_http_info(template_id, data)

begin
  # Update a template's document with a cached S3 file upload
  data, status_code, headers = api_instance.update_template_document_from_upload_with_http_info(template_id, data)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SuccessMultipleErrorsResponse>
rescue DocSpring::ApiError => e
  puts "Error when calling Client->update_template_document_from_upload_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
template_id String
data UpdatePdfTemplate

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

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