Skip to content

Latest commit

 

History

History
3506 lines (2457 loc) · 117 KB

File metadata and controls

3506 lines (2457 loc) · 117 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

TemplateAddFieldsResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.add_fields_data import AddFieldsData
from docspring.models.template_add_fields_response import TemplateAddFieldsResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef02' # str | 
    data = docspring.AddFieldsData() # AddFieldsData | 

    try:
        # Add new fields to a Template
        api_response = api_instance.add_fields_to_template(template_id, data)
        print("The response of Client->add_fields_to_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->add_fields_to_template: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
data AddFieldsData

Return type

TemplateAddFieldsResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 add fields success -
422 add fields error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

batch_generate_pdfs

BatchGeneratePdfs201Response batch_generate_pdfs(data, wait=wait)

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:

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response
from docspring.models.submission_batch_data import SubmissionBatchData
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data = docspring.SubmissionBatchData() # SubmissionBatchData | 
    wait = True # bool | Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional) (default to True)

    try:
        # Generate multiple PDFs
        api_response = api_instance.batch_generate_pdfs(data, wait=wait)
        print("The response of Client->batch_generate_pdfs:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->batch_generate_pdfs: %s\n" % e)

Parameters

Name Type Description Notes
data SubmissionBatchData
wait bool 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

HTTP response details

Status code Description Response headers
201 submissions created -
200 some PDFs with invalid data -
401 authentication failed -
422 array of arrays -
400 invalid JSON -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

combine_pdfs

CreateCombinedSubmissionResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.combine_pdfs_data import CombinePdfsData
from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data = docspring.CombinePdfsData() # CombinePdfsData | 

    try:
        # Merge submission PDFs, template PDFs, or custom files
        api_response = api_instance.combine_pdfs(data)
        print("The response of Client->combine_pdfs:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->combine_pdfs: %s\n" % e)

Parameters

Name Type Description Notes
data CombinePdfsData

Return type

CreateCombinedSubmissionResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 combined submission created -
422 invalid request -
400 invalid JSON -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

copy_template

TemplatePreview copy_template(template_id, options=options)

Copy a template

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.copy_template_options import CopyTemplateOptions
from docspring.models.template_preview import TemplatePreview
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 
    options = docspring.CopyTemplateOptions() # CopyTemplateOptions |  (optional)

    try:
        # Copy a template
        api_response = api_instance.copy_template(template_id, options=options)
        print("The response of Client->copy_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->copy_template: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
options CopyTemplateOptions [optional]

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 copy template success -
404 folder not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_custom_file_from_upload

CreateCustomFileResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.create_custom_file_data import CreateCustomFileData
from docspring.models.create_custom_file_response import CreateCustomFileResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data = docspring.CreateCustomFileData() # CreateCustomFileData | 

    try:
        # Create a new custom file from a cached S3 upload
        api_response = api_instance.create_custom_file_from_upload(data)
        print("The response of Client->create_custom_file_from_upload:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->create_custom_file_from_upload: %s\n" % e)

Parameters

Name Type Description Notes
data CreateCustomFileData

Return type

CreateCustomFileResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 returns the custom file -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_data_request_event

CreateSubmissionDataRequestEventResponse 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:

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest
from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data_request_id = 'drq_1234567890abcdef01' # str | 
    event = docspring.CreateSubmissionDataRequestEventRequest() # CreateSubmissionDataRequestEventRequest | 

    try:
        # Create a new event for emailing a signee a request for signature
        api_response = api_instance.create_data_request_event(data_request_id, event)
        print("The response of Client->create_data_request_event:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->create_data_request_event: %s\n" % e)

Parameters

Name Type Description Notes
data_request_id str
event CreateSubmissionDataRequestEventRequest

Return type

CreateSubmissionDataRequestEventResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 event created -
401 authentication failed -
422 message recipient must not be blank -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_data_request_token

CreateSubmissionDataRequestTokenResponse create_data_request_token(data_request_id, type=type)

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:

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data_request_id = 'drq_1234567890abcdef01' # str | 
    type = 'api' # str |  (optional)

    try:
        # Create a new data request token for form authentication
        api_response = api_instance.create_data_request_token(data_request_id, type=type)
        print("The response of Client->create_data_request_token:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->create_data_request_token: %s\n" % e)

Parameters

Name Type Description Notes
data_request_id str
type str [optional]

Return type

CreateSubmissionDataRequestTokenResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 token created -
401 authentication failed -
422 invalid request -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_folder

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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.create_folder_data import CreateFolderData
from docspring.models.folder import Folder
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data = docspring.CreateFolderData() # CreateFolderData | 

    try:
        # Create a folder
        api_response = api_instance.create_folder(data)
        print("The response of Client->create_folder:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->create_folder: %s\n" % e)

Parameters

Name Type Description Notes
data CreateFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
422 name already exist -
404 parent folder doesn't exist -
200 folder created inside another folder -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_html_template

TemplatePreview 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.create_html_template import CreateHtmlTemplate
from docspring.models.template_preview import TemplatePreview
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data = docspring.CreateHtmlTemplate() # CreateHtmlTemplate | 

    try:
        # Create a new HTML template
        api_response = api_instance.create_html_template(data)
        print("The response of Client->create_html_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->create_html_template: %s\n" % e)

Parameters

Name Type Description Notes
data CreateHtmlTemplate

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 returns a created template -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_pdf_template

TemplatePreview create_pdf_template(template_document, template_name, wait=wait, template_description=template_description, template_parent_folder_id=template_parent_folder_id)

Create a new PDF template with a form POST file upload

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.template_preview import TemplatePreview
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_document = None # bytearray | 
    template_name = 'template_name_example' # str | 
    wait = True # bool | 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 = 'template_description_example' # str |  (optional)
    template_parent_folder_id = 'template_parent_folder_id_example' # str |  (optional)

    try:
        # Create a new PDF template with a form POST file upload
        api_response = api_instance.create_pdf_template(template_document, template_name, wait=wait, template_description=template_description, template_parent_folder_id=template_parent_folder_id)
        print("The response of Client->create_pdf_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->create_pdf_template: %s\n" % e)

Parameters

Name Type Description Notes
template_document bytearray
template_name str
wait bool 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 str [optional]
template_parent_folder_id str [optional]

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 returns a pending template -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_pdf_template_from_upload

TemplatePreview 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.create_pdf_template import CreatePdfTemplate
from docspring.models.template_preview import TemplatePreview
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data = docspring.CreatePdfTemplate() # CreatePdfTemplate | 

    try:
        # Create a new PDF template from a cached S3 file upload
        api_response = api_instance.create_pdf_template_from_upload(data)
        print("The response of Client->create_pdf_template_from_upload:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->create_pdf_template_from_upload: %s\n" % e)

Parameters

Name Type Description Notes
data CreatePdfTemplate

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 returns a pending template -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_folder

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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.folder import Folder
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    folder_id = 'fld_1234567890abcdef01' # str | 

    try:
        # Delete a folder
        api_response = api_instance.delete_folder(folder_id)
        print("The response of Client->delete_folder:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->delete_folder: %s\n" % e)

Parameters

Name Type Description Notes
folder_id str

Return type

Folder

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
404 folder doesn't exist -
422 folder has contents -
200 folder is empty -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_template

TemplateDeleteResponse delete_template(template_id, version=version)

Delete a template

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.template_delete_response import TemplateDeleteResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 
    version = '0.1.0' # str |  (optional)

    try:
        # Delete a template
        api_response = api_instance.delete_template(template_id, version=version)
        print("The response of Client->delete_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->delete_template: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
version str [optional]

Return type

TemplateDeleteResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 template version deleted successfully -
404 template not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

expire_combined_submission

CombinedSubmission 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.combined_submission import CombinedSubmission
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    combined_submission_id = 'com_1234567890abcdef01' # str | 

    try:
        # Expire a combined submission
        api_response = api_instance.expire_combined_submission(combined_submission_id)
        print("The response of Client->expire_combined_submission:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->expire_combined_submission: %s\n" % e)

Parameters

Name Type Description Notes
combined_submission_id str

Return type

CombinedSubmission

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 submission was expired -
404 combined submission not found -
403 test API token used -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

expire_submission

SubmissionPreview 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.submission_preview import SubmissionPreview
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    submission_id = 'sub_1234567890abcdef01' # str | 

    try:
        # Expire a PDF submission
        api_response = api_instance.expire_submission(submission_id)
        print("The response of Client->expire_submission:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->expire_submission: %s\n" % e)

Parameters

Name Type Description Notes
submission_id str

Return type

SubmissionPreview

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 submission was expired -
404 submission not found -
401 authentication failed -
403 test API token used -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

generate_pdf

CreateSubmissionResponse generate_pdf(template_id, submission, wait=wait)

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:

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData
from docspring.models.create_submission_response import CreateSubmissionResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 
    submission = docspring.CreatePdfSubmissionData() # CreatePdfSubmissionData | 
    wait = True # bool | Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional) (default to True)

    try:
        # Generate a PDF
        api_response = api_instance.generate_pdf(template_id, submission, wait=wait)
        print("The response of Client->generate_pdf:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->generate_pdf: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
submission CreatePdfSubmissionData
wait bool 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

HTTP response details

Status code Description Response headers
201 submission created -
422 invalid request -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

generate_preview

SuccessErrorResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.success_error_response import SuccessErrorResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    submission_id = 'sub_1234567890abcdef01' # str | 

    try:
        # Generate a preview PDF for partially completed data requests
        api_response = api_instance.generate_preview(submission_id)
        print("The response of Client->generate_preview:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->generate_preview: %s\n" % e)

Parameters

Name Type Description Notes
submission_id str

Return type

SuccessErrorResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 preview was successfully requested -
404 submission not found -
422 error requesting preview -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_combined_submission

CombinedSubmission 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).

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.combined_submission import CombinedSubmission
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    combined_submission_id = 'com_1234567890abcdef01' # str | 

    try:
        # Check the status of a combined submission (merged PDFs)
        api_response = api_instance.get_combined_submission(combined_submission_id)
        print("The response of Client->get_combined_submission:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->get_combined_submission: %s\n" % e)

Parameters

Name Type Description Notes
combined_submission_id str

Return type

CombinedSubmission

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 processed combined submission found -
404 combined submission not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_data_request

SubmissionDataRequestShow 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:

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.submission_data_request_show import SubmissionDataRequestShow
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data_request_id = 'drq_1234567890abcdef01' # str | 

    try:
        # Look up a submission data request
        api_response = api_instance.get_data_request(data_request_id)
        print("The response of Client->get_data_request:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->get_data_request: %s\n" % e)

Parameters

Name Type Description Notes
data_request_id str

Return type

SubmissionDataRequestShow

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 completed submission data request found -
404 submission data request not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_full_template

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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.template import Template
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 

    try:
        # Fetch the full attributes for a PDF template
        api_response = api_instance.get_full_template(template_id)
        print("The response of Client->get_full_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->get_full_template: %s\n" % e)

Parameters

Name Type Description Notes
template_id str

Return type

Template

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 template found -
404 template not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_presign_url

UploadPresignResponse 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:

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.upload_presign_response import UploadPresignResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)

    try:
        # Get a presigned S3 URL for direct file upload
        api_response = api_instance.get_presign_url()
        print("The response of Client->get_presign_url:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->get_presign_url: %s\n" % e)

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

HTTP response details

Status code Description Response headers
200 presign URL generated -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_submission

Submission get_submission(submission_id, include_data=include_data)

Check the status of a PDF

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.submission import Submission
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    submission_id = 'sub_1234567890abcdef01' # str | 
    include_data = true # bool |  (optional)

    try:
        # Check the status of a PDF
        api_response = api_instance.get_submission(submission_id, include_data=include_data)
        print("The response of Client->get_submission:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->get_submission: %s\n" % e)

Parameters

Name Type Description Notes
submission_id str
include_data bool [optional]

Return type

Submission

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 processed submission found with data -
404 submission not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_submission_batch

SubmissionBatchWithSubmissions get_submission_batch(submission_batch_id, include_submissions=include_submissions)

Check the status of a submission batch job

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    submission_batch_id = 'sbb_1234567890abcdef01' # str | 
    include_submissions = true # bool |  (optional)

    try:
        # Check the status of a submission batch job
        api_response = api_instance.get_submission_batch(submission_batch_id, include_submissions=include_submissions)
        print("The response of Client->get_submission_batch:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->get_submission_batch: %s\n" % e)

Parameters

Name Type Description Notes
submission_batch_id str
include_submissions bool [optional]

Return type

SubmissionBatchWithSubmissions

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 processed submission batch found -
404 submission batch not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_template

TemplatePreview 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.template_preview import TemplatePreview
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 

    try:
        # Check the status of an uploaded template
        api_response = api_instance.get_template(template_id)
        print("The response of Client->get_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->get_template: %s\n" % e)

Parameters

Name Type Description Notes
template_id str

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 template found -
404 template not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_template_schema

JsonSchema 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:

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.json_schema import JsonSchema
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 

    try:
        # Fetch the JSON schema for a template
        api_response = api_instance.get_template_schema(template_id)
        print("The response of Client->get_template_schema:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->get_template_schema: %s\n" % e)

Parameters

Name Type Description Notes
template_id str

Return type

JsonSchema

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 template found -
404 template not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_combined_submissions

List[CombinedSubmission] list_combined_submissions(page=page, per_page=per_page)

Get a list of all combined submissions

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.combined_submission import CombinedSubmission
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    page = 3 # int | Default: 1 (optional)
    per_page = 1 # int | Default: 50 (optional)

    try:
        # Get a list of all combined submissions
        api_response = api_instance.list_combined_submissions(page=page, per_page=per_page)
        print("The response of Client->list_combined_submissions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->list_combined_submissions: %s\n" % e)

Parameters

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

Return type

List[CombinedSubmission]

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 enumerate all combined submissions -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_folders

List[Folder] list_folders(parent_folder_id=parent_folder_id)

Get a list of all folders

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.folder import Folder
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    parent_folder_id = 'fld_1234567890abcdef02' # str | Filter By Folder Id (optional)

    try:
        # Get a list of all folders
        api_response = api_instance.list_folders(parent_folder_id=parent_folder_id)
        print("The response of Client->list_folders:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->list_folders: %s\n" % e)

Parameters

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

Return type

List[Folder]

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 enumerate all folders -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_submissions

ListSubmissionsResponse list_submissions(cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data)

List all submissions

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.list_submissions_response import ListSubmissionsResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    cursor = 'sub_1234567890abcdef12' # str |  (optional)
    limit = 3 # int |  (optional)
    created_after = '2019-01-01T09:00:00-05:00' # str |  (optional)
    created_before = '2020-01-01T09:00:00.000+0200' # str |  (optional)
    type = 'test' # str |  (optional)
    include_data = true # bool |  (optional)

    try:
        # List all submissions
        api_response = api_instance.list_submissions(cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data)
        print("The response of Client->list_submissions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->list_submissions: %s\n" % e)

Parameters

Name Type Description Notes
cursor str [optional]
limit int [optional]
created_after str [optional]
created_before str [optional]
type str [optional]
include_data bool [optional]

Return type

ListSubmissionsResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 listing submissions -
422 invalid type -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_template_submissions

ListSubmissionsResponse list_template_submissions(template_id, cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data)

List all submissions for a given template

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.list_submissions_response import ListSubmissionsResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef02' # str | 
    cursor = 'cursor_example' # str |  (optional)
    limit = 56 # int |  (optional)
    created_after = 'created_after_example' # str |  (optional)
    created_before = 'created_before_example' # str |  (optional)
    type = 'type_example' # str |  (optional)
    include_data = true # bool |  (optional)

    try:
        # List all submissions for a given template
        api_response = api_instance.list_template_submissions(template_id, cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data)
        print("The response of Client->list_template_submissions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->list_template_submissions: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
cursor str [optional]
limit int [optional]
created_after str [optional]
created_before str [optional]
type str [optional]
include_data bool [optional]

Return type

ListSubmissionsResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 listing submissions -
404 invalid template id -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_templates

List[TemplatePreview] list_templates(query=query, parent_folder_id=parent_folder_id, page=page, per_page=per_page)

Get a list of all templates

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.template_preview import TemplatePreview
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    query = '2' # str | Search By Name (optional)
    parent_folder_id = 'fld_1234567890abcdef01' # str | Filter By Folder Id (optional)
    page = 2 # int | Default: 1 (optional)
    per_page = 1 # int | Default: 50 (optional)

    try:
        # Get a list of all templates
        api_response = api_instance.list_templates(query=query, parent_folder_id=parent_folder_id, page=page, per_page=per_page)
        print("The response of Client->list_templates:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->list_templates: %s\n" % e)

Parameters

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

Return type

List[TemplatePreview]

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 enumerate all templates -
404 filter templates by invalid folder id -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

move_folder_to_folder

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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.folder import Folder
from docspring.models.move_folder_data import MoveFolderData
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    folder_id = 'fld_1234567890abcdef01' # str | 
    data = docspring.MoveFolderData() # MoveFolderData | 

    try:
        # Move a folder
        api_response = api_instance.move_folder_to_folder(folder_id, data)
        print("The response of Client->move_folder_to_folder:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->move_folder_to_folder: %s\n" % e)

Parameters

Name Type Description Notes
folder_id str
data MoveFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
404 parent folder doesn't exist -
200 move to root folder -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

move_template_to_folder

TemplatePreview 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.move_template_data import MoveTemplateData
from docspring.models.template_preview import TemplatePreview
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 
    data = docspring.MoveTemplateData() # MoveTemplateData | 

    try:
        # Move Template to folder
        api_response = api_instance.move_template_to_folder(template_id, data)
        print("The response of Client->move_template_to_folder:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->move_template_to_folder: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
data MoveTemplateData

Return type

TemplatePreview

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 move template success -
404 folder not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

publish_template_version

TemplatePublishVersionResponse 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).

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.publish_version_data import PublishVersionData
from docspring.models.template_publish_version_response import TemplatePublishVersionResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 
    data = docspring.PublishVersionData() # PublishVersionData | 

    try:
        # Publish a template version
        api_response = api_instance.publish_template_version(template_id, data)
        print("The response of Client->publish_template_version:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->publish_template_version: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
data PublishVersionData

Return type

TemplatePublishVersionResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 version published successfully -
422 invalid version type -
404 template not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

rename_folder

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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.folder import Folder
from docspring.models.rename_folder_data import RenameFolderData
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    folder_id = 'fld_1234567890abcdef01' # str | 
    data = docspring.RenameFolderData() # RenameFolderData | 

    try:
        # Rename a folder
        api_response = api_instance.rename_folder(folder_id, data)
        print("The response of Client->rename_folder:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->rename_folder: %s\n" % e)

Parameters

Name Type Description Notes
folder_id str
data RenameFolderData

Return type

Folder

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
422 name already exist -
404 folder doesn't belong to me -
200 successful rename -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

restore_template_version

SuccessErrorResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.restore_version_data import RestoreVersionData
from docspring.models.success_error_response import SuccessErrorResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 
    data = docspring.RestoreVersionData() # RestoreVersionData | 

    try:
        # Restore a template version
        api_response = api_instance.restore_template_version(template_id, data)
        print("The response of Client->restore_template_version:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->restore_template_version: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
data RestoreVersionData

Return type

SuccessErrorResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 version restored successfully -
422 draft version not allowed -
404 template version not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

test_authentication

SuccessErrorResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.success_error_response import SuccessErrorResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)

    try:
        # Test authentication
        api_response = api_instance.test_authentication()
        print("The response of Client->test_authentication:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->test_authentication: %s\n" % e)

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

HTTP response details

Status code Description Response headers
200 authentication succeeded -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_data_request

CreateSubmissionDataRequestResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse
from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    data_request_id = 'drq_1234567890abcdef01' # str | 
    data = docspring.UpdateSubmissionDataRequestData() # UpdateSubmissionDataRequestData | 

    try:
        # Update a submission data request
        api_response = api_instance.update_data_request(data_request_id, data)
        print("The response of Client->update_data_request:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->update_data_request: %s\n" % e)

Parameters

Name Type Description Notes
data_request_id str
data UpdateSubmissionDataRequestData

Return type

CreateSubmissionDataRequestResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 submission data request updated -
422 invalid request -
404 submission data request not found -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_template

SuccessMultipleErrorsResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse
from docspring.models.update_html_template import UpdateHtmlTemplate
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef03' # str | 
    data = docspring.UpdateHtmlTemplate() # UpdateHtmlTemplate | 

    try:
        # Update a Template
        api_response = api_instance.update_template(template_id, data)
        print("The response of Client->update_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->update_template: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
data UpdateHtmlTemplate

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 update template success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_template_document

SuccessMultipleErrorsResponse update_template_document(template_id, template_document, template_name=template_name)

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

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

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 
    template_document = None # bytearray | 
    template_name = 'template_name_example' # str |  (optional)

    try:
        # Update a template's document with a form POST file upload
        api_response = api_instance.update_template_document(template_id, template_document, template_name=template_name)
        print("The response of Client->update_template_document:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->update_template_document: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
template_document bytearray
template_name str [optional]

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 returns a template with updated document -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_template_document_from_upload

SuccessMultipleErrorsResponse 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.

Example

  • Basic Authentication (api_token_basic):
import docspring
from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse
from docspring.models.update_pdf_template import UpdatePdfTemplate
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef01' # str | 
    data = docspring.UpdatePdfTemplate() # UpdatePdfTemplate | 

    try:
        # Update a template's document with a cached S3 file upload
        api_response = api_instance.update_template_document_from_upload(template_id, data)
        print("The response of Client->update_template_document_from_upload:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling Client->update_template_document_from_upload: %s\n" % e)

Parameters

Name Type Description Notes
template_id str
data UpdatePdfTemplate

Return type

SuccessMultipleErrorsResponse

Authorization

api_token_basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 returns a template with updated document -
401 authentication failed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]