Using the BoldSign API, you can efficiently send documents to multiple recipients in a single request. In this blog, we’ll walk through how to structure your API call to include several recipients for a signature request.

Sending a document to multiple recipients

To send a document for signature to multiple recipients, you can structure your API request to include all signers in one go. The BoldSign API allows you to define multiple signers, assign specific form fields to each signer, and ensure that each recipient signs in the required sections of the document.

Here are some code snippets in different programming languages that demonstrate how to send a document with multiple signers:


curl -X 'POST' \ 'https://api.boldsign.com/v1/document/send' \
     -H 'accept: application/json' \
     -H 'X-API-KEY: {Your API key}' \
     -H 'Content-Type: multipart/form-data' \
     -F 'Message=' \
     -F 'Signers=
      {
        "name": "Hanky",
        "emailAddress": "[email protected]",
        "signerType": "Signer",
        "formFields": 
        [
          {
            "id": "sign",
            "fieldType": "Signature",
            "pageNumber": 1,
            "bounds": 
            {
              "x": 50,
              "y": 50,
              "width": 200,
              "height": 25
            },
            "isRequired": true
          }
        ],
        "locale": "EN"
      }'
     -F 'Signers=
      {
        "name": "Cilian",
        "emailAddress": "[email protected]",
        "signerType": "Signer",
        "formFields": 
        [
          {
            "id": "sign_1",
            "fieldType": "Signature",
            "pageNumber": 2,
            "bounds": {
              "x": 100,
              "y": 100,
              "width": 200,
              "height": 25
                },
              "isRequired": true
          }
        ],
        "locale": "EN"
      }' \
  -F 'Files=@{Your file path}' \
  -F 'Title={Title of the document}' \
 
var apiClient = new ApiClient("https://api.boldsign.com", "{Your API key}");
var documentClient = new DocumentClient(apiClient);

var documentFilePath = new DocumentFilePath
{
    ContentType = "application/pdf",
    FilePath = "{Your file path}"
};

var filesToUpload = new List
{
    documentFilePath,
};

var signatureField = new FormField(
    id: "sign",
    isRequired: true,
    type: FieldType.Signature,
    pageNumber: 1,
    bounds: new Rectangle(x: 50, y: 50, width: 200, height: 25));

var signatureField1 = new FormField(
    id: "sign_1",
    isRequired: true,
    type: FieldType.Signature,
    pageNumber: 1,
    bounds: new Rectangle(x: 100, y: 100, width: 200, height: 25));

var formFieldCollections = new List()
{
    signatureField
};

var formFieldCollections1 = new List()
{
    signatureField1
};

var signer = new DocumentSigner(
    signerName: "David",
    signerType: SignerType.Signer,
    signerEmail: "[email protected]",
    formFields: formFieldCollections,
    locale: Locales.EN);

var signer1 = new DocumentSigner(
    signerName: "Cilian",
    signerType: SignerType.Signer,
    signerEmail: "[email protected]",
    formFields: formFieldCollections1,
    locale: Locales.EN);

var documentSigners = new List()
{
    signer,
    signer1
};

var sendForSign = new SendForSign()
{
    Title = "Agreement",
    Signers = documentSigners,
    Files = filesToUpload
};
var documentCreated = documentClient.SendDocument(sendForSign);
Console.WriteLine(documentCreated.DocumentId);

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

signer_1 = {

   "name": "Hanky",
   "emailAddress": "[email protected]",
   "signerType": "Signer",
   "formFields": [

       {
           "id": "sign",
           "name": "string",
           "fieldType": "Signature",
           "pageNumber": 1,
           "bounds": {
               "x": 50,
               "y": 50,
               "width": 200,
               "height": 25
           },

           "isRequired": True
       }

   ],

   "locale": "EN"

}

signer_2 = {

   "name": "Cilian",
   "emailAddress": "[email protected]",
   "signerType": "Signer",
   "formFields": [

       {
           "id": "sign_1",
           "name": "sign_1",
           "fieldType": "Signature",
           "pageNumber": 2,
           "bounds": {
               "x": 100,
               "y": 100,
               "width": 200,
               "height": 25
           },

           "isRequired": True
       }

   ],

   "locale": "EN"

}

payload = {

   'Signers': [json.dumps(signer_1), json.dumps(signer_2)],
   'Title': '{Title of the document}'

}

files = [

   ('Files', ('[Your file name]', open('{Your file path}', 'rb'), 'application/pdf'))

]

