TL;DR: Call
POST /v1/template/sendwith your template ID and put the extra files in thefilesparameter to add documents to a template send via API. Send them as Base64 text in JavaScript Object Notation (JSON) or as binary in multipart/form-data. Our eSignature API page shows what else the API can do.
Your sales team keeps one approved contract template. Each deal still needs something extra, such as a quote, a price sheet or an addendum. Building a new template for every deal would take hours.
You can add those files at send time instead. The signer gets the template and your extra files in one envelope, and your saved template stays the same.
What does adding documents at send time mean?
Adding documents at send time means you attach extra files to one envelope that you send from a template. Your saved template does not change.
Think of a printed form you hand out at a front desk. You staple a receipt to one copy, and the stack of blank forms stays as it was. Our how-to guide for adding files to a template send shows the same idea in code.
What do you need before you start?
You need three things in place before you write the request. Each one maps to a part of the call.
- A BoldSign API key, or an access token from an OAuth app.
- The ID of the template you want to send.
- The extra files you want to attach.
Our API authentication guide explains both ways to sign in to the API.
How do you add documents to a template send via API?
Send a POST request to https://api.boldsign.com/v1/template/send with templateId in the query string. Add the title, message, roles and your extra files to the request body.
Each role needs a roleIndex, a signerName and a signerEmail. The endpoint accepts two content types, so pick the one that suits where your file lives.
How do you attach a file as Base64 in a JSON request?
Send each file as a data string in the files array, in the form data:application/{{fileType}};base64,{{content}}. Use this when your file is already in memory as text.
curl -X 'POST' \
'https://api.boldsign.com/v1/template/send?templateId=YOUR_TEMPLATE_ID' \
-H 'accept: application/json' \
-H 'X-API-KEY: {YOUR_API_KEY}' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"title": "Invitation form",
"message": "Kindly review and sign this.",
"roles": [
{
"roleIndex": 1,
"signerName": "david",
"signerEmail": "david@cubeflakes.com"
}
],
"files": [
"data:application/{{fileType}};base64,{{content}}"
]
}'
How do you attach a file in a multipart/form-data request?
Send each file as a files form field in its original binary form. Pick this when your file sits on disk, as in the software development kit (SDK) samples below.
curl -X 'POST' \
'https://api.boldsign.com/v1/template/send?templateId=b8085b47-63b3-47f8-8d5e-cb0acfe2d916' \
-H 'accept: application/json' \
-H 'X-API-KEY: {your API key}' \
-F 'files=@{your file path};type=application/pdf' \
-F 'title=Invitation form' \
-F 'message=Kindly review and sign this.' \
-F 'roles[0][roleIndex]=1' \
-F 'roles[0][signerName]=Richard' \
-F 'roles[0][signerEmail]=richard@boldsign.dev'
var apiClient = new ApiClient("https://api.boldsign.com", "{YOUR_API_KEY}");
var templateClient = new TemplateClient(apiClient);
var documentFilePath = new DocumentFilePath
{
ContentType = "application/pdf",
FilePath = "YOUR_FILE_PATH"
};
var filesToUpload = new List<IDocumentFile>
{
documentFilePath,
};
var templateRole = new Roles(
roleSignerName:"david",
roleSignerEmailAddress:"david@cubeflakes.com",
roleSignerIndex:1
);
var roles = new List<Roles>
{
templateRole,
};
var sendForSignFromTemplate = new SendForSignFromTemplate()
{
TemplateId = "YOUR_TEMPLATE_ID",
Roles = roles,
Files = filesToUpload,
};
var documentCreated = templateClient.SendUsingTemplate(sendForSignFromTemplate);
import boldsign
configuration = boldsign.Configuration(api_key="YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
template_api = boldsign.TemplateApi(api_client)
send_for_sign_from_template_form = boldsign.SendForSignFromTemplateForm(
title="Invitation form",
message="Kindly review and sign this",
files=["YOUR_FILE_PATH"],
roles=[boldsign.Role(roleIndex=1, signerName="david", signerEmail="david@cubeflakes.com")],
)
document_created = template_api.send_using_template(
template_id="YOUR_TEMPLATE_ID",
send_for_sign_from_template_form=send_for_sign_from_template_form,
)
<?php
require_once "vendor/autoload.php";
use BoldSign\Configuration;
use BoldSign\Api\TemplateApi;
use BoldSign\Model\{Role, SendForSignFromTemplateForm, FileInfo};
$config = new Configuration();
$config->setHost('https://api.boldsign.com');
$config->setApiKey('YOUR_API_KEY');
$template_api = new TemplateApi($config);
$role = new Role();
$role->setRoleIndex(1);
$role->setSignerName('david');
$role->setSignerEmail('david@cubeflakes.com');
$send_for_sign_from_template = new SendForSignFromTemplateForm();
$send_for_sign_from_template->setRoles([$role]);
$files = new FileInfo();
$files = 'YOUR_FILE_PATH';
$send_for_sign_from_template->setFiles([$files]);
$document_created = $template_api->sendUsingTemplate($template_id = 'YOUR_TEMPLATE_ID', $send_for_sign_from_template);
?>
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
TemplateApi templateApi = new TemplateApi(client);
Role role = new Role();
role.roleIndex(1);
role.setSignerName("david");
role.setSignerEmail("david@cubeflakes.com");
SendForSignFromTemplateForm sendForSignFromTemplate = new SendForSignFromTemplateForm();
sendForSignFromTemplate.setRoles(Arrays.asList(role));
File file = new File("YOUR_FILE_PATH");
sendForSignFromTemplate.setFiles(Arrays.asList(file));
DocumentCreated documentCreated =
templateApi.sendUsingTemplate("YOUR_TEMPLATE_ID", sendForSignFromTemplate);
import { TemplateApi, Role, SendForSignFromTemplateForm } from "boldsign";
import * as fs from "fs";
async function main() {
const templateApi = new TemplateApi();
templateApi.setApiKey("YOUR_API_KEY");
const role = new Role();
role.roleIndex = 1;
role.signerName = "david";
role.signerEmail = "david@cubeflakes.com";
const sendForSignFromTemplate = new SendForSignFromTemplateForm();
sendForSignFromTemplate.roles = [role];
const files = fs.createReadStream("YOUR_FILE_PATH");
sendForSignFromTemplate.files = [files];
const documentCreated = templateApi.sendUsingTemplate(
"YOUR_TEMPLATE_ID",
sendForSignFromTemplate,
);
}
main();
What file rules apply to added documents?
Use either files or fileUrls in one request, never both. The fileUrls option takes public links that our API can reach.
- Upload up to 25 files in one request.
- Keep each document at 1,000 pages or fewer.
- Keep each document at 25 megabytes or smaller.
- Use PDF, Portable Network Graphics (PNG), JPEG (JPG), Word (DOCX), Excel (XLSX) or PowerPoint (PPTX) files.
- Prefer PDF when you can.
How can you customize the template send request?
Replace the API key, signer details, file paths and template ID in the samples with your own values. The same request also takes options for production use.
enableSigningOrdermakes signers sign one after another.ccadds people who get a copy but do not sign.reminderSettingssets automatic reminders.brandIdapplies one of your saved brands.
The template send API reference lists every property with examples.
Which BoldSign plan do you need for the API, and what does it cost?
Live API access comes with the Enterprise API plan, which starts at $30 a month with 40 envelopes. Extra envelopes cost $0.75 each, and the plan includes unlimited templates and brands.
You can build and test first in our free sandbox, with no credit card. Sandbox documents carry a test watermark and are deleted after 14 days. Prices are in USD, as listed on the BoldSign pricing page in November 2026.
Where do you go next with template sends via API?
Start with one template and one extra PDF in the sandbox. Then add the options your workflow needs.
- Create a free API sandbox account and run the client URL (cURL) sample.
- Schedule a demo to walk through your template workflow with our team.
- Open a ticket in our support portal with a question about your request.
Frequently asked questions
Can I add a document to a template when I send it through the API?
Yes. Pass the extra files in the files parameter of the template send request. The signer gets the template documents and your added files in one envelope.
Does adding a file change my saved template?
No. The added file goes into that one envelope only. Your saved template keeps its own documents for the next send.
How many extra files can I attach to one template send?
You can upload up to 25 files in one request. Each document can have up to 1,000 pages and must be 25 megabytes or smaller.
Which file types can I attach?
You can attach PDF, PNG and JPG images, and Word, Excel and PowerPoint files. PDF is the preferred format.
Can I send files and fileUrls in the same request?
No. A request carries either uploaded files or public file links. Pick the one that matches where your file lives.
Should I use JSON or multipart/form-data?
Use JSON when the file is already in memory as Base64 text. Use multipart/form-data when you read the file from disk or let an SDK upload it.
Is a template envelope with added documents legally binding?
Yes, when the signers agree to sign electronically and the signed record is kept. Every envelope gets an audit trail. Check the rules for your document type and country.
Can I try the BoldSign API for free?
Yes. Our free sandbox needs no credit card. Sandbox documents carry a test watermark and are deleted after 14 days.