Skip to content
  1. Blog
  2. API

Better Contract Management with the BoldSign API: Send Contracts from Code

TL;DR: You need a BoldSign API key, a PDF and one request to send a contract for signature from your own code. This guide builds an employment contract request in C#, Python and Node.js, and you can test it in a free sandbox. Our eSignature API page shows what else the API can do.

Your team sends the same employment contract to every new hire. Someone fills in the name, places the signature box and emails the file, then chases the reply.

An e signature API moves those steps into your own app. Your system already holds the new hire’s name and email address, so the contract can go out the moment the record exists.

What is an e signature API for contract management?

An e signature API lets your software send documents for signature without anyone opening a web app. Your code uploads the contract, says who signs and where, and we handle the emails and the signing.

Think of a mail merge for letters. You write the letter once, and the software fills in each name and address. The API does the same for contracts, then collects the signature too.

What do you need to start with the BoldSign API?

You need an account, a client library for your language and an API key. Setting up all three takes a few minutes.

  1. Create a free API sandbox account. It needs no credit card.
  2. For C#, install the BoldSign.Api NuGet package. Python and Node.js only need a library that sends web requests.
  3. Generate a BoldSign API key. Our guide to generating API keys in BoldSign shows each step.

You can have up to 4 API keys at once, with no more than 2 in each environment. A sandbox key sends test documents, and a live key sends real ones.

What does the contract document need?

Start with a PDF of the contract that holds its standard clauses. You then add fields on top of it for the parts that change, such as the signature and the signer’s name.

The sample below uses a simple PDF with two empty spaces. The first is for the signature. The second shows the signer’s printed name, which we fill in from your data.

The code follows four steps:

  • Set up the client with your API key.
  • Collect the signer’s details.
  • Design the fields.
  • Add the signer and send the contract.

How do you set up the client?

You need the API key you generated and the PDF of the contract. Every request carries the key in a request header, as the code below shows.

The sample puts the key in the code to keep the demo short. In your own app, keep it in a key vault or encrypted settings, so the key never reaches your code repository.

using BoldSign.Api;
using BoldSign.Model;

var apiClient = new ApiClient("https://api.boldsign.com", "[Your API Key]");
var documentClient = new DocumentClient(apiClient);
import requests
import json

url = "https://api.boldsign.com/v1/document/send"

headers = {"accept": "application/json", "X-API-KEY": "[Your API Key]"}
const axios = require("axios");
const fs = require("fs");

const apiClient = axios.create({
  baseURL: "https://api.boldsign.com",
  headers: { "X-API-KEY": "[Your API Key]" },
});

How do you collect the signer’s details?

For this example, you only need the signer’s name and email address. We email that address a link to sign the document online.

The name also fills the printed name field, which the signer cannot change. In a real app, these details come from your HR system or database; the sample keeps them in memory.

var signer = new Signer
{
    Name = "Alex",
    EmailAddress = "alex@example.com"
};
signer = {"name": "Alex", "emailAddress": "alex@example.com"}
const signer = {
  name: "Alex",
  emailAddress: "alex@example.com",
};

How do you add signature fields to the contract?

A field is a place on the document where the signer acts, such as a signature box. You give each field an ID, a type, a page number and a position.

The position is a rectangle set by x, y, width and height. You can also mark a field as required, so the signer has to complete it before finishing.

Beyond signatures and labels, you can add checkboxes, text boxes, dates and more. Put all your fields in one list for the next step.

var signature = new FormField(
    id: "sign",
    isRequired: true,
    type: FieldType.Signature,
    pageNumber: 1,
    bounds: new Rectangle(x: 500, y: 740, width: 200, height: 50));
var printedNameField = new FormField(
    id: "printedName",
    value: signer.Name,
    isRequired: true,
    type: FieldType.Label,
    pageNumber: 1,
    bounds: new Rectangle(x: 500, y: 810, width: 200, height: 50));

var formFieldCollections = new List<FormField>()
{
    signature,
    printedNameField
};
signature = {
    "id": "sign",
    "name": "string",
    "fieldType": "Signature",
    "pageNumber": 1,
    "bounds": {"x": 500, "y": 740, "width": 200, "height": 50},
    "isRequired": True,
}

printed_name_field = {
    "id": "printedName",
    "name": "string",
    "value": signer["name"],
    "fieldType": "Label",
    "pageNumber": 1,
    "bounds": {"x": 500, "y": 810, "width": 200, "height": 50},
    "isRequired": True,
}

form_field_collections = [signature, printed_name_field]
const signature = {
  id: "sign",
  isRequired: true,
  fieldType: "Signature",
  pageNumber: 1,
  bounds: { x: 500, y: 740, width: 200, height: 50 },
};

const printedNameField = {
  id: "printedName",
  value: signer.name,
  isRequired: true,
  fieldType: "Label",
  pageNumber: 1,
  bounds: { x: 500, y: 810, width: 200, height: 50 },
};

const formFieldCollections = [signature, printedNameField];

How do you add signers to the contract?

Each person who signs needs a signer entry with a name, an email address and their fields. Add one entry per signer, and we email each of them a request to sign.

Signers do not need a BoldSign account. Signers who create one can see every document they signed in one place.

The sample also sets the file to upload, the title and the message the signer reads.

var documentSigner = new DocumentSigner(
    signerName: signer.Name,
    signerType: SignerType.Signer,
    signerEmail: signer.EmailAddress,
    formFields: formFieldCollections,
    locale: Locales.EN);

