DocSpring.Client
3.4.0
See the version list below for details.
dotnet add package DocSpring.Client --version 3.4.0
NuGet\Install-Package DocSpring.Client -Version 3.4.0
<PackageReference Include="DocSpring.Client" Version="3.4.0" />
<PackageVersion Include="DocSpring.Client" Version="3.4.0" />
<PackageReference Include="DocSpring.Client" />
paket add DocSpring.Client --version 3.4.0
#r "nuget: DocSpring.Client, 3.4.0"
#:package DocSpring.Client@3.4.0
#addin nuget:?package=DocSpring.Client&version=3.4.0
#tool nuget:?package=DocSpring.Client&version=3.4.0
DocSpring C# SDK
The official C# client for the DocSpring API. DocSpring fills PDF templates with your data, generates PDFs from HTML templates, combines PDFs and collects e-signatures.
Documentation · API reference · NuGet · Changelog
Version 3.4.0. Requires .NET Standard 2.0 (.NET 6 or later, or .NET Framework 4.6.2 or later).
Install and configure
Install from NuGet:
Package Manager
PM> Install-Package DocSpring.Client
.NET CLI
dotnet add package DocSpring.Client
Paket CLI
paket add DocSpring.Client
Configure authentication via environment variables:
export DOCSPRING_TOKEN_ID="API_TOKEN_ID"
export DOCSPRING_TOKEN_SECRET="API_TOKEN_SECRET"
You can also configure the region or host. The host takes priority over the region:
export DOCSPRING_REGION="US" # US or EU (defaults to US)
export DOCSPRING_HOST="docspring.yourcompany.com" # For on-premise deployments
Initialize the client:
var api = DocSpring.Client.Client.EnvClientFactory.NewClient();
Or provide credentials directly:
var api = DocSpring.Client.Client.EnvClientFactory.NewClient("API_TOKEN_ID", "API_TOKEN_SECRET");
Generate a PDF
Fill a template with data (use your template's ID in place of tpl_1234567890abcdef01):
var templateId = "tpl_1234567890abcdef01";
var submission = new DocSpring.Client.Model.CreatePdfSubmissionData(
new Dictionary<string, object> {
{ "first_name", "John" },
{ "last_name", "Smith" },
{ "phone_number", "+11234567890" }
}
) {
metadata = new Dictionary<string, object> {
{ "foo", 123 },
{ "bar", "baz" }
}
};
var task = api.GeneratePdfAsync(templateId, submission: submission);
var resp = await task;
Console.WriteLine(resp);
By default the call waits for the PDF, for up to 95 seconds, and the submission in the response has its
download_url. Set wait to false to get a pending submission straight away.
Sync vs. async processing covers the time limit, status
checks and webhooks.
Methods
docs/apis/Client.md has each method's parameters and return type, and docs/models/ has the models. The API reference has C# code for every method.
| Method | Description |
|---|---|
AddFieldsToTemplate |
Add new fields to a Template |
BatchGeneratePdfs |
Generate multiple PDFs |
CombinePdfs |
Merge submission PDFs, template PDFs, or custom files |
CopyTemplate |
Copy a template |
CreateCustomFileFromUpload |
Create a new custom file from a cached S3 upload |
CreateDataRequestEvent |
Create a new event for emailing a signee a request for signature |
CreateDataRequestToken |
Create a new data request token for form authentication |
CreateFolder |
Create a folder |
CreateHtmlTemplate |
Create a new HTML template |
CreatePdfTemplate |
Create a new PDF template with a form POST file upload |
CreatePdfTemplateFromUpload |
Create a new PDF template from a cached S3 file upload |
CreateWebhook |
Create a webhook |
DeleteFolder |
Delete a folder |
DeleteTemplate |
Delete a template |
DeleteWebhook |
Delete a webhook |
ExpireCombinedSubmission |
Expire a combined submission |
ExpireSubmission |
Expire a PDF submission |
GeneratePdf |
Generate a PDF |
GeneratePreview |
Generate a preview PDF for partially completed data requests |
GetCombinedSubmission |
Check the status of a combined submission (merged PDFs) |
GetDataRequest |
Look up a submission data request |
GetFullTemplate |
Fetch the full attributes for a PDF template |
GetPresignUrl |
Get a presigned S3 URL for direct file upload |
GetSubmission |
Check the status of a PDF |
GetSubmissionBatch |
Check the status of a submission batch job |
GetTemplate |
Check the status of an uploaded template |
GetTemplateModelCode |
Generate typed model code for a template |
GetTemplateSchema |
Fetch the JSON schema for a template |
GetWebhook |
Get a webhook |
ListCombinedSubmissions |
Get a list of all combined submissions |
ListFolders |
Get a list of all folders |
ListSubmissions |
List all submissions |
ListTemplates |
Get a list of all templates |
ListTemplateSubmissions |
List all submissions for a given template |
ListWebhooks |
Get a list of all webhooks |
MoveFolderToFolder |
Move a folder |
MoveTemplateToFolder |
Move Template to folder |
PublishTemplateVersion |
Publish a template version |
RenameFolder |
Rename a folder |
RestoreTemplateVersion |
Restore a template version |
TestAuthentication |
Test authentication |
UpdateDataRequest |
Update a submission data request |
UpdateTemplate |
Update a Template |
UpdateTemplateDocument |
Update a template's document with a form POST file upload |
UpdateTemplateDocumentFromUpload |
Update a template's document with a cached S3 file upload |
UpdateWebhook |
Update a webhook |
Errors
Methods return a response object rather than throwing for an error status. IsCreated, IsUnprocessableContent and the other Is... properties say which documented response came back, and Created() or TryCreated(out var result) give you its body.
API changes
DocSpring adds fields and enum values to API v1 without releasing a new API version. Changes that would break existing code, such as removing or renaming a field, go in a new API version (API changes). So this SDK keeps working with responses that are newer than it is:
- The model leaves out a response field added to the API after this release (models have an
AdditionalPropertiesdictionary, but the generated JSON converters don't fill it). - An enum value added to the API after this release comes back as
UnknownDefaultOpenApi, so give eachswitchover an enum a case or default for it.
Upgrade the SDK to read new fields and enum values. The changelog lists what each release adds.
About this SDK
This SDK is generated from DocSpring's OpenAPI spec with DocSpring's fork of OpenAPI Generator 7.16.0. The fork changes the C# generator:
- Enum values added to the API after this release come back as
UnknownDefaultOpenApiinstead of throwing, for required and nullable enums. - Nullable enums read and write
nullwithout throwing. - File uploads send a
multipart/form-databody with the file's name and boundary. - Paths with a query string (
?endpoint_variant=...) aren't percent-encoded into the path. - Model constructors assign required properties, and optional object and list properties serialize their value rather than the
Option<T>wrapper.
On top of the generated code, we add:
- A client constructor that reads your credentials, region and host from the environment.
DocSpring.Sdk.NewClient(...)andDocSpring.Sdk.NewClientFromEnv(), which build a client without a .NET host builder.
Because the code is generated, we can't merge pull requests that change it. Please open an issue or email support@docspring.com instead, and we'll fix it in the generator. AGENTS.md is a short guide for AI coding agents.
License
MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Hosting (>= 5.0.0)
- Microsoft.Extensions.Http (>= 5.0.0)
- Microsoft.Extensions.Http.Polly (>= 5.0.1)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Threading.Channels (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.5.0 | 0 | 10/18/2026 |
| 3.4.0 | 37 | 10/18/2026 |
| 3.3.0 | 49 | 10/15/2026 |
| 3.2.0 | 342 | 9/23/2025 |
| 3.1.0 | 745 | 3/22/2025 |
| 3.0.1 | 200 | 2/26/2025 |
| 3.0.0 | 201 | 2/22/2025 |
| 2.0.0 | 193 | 1/30/2025 |
| 1.4.3 | 767 | 11/27/2021 |
| 1.4.2 | 480 | 11/27/2021 |
| 1.4.1 | 2,653 | 11/18/2020 |
| 1.4.0 | 828 | 9/26/2020 |
| 1.3.1 | 695 | 9/23/2020 |
| 1.3.0 | 667 | 9/21/2020 |
| 1.2.0 | 636 | 9/12/2020 |
| 1.1.0 | 665 | 7/6/2020 |
| 1.0.0 | 777 | 11/8/2019 |