headers = {

   'accept': 'application/json',
   'X-API-KEY': '{Your API key}'

}

response = requests.post(url, headers=headers, data=payload, files=files)
print(response.text)
 

const axios = require('axios');

const FormData = require('form-data');

const fs = require('fs');

// Create form data

const form = new FormData();

const signer1 = {

 name: "Hanky",
 emailAddress: "[email protected]",
 signerType: "Signer",
 formFields: [

   {
     id: "string",
     fieldType: "Signature",
     pageNumber: 1,
     bounds: {
       x: 50,
       y: 50,
       width: 200,
       height: 25
     },
     
     isRequired: true

   }

 ],

 locale: "EN"

};

const signer2 = {

 name: "Cilian",
 emailAddress: "[email protected]",
 signerType: "Signer",
 formFields: [

   {
     id: "sign_1",
     name: "sign_1",
     fieldType: "Signature",
     pageNumber: 2,
     bounds: {
       x: 100,
       y: 100,
       width: 200,
       height: 25
     },

     isRequired: true
   }

 ],

 locale: "EN"

};

// Append the message, signers, and other fields to form data

form.append('Signers', JSON.stringify(signer1));
form.append('Signers', JSON.stringify(signer2));
form.append('Title', '{Title of the document}');

// Attach file to form data

form.append('Files', fs.createReadStream('{Your file path}'), '[Your file name]');

// Define headers

const headers = {

 ...form.getHeaders(),
 'accept': 'application/json',
 'X-API-KEY': '{Your API key}'

};

// Make the POST request

axios.post('https://api.boldsign.com/v1/document/send', form, { headers })

 .then(response => {
   console.log(response.data);
 })

 .catch(error => {
   console.error(error);
 });
 

<?php

require 'vendor/autoload.php';

use GuzzleHttp\Client;

use GuzzleHttp\Psr7\Request;

use GuzzleHttp\Psr7\MultipartStream;

$client = new Client([
   'verify' => false
]);

// Define signer1 and signer2 data

$signer1 = [

   'name' => 'Hanky',
   'emailAddress' => '[email protected]',
   'signerType' => 'Signer',
   'formFields' => [

       [

           'id' => 'string',
           'fieldType' => 'Signature',
           'pageNumber' => 1,
           'bounds' => [

               'x' => 50,
               'y' => 50,
               'width' => 200,
               'height' => 25

           ],

           'isRequired' => true

       ]

   ],

   'locale' => 'EN'

];

$signer2 = [

   'name' => 'Cilian',
   'emailAddress' => '[email protected]',
   'signerType' => 'Signer',
   'formFields' => [

       [

           'id' => 'sign_1',
           'name' => 'sign_1',
           'fieldType' => 'Signature',
           'pageNumber' => 2,
           'bounds' => [

               'x' => 100,
               'y' => 100,
               'width' => 200,
               'height' => 25

           ],

           'isRequired' => true

       ]

   ],

   'locale' => 'EN'

];


// Create multipart form data

$multipart = new MultipartStream([

   [

       'name'     => 'Signers',
       'contents' => json_encode($signer1)

   ],

   [

       'name'     => 'Signers',
       'contents' => json_encode($signer2)

   ],

   [

       'name'     => 'Title',

       'contents' => '{Title of the document}'

   ],

   [

       'name'     => 'Files',
       'contents' => fopen('{Your file path}', 'r'),
       'filename' => '[Your file name]',
       'headers'  => ['Content-Type' => 'application/pdf']

   ]

]);


// Make the POST request

$response = $client->post('https://api.boldsign.com/v1/document/send', [

   'headers' => [

       'accept'     => 'application/json',
       'X-API-KEY'  => '{Your API key}'

   ],

   'body' => $multipart

]);

// Get the response

echo $response->getBody();
?>
 

Customizing your request

In the previous examples, replace the placeholders like the API key, signers’ details, file paths, and titles with your specific data to send the document to your recipients. Upon calling the API with any of these code snippets, the document will be sent to the specified recipients.

Conclusion

By utilizing BoldSign’s API, you can send a document to multiple recipients with ease. This approach helps streamline your signing workflow, saving time and minimizing errors. With just a few modifications to the request, you can accommodate multiple signers, ensuring a seamless signing process for your team or clients.

Start your 30-day BoldSign free trial now to see the advantages of BoldSign. We sincerely appreciate your input, so please feel free to comment below. Book a demo or contact our support team via our support portal if you need any help or would like to learn more about our services.