Creating a sign request

The endpoint allows you to create a sign request by sending a PDF document through to the Yoti Sign service.

Creating a sign request endpoint

Below is the end point used for creating a sign request.

HTTP
Copy

This service will send an email to the signee prompting them through the Yoti Sign flow. There is a configurable option to customise the signing request message that gets sent.

Document received to sign

Document received to sign

Example email object

In order to create a sign request the API will require an invitation object and message. This message will be sent within the email sent to your signees.

JSON
Copy

The following elements are configurable:

ParameterDescription
Authorization (header)API Key to call the Yoti Sign API. This should be sent as a bearer token.
Content-Type (header)multipart/form-data.
file (formData)The PDF document that requires signing.
file_name (formData)The name of the document to be signed.
email (formData)The email parameter lets you specify a message to be sent to a signee. See example above.
recipients (formData)Recipients contains an array of signees, this is used to specify exactly where each signee must e-sign on a given document. See example below.
custom_webhook_uri (formData)Specifies an endpoint to receive updates when documents are signed. Webhooks retry 10 times, with a delay of 30 seconds between each try. Endpoint must be HTTPS with TLS only and not HTTP.

Example recipients array

Here is where you will need provide an array of JSON objects to define the intended signees of the document. This array can hold up to 10 signees.

JSON
Copy
Parameter (Recipients)Description
nameThis should be a string with a maximum length of 100 characters. The name specifies the name of the target signee.
emailThis should be a string with a maximum length of 100 characters. The email specifies the email address of the target signee.
roleString value of role of the signee, this is free text and can be used to identify the role of the signee, the maximum length is 50 characters.
auth_type

auth_type can be one of either "sign-auth" or "no-auth". If "sign-auth" is selected a Yoti scan be be required.

The email_address attribute is added by default to the list of Yoti attributes even if no attributes are provided.

yoti_attributes

Possible Yoti attributes are:

[ postal_address, selfie, full_name, date_of_birth, gender, nationality, phone_number ]

sign_groupString value between 1 and 10. This defines an order in which recipients receive invitations to sign a document. For example, all recipients within sign group 1 will be the first to receive a document to sign. Once all recipients from sign group 1 have signed, the document will be sent to sign group 2. If no sign group is specified, a default of 1 will be assumed.
tagsA tag is an array of objects used to place signature fields on a given PDF. To populate a tag, you will need to specify a page number, x and y co-ordinate, and a tag type. You may specify up to 10 tags per signee.
Knowledge base
For more information on the the Yoti attributes head over to our Knowledge base.

Within the tag array you can specify the following:

Parameter (tags)Description
page_numberThis marks the page number of the page to place a tag.
xThe 'X' co ordinate of the tag field, this is a decimal number starting from the top left of the page. Minimum value can be 0 and maximum of 0.949.
yThe 'Y' co-ordinate of the tag field, this is a decimal number starting from the top left of the page. Minimum value can be 0 and maximum of 0.95.
widthIf text_field is selected as type, a width must be provided. This is not required for signature. The width sets the width of the text field and can be a minimum of 0.05. The maximum width of the text field should be less than 1.0 when added to the x co-ordinate value.
typeThis should be set to either "text_field" or "signature". Setting the type to "text___field" allows a signee to enter free text, a width value must be specified alongside "text_field" to define the size of the field. "signature" is used to indicate a click to sign box.
optionalA tag can be marked as "optional" by adding the "optional" parameter. If a tag is marked as "optional" a recipient will be allowed to sign the document without submitting the tag. If an "optional" tag is not submitted by a signer, the tag will not show up on the completed document. The default value is "false". yoti_attributes may not be marked as "optional".

Reminders Object

You can configure reminders to be sent to recipients who still have active documents that need signing. There will be 3 reminders (this is not currently configurable) that will be sent out with a frequency of 1, 2 or 7 days.

JSON
Copy

Complete Example

Below is a complete example of how to construct a request to the Create Sign Request endpoint.

Javascript
Copy

On success Yoti returns a 200 and a JSON object in the following format:

JSON
Copy
Good to know...
The sign_request_id returned is the unique identifier for this specific created request. You should store this as it can be used to Archive Requests, Retrieve the Status, or Get the Completed Document.

Webhook

It is possible to specify a WebHook URL to be informed of updates to Yoti Sign documents as they happen.

The Yoti Sign system will send a POST request to the specified endpoint as described in the above table. An example of the response from the WebHook is listed below.

Good to know...
Please note that Webhooks retry 10 times, with a delay of 30 seconds between each try. Only HTTPS endpoints with TLS are supported. The HTTPS endpoint can be self signed when using the sandbox demo API, however endpoints in production require fully verified HTTPS.

'Success' Webhook

JSON
Copy

'Errors' Webhook

The Yoti Sign API will send a webhook notification if there is a problem during the creation of the sign request. The payload for this type of notification looks like this:

JSON
Copy

If a webhook notification has been received, you may use it to query for a human readable message by getting the status of the envelope. Below are the error codes and their descriptions.

Errors codes

CodeDescriptionHow to fix
PASSWORD_PROTECTEDThe PDF is password protectedRemove the password protection and try again
MALICIOUS_PDFThe PDF contains executable javascriptRemove the javascript and try again
PDF_READERThe PDF file cannot be read. It may be corruptedPlease try to recreate your PDF and try again
WORD_DOC_CONV_ERRORThe Word document is corrupt, or has been password protectedRepair the corrupt document, or remove the password protection from the Word Doc and try again
NO_PAGE_FOR_TAG_ERRORYou have specified a tag that has been assigned to a page that does not existPlease check that the PDF has the page that you specified for the tags

Other response codes

ResponseDescription
401401 is returned if a request is unauthorised. This is likely due to the API Key either being incorrect or not being sent properly in the headers. The key should be sent as a Bearer token over the authorisation header.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard