Send documents for signature via API

Prerequisites:

Sign Up and Obtain API Key: Visit DocuSeal API Console to obtain your API key.

Template ID: Identify the template ID you want to use for the form.

1

Send default document signing request email

POST request to https://api.docuseal.co/submissions. Include the obtained API key in the headers along with the content type ('application/json'). Specify the template_id and submitter details:

  • email: pass email address of each individual party in the document signing process.
  • role: specifies the designated role of each participant (e.g., 'Director', 'Contractor'). Pass role names defined in the template form.
  • order: pass 'preserved' order to send email only to the first signer party, second party will receive an eamil after the document is signed by the first party. Pass 'random' to send emails to all parties right away to allow them to sign in random order.

Upon a successful request, specified submitters of the document will receive an email invitation to click on the link to fill and sign the document.

import axios from "axios";

const API_KEY = 'YOUR_API_KEY';

axios.request({
  method: 'POST',
  url: 'https://api.docuseal.co/submissions',
  headers: {
    'X-Auth-Token': API_KEY,
    'content-type': 'application/json'
  },
  data: {
    template_id: 123,
    order: 'preserved',
    submitters: [
      {
        email: 'john.doe@example.com',
        role: 'Director'
      },
      {
        email: 'roe.moe@example.com',
        role: 'Contractor'
      }
    ]
  }
}).then((response) => {
  console.log(response.data[0].slug);
});
2

Send custom document signing request email message

POST request to https://api.docuseal.co/submissions. Include the obtained API key in the headers along with the content type ('application/json').
Specify the message and submitter details:

  • subject: Custom email message subject line.
  • body: Custom email message body, can contain the following variables:
{{template.name}} Name of the template document form
{{template.id}} ID of the template document form
{{submitter.link}} Signing form link
{{account.name}} Your company name
{{sender.name}} Full name of the user requesting signature
{{sender.first_name}} First name of the user requesting signature
{{submitter.email}} Signer (aka Submitter) email address
{{submitter.name}} Signer (aka Submitter) full name
{{submitter.first_name}} Signer (aka Submitter) first name
{{submitter.slug}} Unique key which is used to open the embedded signing form

Upon a successful request, specified submitters of the document will receive an email invitation with custom message.

Learn more:

REST API Reference

import axios from "axios";

const API_KEY = 'YOUR_API_KEY';

axios.request({
  method: 'POST',
  url: 'https://api.docuseal.co/submissions',
  headers: {
    'X-Auth-Token': API_KEY,
    'content-type': 'application/json'
  },
  data: {
    template_id: 123,
    message: {
      subject: 'Custom Subject',
      body: 'Custom Message {{submitter.link}}'
    },
    submitters: [
      {
        email: 'john.doe@example.com',
        role: 'Director'
      },
      {
        email: 'roe.moe@example.com',
        role: 'Contractor'
      }
    ]
  }
}).then((response) => {
  console.log(response.data[0].slug);
});