Skip to main content

DocuSeal Python

The DocuSeal Python library provides seamless integration with the DocuSeal API, allowing developers to interact with DocuSeal's electronic signature and document management features directly within Python applications. This library is designed to simplify API interactions and provide tools for efficient implementation.

Documentation

Detailed documentation is available at DocuSeal API Docs.

Requirements

Python 3.5 and later.

Installation

pip install --upgrade docuseal

Install from source with:

python setup.py install

Usage

Configuration

Set up the library with your DocuSeal API key based on your deployment. Retrieve your API key from the appropriate location:

Global Cloud

API keys for the global cloud can be obtained from your Global DocuSeal Console.

from docuseal import docuseal

docuseal.key = "API_KEY"

EU Cloud

API keys for the EU cloud can be obtained from your EU DocuSeal Console.

from docuseal import docuseal

docuseal.key = "API_KEY"
docuseal.url = "https://api.docuseal.eu"

On-Premises

For on-premises installations, API keys can be retrieved from the API settings page of your deployed application, e.g., https://yourdocusealapp.com/settings/api.

from docuseal import docuseal

docuseal.key = "API_KEY"
docuseal.url = "https://yourdocusealapp.com/api"

API Methods

list_submissions(params)

Documentation

Provides the ability to retrieve a list of available submissions.

docuseal.list_submissions({ "limit": 10 })

get_submission(id)

Documentation

Provides the functionality to retrieve information about a submission.

docuseal.get_submission(1001)

get_submission_documents(id)

Documentation

This endpoint returns a list of partially filled documents for a submission. If the submission has been completed, the final signed documents are returned.

docuseal.get_submission_documents(1001)

create_submission(data)

Documentation

This API endpoint allows you to create signature requests (submissions) for a document template and send them to the specified submitters (signers).

Related Guides:
Send documents for signature via API Pre-fill PDF document form fields with API

docuseal.create_submission({
  "template_id": 1000001,
  "send_email": True,
  "submitters": [
    {
      "role": "First Party",
      "email": "john.doe@example.com"
    }
  ]
})

create_submission_from_pdf(data)

Documentation

Provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using fields param.

Related Guides:
Use embedded text field tags to create a fillable form

docuseal.create_submission_from_pdf({
  "name": "Test Submission Document",
  "documents": [
    {
      "name": "string",
      "file": "base64",
      "fields": [
        {
          "name": "string",
          "areas": [
            {
              "x": 0,
              "y": 0,
              "w": 0,
              "h": 0,
              "page": 1
            }
          ]
        }
      ]
    }
  ],
  "submitters": [
    {
      "role": "First Party",
      "email": "john.doe@example.com"
    }
  ]
})

create_submission_from_docx(data)

Documentation

Provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and lists. You can also use the {{signature}} field syntax to define fillable fields, as in a PDF.

Related Guides:
Use dynamic content variables in DOCX to create personalized documents

docuseal.create_submission_from_docx({
  "name": "Test Submission Document",
  "variables": {
    "variable_name": "value"
  },
  "documents": [
    {
      "name": "string",
      "file": "base64"
    }
  ],
  "submitters": [
    {
      "role": "First Party",
      "email": "john.doe@example.com"
    }
  ]
})

create_submission_from_html(data)

Documentation

This API endpoint allows you to create a one-off submission request document using the provided HTML content, with special field tags rendered as a fillable and signable form.

Related Guides:
Create PDF document fillable form with HTML

docuseal.create_submission_from_html({
  "name": "Test Submission Document",
  "documents": [
    {
      "name": "Test Document",
      "html": """<p>Lorem Ipsum is simply dummy text of the
<text-field
  name=\"Industry\"
  role=\"First Party\"
  required=\"false\"
  style=\"width: 80px; height: 16px; display: inline-block; margin-bottom: -4px\">
</text-field>
and typesetting industry</p>
"""
    }
  ],
  "submitters": [
    {
      "role": "First Party",
      "email": "john.doe@example.com"
    }
  ]
})

update_submission(id, data)

Documentation

Allows you to update a submission: change its name, expiration date, and archive or unarchive it.

docuseal.update_submission(1001, {
  "name": "New Submission Name",
  "expire_at": "2024-09-01 12:00:00 UTC",
  "archived": True
})

archive_submission(id)

Documentation

Allows you to archive a submission.

docuseal.archive_submission(1001)

list_submissions(params)

Documentation

Provides the ability to retrieve a list of submitters.

