Create Signature Requests
Create a new PDF job submission with pending signature requests
Section titled “Create a new PDF job submission with pending signature requests”API v1 calls signature requests data requests (data_requests). They’re the same records.
This feature allows you to request information or signatures from one or more people. DocSpring emails each person a link to sign and, once everyone has signed, emails them the signed PDF. You can also send the links yourself or embed the signing form on your website: set send_email to false for everyone, or for one person. See Emails from DocSpring.
Once all of the signature requests have been completed, we will generate the final PDF, and DocSpring can send a webhook notification to your server. If a signer declines to sign, the submission is cancelled instead and no PDF is generated.
Each signature request that asks its signer to sign or initial adds 60 credits to the final live PDF’s cost. Signature requests that only collect values add nothing: you pay only for the PDF. Creating signature requests, issuing access tokens, and recording events have no separate charge. Watermarked test submissions and previews are free.
API Endpoint
Section titled “API Endpoint”This uses the same API endpoint as a regular PDF generation request, with an additional signature_requests array.
Signature requests are for PDF templates only.
Parameters
Section titled “Parameters”The request body must be a JSON object with the following properties:
data(object, optional): Values for the fields that nobody fills in, by field name. Required unless the signature requests collect every value.metadata(object, optional): Any additional data, such as a user id.metadatawill be included in webhook requests.test(boolean, optional):trueto generate a test PDF,falsefor a live PDF. Test PDFs are free, but watermarked.send_email(boolean, optional): Whether DocSpring emails the signers their signing links, any reminders and the signed PDF. Defaulttrue. Each signature request’s ownsend_emailoverrides it. DocSpring doesn’t email the signers of a form library template: leavesend_emailout, and send them their links yourself.signing_order(string, optional):parallel(the default) lets everyone sign at once. Withsequential, people sign one step at a time (each signature request’ssigning_step), and DocSpring emails each step once everyone in the step before it has signed.email_subject(string, optional): The subject of the emails that ask people to sign, up to 200 characters. See Subject and message.email_message(string, optional): A message for the people who sign, shown above the signing button, up to 2,000 characters.cc(array of email addresses, optional): Up to 10 people who get the signed PDF. They don’t sign.reply_to(string, optional): Where replies to the emails go: a member of your DocSpring team, or an address at one of your verified email domains. Default: the template’s Reply-to address setting, or your account owner.notification_emails(array of email addresses, optional): Up to 10 addresses that DocSpring tells when the document is completed or declined, or when an email to a signer bounces or can’t be sent. Each one is a team member’s address or at one of your verified email domains. Default: the template’s Notification emails setting, or your account owner.notify_when_signed(boolean, optional): Also emailnotification_emailseach time someone signs.reminders(object, optional): Remind the people who haven’t signed. Without it, DocSpring sends no reminders.interval_days(integer, required): Days between reminders, from 1 to 30.max_count(integer, required): The most reminders each person gets, from 1 to 10.
signature_requests(array of objects, optional): Up to 100 signature requests. Each object in the array can have the following properties:role(string, optional): Which of the template’s signers this person is:Signer 1,Signer 2and so on. Without roles, the first signature request isSigner 1, the secondSigner 2, and so on.- To leave a signer out, give every signature request its
roleand leave that signer’s out. Either every signature request has aroleor none does. Signer 1’s details go in the template’s@@signature_requests/0fields,Signer 2’s in@@signature_requests/1, and so on. A signer you leave out has no signature request, so its fields stay empty.
- To leave a signer out, give every signature request its
email(string, optional): The user’s email address. Required when DocSpring emails them. Otherwise we recommend including it, because it is shown in the audit trail.name(string, optional): The user’s name.fields(array of field names, required): The field names that this person must fill in.- Each field can only be in one signature request.
- For a list, name the field with
~for its items (items/~/code) to ask for every item, or name one item (items/0/code) to ask for only that one. - A field that
dataalready has a value for is a 422, unless you setprefilled_values_editableto let the person change the value. - A name that the template doesn’t have saves the submission as
invalid_data, and the request returns a 422 with itssubmission_id. Setignore_unknown_fieldsto leave those names out instead, which lets you send one field list with several templates.
metadata(object, optional): Any additional data that you want to associate with this signature request.send_email(boolean, optional): Whether DocSpring emails this person. Default: the submission’ssend_email. Set it tofalsefor someone who signs in your app, or whose link you send yourself.signing_step(integer, optional): Withsigning_order: sequential, when this person signs: everyone in step 1 first, then step 2, and so on. People in the same step sign in any order. Either every signature request has asigning_stepor none does. Without them, each person is a step of their own, in the order ofsignature_requests.auth_type(string, required unless DocSpring emails this person): One of:password,oauth,email_link,phone_number,ldap,saml- When DocSpring emails the person, it’s
email_link(the default). - Use
email_linkif you are sending an authenticated link in an email.
- When DocSpring emails the person, it’s
auth_session_started_at(string, optional): The timestamp when the user was authenticated.- We will set
auth_session_started_atautomatically whenauth_typeisemail_link.
- We will set
auth_second_factor_type(string, optional): One of:none,phone_number,totp,mobile_push,security_key,fingerprint.auth_provider(string, optional): Ifauth_typeisoauth, then please tell us the service (e.g. google, facebook, twitter)auth_session_id_hash(string, optional): SHA256 hash of (salt + session ID) (if your application uses a session ID)auth_user_id_hash(string, optional): User ID, or SHA256 hash of (salt + User ID)auth_username_hash(string, optional): Username, or SHA256 hash of (salt + username)auth_phone_number_hash(string, optional): Phone number, or SHA256 hash of (salt + phone number) (if the user used their phone for authentication)prefilled_values_editable(boolean, optional): Let the person change the values thatdataalready has for their fields.ignore_unknown_fields(boolean, optional): Leave out names infieldsthat the template doesn’t have.
You can also send the other parameters of a standard PDF generation request, such as the version query parameter, expires_in and password. See Generate PDFs via API.
A request sent from the template’s draft keeps the template as it was when you sent it, so editing the draft afterwards doesn’t change what the signers see or their signed PDF. See Signature requests sent from the draft.
Only the signers can sign, and a signed PDF is always static:
- A value for a signature or initials field, in
dataor in a field override’sdefault, saves the submission asinvalid_data, and the request returns a 422 with itssubmission_id. This applies to every submission, with or without signature requests, in test mode too. Image fields can still take values: to print a signature image or a name you send, use an Image or Text field. editable: true, on a submission with signature requests or in itsfield_overrides, is a 422.
Emails from DocSpring
Section titled “Emails from DocSpring”Unless you set send_email to false, DocSpring sends these emails for the submission:
| Who gets it | When | |
|---|---|---|
| Signing link | Each person DocSpring emails, or only the first step’s | When you create the submission |
| Your turn | The people in the next step, with signing_order: sequential | Once everyone in the step before has signed |
| Reminder | Each person who hasn’t signed yet | Every reminders.interval_days days, up to reminders.max_count times |
| Signed PDF | Everyone DocSpring emailed a signing link, and the cc addresses | Once the PDF has been generated |
| Completed | notification_emails | Once the PDF has been generated |
| Signed | notification_emails, with notify_when_signed | Each time someone signs |
| Declined | notification_emails, and the people who had already signed | When someone declines |
| Email problem | notification_emails | When the email with someone’s signing link bounces or is marked as spam, or DocSpring couldn’t send their first one |
People with send_email: false, and the signers of a form library template, get none of these emails: send them
their link and the signed PDF yourself. When they sign in order, send their link once you have the
signature_request.completed webhooks of everyone in the steps before theirs.
Each email with a signing link has a new link that works for 7 days, and the audit trail records it. Reminders stop once the person signs, or when an email to them bounces, is marked as spam or is reported.
Who the emails come from
Section titled “Who the emails come from”The emails come from DocSpring’s shared address, with “via DocSpring” after the sender’s name: “Acme via DocSpring”.
The sender’s name is the template’s Sender name setting, or your account’s name. Replies go to reply_to.
On the Growth and Scale plans, a template can send its emails from an address at one of your verified email domains
(its From address setting), and the button in the email can open a signing page on your own site (its Signing
URL setting). While a template’s From address or Signing URL can’t be used (its domain is no longer verified, or
your plan no longer includes it), new submissions that DocSpring emails are refused: change the template’s setting, or
set send_email to false. If the From address stops working after a submission was created, its emails go from the
shared address and your account owner gets an email about it. If the Signing URL stops working, the emails with a link
aren’t sent, and your notification_emails get an email about it. See
Signature request emails.
The emails show your account’s logo and brand color, which you set on the Account page, when your account is on a paid plan or has bought a credit pack.
Subject and message
Section titled “Subject and message”email_subject and email_message can use these variables:
{{ signer.name }}and{{ signer.email }}: the person the email is for{{ document.name }}: the template’s name{{ sender.name }}: the sender’s name{{ account.name }}: your account’s name
The default subject is “Sender sent you document to sign”. Anything else in {{ }} or {% %} is a 422. Links and
web addresses in the subject and message are shown as plain text (example[.]com), so the signing button is the only
link people can click.
The signed PDF
Section titled “The signed PDF”The signed PDF email attaches the PDF, and the audit trail when it isn’t merged into the PDF. When they’re over 7 MB, or the template’s Signed PDF setting asks for links, the email has a download link instead. Download links work for 7 days, then the page offers to email a new one to the same address. Accounts that have signed a BAA get links by default.
When one of your email actions sends the submission’s PDF to a signer, a cc
address or a notification address, that address gets the email action’s email instead of DocSpring’s, so nobody gets
the signed PDF twice. To send every signer the PDF in your own email, add an email action with Each signer in
To (Signature requests).
Test submissions
Section titled “Test submissions”A test submission (test: true) only emails your DocSpring team: every address it would email must be a team member’s.
Other addresses are a 422. Use a team member’s address, or set send_email to false. The subjects start with
“[Test]”.
Limits
Section titled “Limits”- Before DocSpring emails the signers of a live submission, your credit balance must cover its PDF and signatures. On
the Developer plan and during a trial, it must also cover your other requests that are still waiting for signers.
Otherwise the request returns
402 Payment Requiredwith theinsufficient_credits_to_sendcode, and nothing is saved. - Each account can send 2,000 emails about signature requests a day, or 50 on the Developer plan and during a trial.
A request that would go over returns
429 Too Many Requestswith thedaily_email_limit_reachedcode and aRetry-Afterheader with the seconds until midnight UTC, and nothing is saved. Contact us for a higher limit. - When people mark 3 of your emails as spam, or report them with the link at the bottom, within 30 days, your
account’s emails pause. Requests that ask DocSpring to email someone then return
403 Forbidden, and your account owner gets an email about it.
Enterprise
Section titled “Enterprise”On DocSpring Enterprise, the emails go through your server’s email settings, from its DOCSPRING_FROM_EMAIL address
or any template From address, with no daily limit. Your email service doesn’t report bounces to DocSpring, so there are
no email problem emails or email_bounced events.
Example
Section titled “Example”{ "test": false, "signing_order": "sequential", "email_message": "Please sign by Friday.", "reminders": { "interval_days": 3, "max_count": 2 }, "signature_requests": [ { "name": "John Smith", "fields": ["tenant_signature"], "signing_step": 1 }, { "name": "Jane Smith", "fields": ["landlord_signature"], "signing_step": 2 } ]}DocSpring emails John straight away, and Jane once John has signed. Each of them gets a reminder after 3 days and
another after 6 if they haven’t signed, and both of them and [email protected] get the signed PDF.
Authentication Details
Section titled “Authentication Details”It’s important to provide accurate authentication details in case an electronic signature is disputed. You can send us SHA256 hashes if you don’t want to disclose too much information about your user accounts. (However, you must never send a plaintext session ID, because this is very sensitive information.)
If your user ID column is an incrementing integer, then it is important to use a salt to hide this information. We recommend configuring a single salt that you use for all of your SHA256 hashes. Alternatively, you can use a different salt for each user, and store this in your database. But please make sure you never lose this salt, otherwise there is no way to prove that the SHA256 hashes match the records in your database.
Example Response
Section titled “Example Response”The response is the submission. Some of its properties are left out here:
{ "id": "sub_1234567890abcdef01", "template_id": "tpl_1234567890abcdef01", "state": "waiting_for_signature_requests", "test": false, "metadata": { "user_id": 42 }, "signature_requests": [ { "id": "srq_1234567890abcdef01", "submission_id": "sub_1234567890abcdef01", "name": "John Smith", "fields": ["name", "signature"], "sort_order": 0, "send_email": true, "signing_step": null, "sent_at": null, "email_status": null, "state": "pending", "viewed_at": null, "completed_at": null, "declined_at": null, "auth_type": "email_link" } ], "files": {}, "expired": false, "expires_at": null, "processed_at": null, "created_at": "2018-10-20T09:00:00Z"}files.pdf appears when every signature request is completed and the PDF has been generated. files.preview can appear earlier, so check state to know when the submission is signed.
sent_at is when DocSpring first emailed the person their signing link, and email_status is what happened to the latest
email with their link: sent, then delayed, delivered, undelivered, bounced or complained (marked as spam).
email_status is failed when DocSpring couldn’t send the first email with their link, and unknown when it couldn’t
tell whether that email went. Neither is sent again: send them a new signature request. Both fields are null until
DocSpring has emailed them, just after the submission is created or, with signing_order: sequential, when their turn
comes. The signature_request.sent
webhook event fires when DocSpring first emails them, and signature_request.email_bounced
when an email with their link bounces or is marked as spam.