The DocuSeal .NET library provides seamless integration with the DocuSeal API, allowing developers to interact with DocuSeal's electronic signature and document management features directly within .NET applications. This library is designed to simplify API interactions and provide tools for efficient implementation.
Detailed documentation is available at DocuSeal API Docs.
To install the library, run:
dotnet add package DocusealSupports .NET Framework 4.6.2+, .NET Standard 2.0 and .NET 8/9.
Set up the library with your DocuSeal API key based on your deployment. Retrieve your API key from the appropriate location:
API keys for the global cloud can be obtained from your Global DocuSeal Console.
var client = new DocusealClient(Environment.GetEnvironmentVariable("DOCUSEAL_API_KEY"));API keys for the EU cloud can be obtained from your EU DocuSeal Console.
var client = new DocusealClient(
Environment.GetEnvironmentVariable("DOCUSEAL_API_KEY"),
new ClientOptions { BaseUrl = DocusealClientEnvironment.EU });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.
var client = new DocusealClient(
Environment.GetEnvironmentVariable("DOCUSEAL_API_KEY"),
new ClientOptions { BaseUrl = "https://yourdocusealapp.com/api" });Provides the ability to retrieve a list of available submissions.
var submissions = await client.GetSubmissionsAsync(new GetSubmissionsParams { Limit = 10 });Provides the functionality to retrieve information about a submission.
var submission = await client.GetSubmissionAsync(1001);This endpoint returns a list of partially filled documents for a submission. If the submission has been completed, the final signed documents are returned.
var submission = await client.GetSubmissionDocumentsAsync(1001, new GetSubmissionDocumentsParams());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
var submission = await client.CreateSubmissionAsync(new CreateSubmissionParams
{
TemplateId = 1000001,
SendEmail = true,
Submitters = [
new CreateSubmissionSubmitterParams
{
Role = "First Party",
Email = "john.doe@example.com"
},
]
});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
var submission = await client.CreateSubmissionFromPdfAsync(new CreateSubmissionFromPdfParams
{
Name = "Test Submission Document",
Documents = [
new CreateSubmissionFromPdfDocumentParams
{
Name = "string",
File = "base64",
Fields = [
new CreateSubmissionDocumentFieldParams
{
Name = "string",
Areas = [
new CreateSubmissionDocumentFieldAreaParams
{
X = 0,
Y = 0,
W = 0,
H = 0,
Page = 1
},
]
},
]
},
],
Submitters = [
new CreateSubmissionSubmitterParams
{
Role = "First Party",
Email = "john.doe@example.com"
},
]
});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
var submission = await client.CreateSubmissionFromDocxAsync(new CreateSubmissionFromDocxParams
{
Name = "Test Submission Document",
Variables = new Dictionary<string, object?> { ["variable_name"] = "value" },
Documents = [
new CreateSubmissionFromDocxDocumentParams
{
Name = "string",
File = "base64"
},
],
Submitters = [
new CreateSubmissionSubmitterParams
{
Role = "First Party",
Email = "john.doe@example.com"
},
]
});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
var submission = await client.CreateSubmissionFromHtmlAsync(new CreateSubmissionFromHtmlParams
{
Name = "Test Submission Document",
Documents = [
new CreateSubmissionFromHtmlDocumentParams
{
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 = [
new CreateSubmissionSubmitterParams
{
Role = "First Party",
Email = "john.doe@example.com"
},
]
});Allows you to update a submission: change its name, expiration date, and archive or unarchive it.
var submission = await client.UpdateSubmissionAsync(1001, new UpdateSubmissionParams
{
Name = "New Submission Name",
ExpireAt = "2024-09-01 12:00:00 UTC",
Archived = true
});Allows you to archive a submission.
await client.ArchiveSubmissionAsync(1001);Provides the ability to retrieve a list of submitters.
var submitters = await client.GetSubmittersAsync(new GetSubmittersParams { Limit = 10 });Provides functionality to retrieve information about a submitter, along with the submitter documents and field values.
var submitter = await client.GetSubmitterAsync(500001);Allows you to update submitter details, pre-fill or update field values and re-send emails.
Related Guides:
Automatically sign documents via API
var submitter = await client.UpdateSubmitterAsync(500001, new UpdateSubmitterParams
{
Email = "john.doe@example.com",
Fields = [
new UpdateSubmitterFieldParams
{
Name = "First Name",
Value = "Acme"
},
]
});Provides the ability to retrieve a list of available document templates.
var templates = await client.GetTemplatesAsync(new GetTemplatesParams { Limit = 10 });Provides the functionality to retrieve information about a document template.
var template = await client.GetTemplateAsync(1000001);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
var template = await client.CreateTemplateFromPdfAsync(new CreateTemplateFromPdfParams
{
Name = "Test PDF",
Documents = [
new CreateTemplateFromPdfDocumentParams
{
Name = "string",
File = "base64",
Fields = [
new CreateTemplateDocumentFieldParams
{
Name = "string",
Areas = [
new CreateTemplateDocumentFieldAreaParams
{
X = 0,
Y = 0,
W = 0,
H = 0,
Page = 1
},
]
},
]
},
]
});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
var template = await client.CreateTemplateFromDocxAsync(new CreateTemplateFromDocxParams
{
Name = "Test DOCX",
Documents = [
new CreateTemplateFromDocxDocumentParams
{
Name = "string",
File = "base64"
},
]
});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
var template = await client.CreateTemplateFromHtmlAsync(new CreateTemplateFromHtmlParams
{
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"
});Allows you to clone an existing template into a new template.
var template = await client.CloneTemplateAsync(1000001, new CloneTemplateParams
{
Name = "Cloned Template"
});Allows you to merge multiple templates with documents and fields into a new combined template.
var template = await client.MergeTemplateAsync(new MergeTemplateParams
{
TemplateIds = [321, 432],
Name = "Merged Template"
});Provides the functionality to move a document template to a different folder and update the name of the template.
var template = await client.UpdateTemplateAsync(1000001, new UpdateTemplateParams
{
Name = "New Document Name",
FolderName = "New Folder"
});Allows you to add, remove or replace documents in the template with provided PDF/DOCX file or HTML content.
var template = await client.UpdateTemplateDocumentsAsync(1000001, new UpdateTemplateDocumentsParams
{
Documents = [
new UpdateTemplateDocumentsDocumentParams
{
File = "string"
},
]
});Allows you to archive a document template.
await client.ArchiveTemplateAsync(1000001);Set timeouts to avoid hanging requests:
var client = new DocusealClient(
Environment.GetEnvironmentVariable("DOCUSEAL_API_KEY"),
new ClientOptions { Timeout = TimeSpan.FromSeconds(30) });For feature requests or bug reports, visit our GitHub Issues page.
The library is available as open source under the terms of the MIT License.