docuseal.list_submissions({ "limit": 10 })

get_submitter(id)

Documentation

Provides functionality to retrieve information about a submitter, along with the submitter documents and field values.

docuseal.get_submitter(500001)

update_submitter(id, data)

Documentation

Allows you to update submitter details, pre-fill or update field values and re-send emails.

Related Guides:
Automatically sign documents via API

docuseal.update_submitter(500001, {
  "email": "john.doe@example.com",
  "fields": [
    {
      "name": "First Name",
      "default_value": "Acme"
    }
  ]
})

list_submissions(params)

Documentation

Provides the ability to retrieve a list of available document templates.

docuseal.list_submissions({ "limit": 10 })

get_template(id)

Documentation

Provides the functionality to retrieve information about a document template.

docuseal.get_template(1000001)

create_template_from_pdf(data)

Documentation

Provides the functionality to create a fillable document template for a PDF file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using fields param.

Related Guides:
Use embedded text field tags to create a fillable form

docuseal.create_template_from_pdf({
  "name": "Test PDF",
  "documents": [
    {
      "name": "string",
      "file": "base64",
      "fields": [
        {
          "name": "string",
          "areas": [
            {
              "x": 0,
              "y": 0,
              "w": 0,
              "h": 0,
              "page": 1
            }
          ]
        }
      ]
    }
  ]
})

create_template_from_docx(data)

Documentation

Provides the functionality to create a fillable document template for an existing Microsoft Word document. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.docx for more text tag formats. Or specify the exact pixel coordinates of the document fields using fields param.

Related Guides:
Use embedded text field tags to create a fillable form

docuseal.create_template_from_docx({
  "name": "Test DOCX",
  "documents": [
    {
      "name": "string",
      "file": "base64"
    }
  ]
})

create_template_from_html(data)

Documentation

Provides the functionality to seamlessly generate a PDF document template by utilizing the provided HTML content while incorporating pre-defined fields.

Related Guides:
Create PDF document fillable form with HTML

docuseal.create_template_from_html({
  "html": """<p>Lorem Ipsum is simply dummy text of the
<text-field
  name=\"Industry\"
  role=\"First Party\"
  required=\"false\"
  style=\"width: 80px; height: 16px; display: inline-block; margin-bottom: -4px\">
</text-field>
and typesetting industry</p>
""",
  "name": "Test Template"
})

clone_template(id, data)

Documentation

Allows you to clone an existing template into a new template.

docuseal.clone_template(1000001, {
  "name": "Cloned Template"
})

merge_templates(data)

Documentation

Allows you to merge multiple templates with documents and fields into a new combined template.

docuseal.merge_templates({
  "template_ids": [
    321,
    432
  ],
  "name": "Merged Template"
})

update_template(id, data)

Documentation

Provides the functionality to move a document template to a different folder and update the name of the template.

docuseal.update_template(1000001, {
  "name": "New Document Name",
  "folder_name": "New Folder"
})

update_template_documents(id, data)

Documentation

Allows you to add, remove or replace documents in the template with provided PDF/DOCX file or HTML content.

docuseal.update_template_documents(1000001, {
  "documents": [
    {
      "file": "string"
    }
  ]
})

archive_template(id)

Documentation

Allows you to archive a document template.

docuseal.archive_template(1000001)

Configuring Timeouts

Set timeouts to avoid hanging requests:

docuseal.open_timeout = 30
docuseal.read_timeout = 30

Support

For feature requests or bug reports, visit our GitHub Issues page.

License

The package is available as open source under the terms of the MIT License.

Metadata

Release files for docuseal 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docuseal 1.0.9
File Size Uploaded
docuseal-1.0.9.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for docuseal 1.0.9
File Interpreter ABI Platform
docuseal-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / docuseal-1.0.9.tar.gz

Download URL docuseal-1.0.9.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6489abc352d12cfd3f95521cfbc884c4b01619d7e71d3060ed262a7be848c943
BLAKE2b-256 checksum
How to use checksums
9f98a97c85ea17abf3efc407f62c6dc26ca88073e973cb15ddcbf104010c9dbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.8

Release files / docuseal-1.0.9-py3-none-any.whl

Download URL docuseal-1.0.9-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99ab08e31e29b597873fbb675082877e71bc2c0dcf0610a4b559dc276297cf19
BLAKE2b-256 checksum
How to use checksums
cd2a33d635fb5e70f5b837046abefd173087cdbf60c2f831813a48544ce7ee68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.8

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page