var documentSigners = new List<DocumentSigner>()
{
    documentSigner
};

var documentFilePath = new DocumentFilePath
{
    ContentType = "application/pdf",
    FilePath = "my-first-contract.pdf",
};

var filesToUpload = new List<IDocumentFile>
{
    documentFilePath
};

var sendForSign = new SendForSign()
{
    Message = "Please sign this",
    Title = "Agreement",
    HideDocumentId = false,
    Signers = documentSigners,
    Files = filesToUpload
};
signer_data = {
    "name": signer["name"],
    "emailAddress": signer["emailAddress"],
    "signerType": "Signer",
    "formFields": form_field_collections,
    "locale": "EN",
}

payload = {
    "DisableExpiryAlert": "false",
    "ReminderSettings.ReminderDays": "3",
    "BrandId": "",
    "ReminderSettings.ReminderCount": "5",
    "EnableReassign": "true",
    "Message": "Please sign this.",
    "Signers": json.dumps(signer_data),
    "ExpiryDays": "10",
    "EnablePrintAndSign": "false",
    "AutoDetectFields": "false",
    "OnBehalfOf": "",
    "EnableSigningOrder": "false",
    "UseTextTags": "false",
    "SendLinkValidTill": "",
    "Title": "Agreement",
    "HideDocumentId": "false",
    "EnableEmbeddedSigning": "false",
    "ExpiryDateType": "Days",
    "ReminderSettings.EnableAutoReminder": "false",
    "ExpiryValue": "60",
    "DisableEmails": "false",
    "DisableSMS": "false",
}

files = [("Files", ("file", open("my-first-contract.pdf", "rb"), "application/pdf"))]
const documentSigner = {
  name: signer.name,
  signerType: "Signer",
  emailAddress: signer.emailAddress,
  formFields: formFieldCollections,
  locale: "en",
};

const FormData = require("form-data");
const form = new FormData();

form.append("Signers", JSON.stringify(documentSigner));
form.append("Title", "Agreement");
form.append("Message", "Please sign this.");
form.append("HideDocumentId", "false");

form.append("Files", fs.readFileSync("my-first-contract.pdf"), {
  filename: "my-first-contract.pdf",
  contentType: "application/pdf",
});

How do you send the contract?

The send call goes to the /v1/document/send endpoint with the message, title, signers and files. In C#, that is the SendDocument method.

The response holds a DocumentId. Save it with your own record, so you can look up the contract and its status later.

var documentCreated = documentClient.SendDocument(sendForSign);
Console.WriteLine($"Document sent. Id: {documentCreated.DocumentId}");
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
apiClient
  .post("/v1/document/send", form)
  .then((response) => {
    console.log(`Document sent. Id: ${response.data.documentId}`);
  })
  .catch((error) => {
    console.error("Error sending document:", error.response.data);
  });

Why manage contracts through an e signature API?

Sending from code takes the hand work out of each contract. The steps run the same way every time, so fewer mistakes slip in.

  • Contracts go out as soon as your system has the signer’s details.
  • Templates keep the same fields in place for every send.
  • Bulk send delivers one contract to many signers at once.
  • Each signed document comes with an audit trail of who signed and when.

Read our security policy to see how we protect the documents you send.

Which BoldSign API plan do you need, and what does it cost?

Live API requests need the Enterprise API plan, from $30 a month with 40 envelopes, as listed on the BoldSign pricing page in November 2026. Each extra envelope costs $0.75, and prices are in USD.

The plan also covers templates and bulk send. To build and test first, use the free sandbox. It needs no credit card, and its documents carry a test watermark and are deleted after 14 days.

How do you send your first contract from code?

Pick one contract your team sends often and send it from the sandbox first. These links help you take the next step.

Frequently asked questions

Is there a free e signature API I can test with?

Yes. The BoldSign sandbox is free and needs no credit card. Sandbox documents carry a test watermark and are deleted after 14 days.

Are contracts signed through an e signature API legally binding?

Yes, when they meet the same rules as any other electronic signature, such as the signer's intent to sign. The API only changes how you send the contract, not how it is signed.

Does the signer need a BoldSign account?

No. Signers get an email with a link and sign in their browser. An account is optional and lets them see the documents they signed.

Which programming languages can I use with the BoldSign API?

Any language that can send a web request works. This guide shows C# with the BoldSign.Api NuGet package, Python with requests and Node.js with axios.

How many API keys can I create in BoldSign?

You can have up to 4 API keys at once, with no more than 2 in each environment. Each key belongs to either the sandbox or the live environment.

What file types can I send for signature through the API?

PDF files are preferred, and image, Word, Excel and PowerPoint files also work. One request takes up to 25 files, with up to 25 megabytes and 1,000 pages per document.

How do I know a contract was sent?

The send request returns a document ID for the new contract. Save it with your own record so you can look up the document and its status later.

How much does the BoldSign API cost?

The Enterprise API plan starts at $30 a month with 40 envelopes, and each extra envelope costs $0.75. Building and testing in the sandbox is free.

Raul Junco

Raul has been developing backend systems for almost 20 years. He is a Software Engineering Manager by day and a writer by night, sharing his experiences in the field. Raul simplifies software engineering and systems design, helping software engineers.

More posts by Raul Junco
Get started

Sign up for your free trial today!

Start free trial
  • 30-day free trial
  • No credit card required