Create Document
POST/createdocument
The Create Document API allows users to generate new documents by providing data with base64 encoded file.
Upload you pdf in our Debug UI here you can draw widgets and copy co-oridnate, page number of them. also you can copy base64 of PDF
Below widgets are supported in the document:
Common parameters of widgets:
- type: Indicates the type of widget.
- page: Specifies the page number on which you want to place the respective widget.
- x, y: Denotes the horizontal and vertical coordinates of the starting point of the widget. You can use the debug UI to determine these values.
- w, h: Represents the width and height of the widget. You can adjust these values using the debug UI.
- required: Set to false if you want to make the widget optional. By default, it's true. Not applicable for signature-type widgets.
- name: Provides a different name for widgets if you are providing more than one widget.
- signature:
{
"type":"signature",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21
}
- Note: At least one signature is required for each signer. All signature fields are compulsory by default.
- stamp:
{
"type":"stamp",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "stamp"
}
}
- initials:
{
"type":"initials",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "initials"
}
}
- email:
{
"type":"email",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "email"
}
}
- name:
{
"type":"name",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "name"
}
}
- job title:
{
"type":"job title",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "job title"
}
}
- company:
{
"type":"company",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "company"
}
}
- date:
{
"type":"date",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "date",
"default": "04-15-2024",
"format": "mm-dd-yyyy"
}
}
- default: Provide the date from which you want to start the date of the date widget. Must be provided in the specified format. By default, today's date provided.
- format: Specify the date format of your choice from the options below.
- "dd/MM/yyyy",
- "dd-mm-yyyy",
- "yyyy-mm-dd",
- "mm.dd.yyyy",
- "mm-dd-yyyy",
- "mmm dd, yyyy",
- "mmmm dd, yyyy",
- "dd mmm, yyyy",
- "dd mmmm, yyy"
- textbox:
{
"type":"textbox",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "textbox",
"default": "name",
"hint": "provide name",
"regularexpression":""
}
}
- default: Provide a default value for the textbox (Optional).
- hint: Provide a hint for the textbox (Optional).
- regularexpression: Provide regex for custom validation, such as allowing only numbers, only capital letters, etc. (Optional).
- checkbox:
{
"type":"checkbox",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "checkbox",
"values": ["male", "female", "other"],
"selectedvalues": [ "male", "female" ],
"readonly": false,
"hidelabel": false,
"validation": {
"minselections": 0,
"maxselections": 0
}
}
}
- values: Provide options for the checkbox list.
- selectedvalues: Provide values that need to be selected by default (Optional).
- readonly: Set to true if you want to set the checkbox as readonly. By default, it's false
- hidelabel: Set to true if you want to hide labels of the checkbox. By default, it's false.
- minselections: Provide the minimum number of checkboxes that must be selected by the user.
- maxselections: Provide the maximum number of checkboxes that can be selected by the user.
- dropdown:
{
"type":"dropdown",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "dropdown",
"values": ["male", "female", "other"],
"default": "male"
}
}
}
- values: Provide options for the dropdown list.
- default: Provide the value that needs to be selected by default. Only one value is accepted. (Optional).
- radio button:
{
"type":"radio button",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "radio button",
"values": ["male", "female", "other"],
"default": "male"
}
}
}
- values: Provide options for the radio button list.
- default: Provide the value that needs to be selected by default. Only one value is accepted. (Optional).
- image:
{
"type":"image",
"page":1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "image"
}
}
}
Request
- application/json
Body
required
Array [
Array [
]
]
time to complete days is used to calculate expiry date of your document
signers
object[]
required
widgets
object[]
Allowed values - signature, stamp.
The page number on which the widget should appear. use our Debug UI to calculate the value.
x co-ordinate (left upper corner) from which widget should appear. use our Debug UI to calculate the value.
y co-ordinate (left upper corner) from which widget should appear. use our Debug UI to calculate the value.
Width of widget. use our Debug UI to calculate the value.
Height of widget. use our Debug UI to calculate the value.
This parameter allows you to specify whether you want emails to be sent to signers. The default value is "true". If the value of this parameter is "true" and no 'email_subject'/'email_body' parameters are specified default email templates will be used.
Custom mail subject for signature request. Can include the following {{document_title}} {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}.
Custom signature request email body. Can include the following {{document_title}} {{sender_name}}, {{sender_mail}}, {{sender_phone}}, {{receiver_name}}, {{receiver_email}}, {{receiver_phone}}, {{expiry_date}}, {{company_name}}, {{signing_url}}.
Responses
- 200
- 400
- 405
Document created successfully!
- application/json
- Schema
- Example (from schema)
Schema
{
"objectId": "hji2zxcv2P",
"url": "https://url-to-sign-document.com"
}
Something went wrong, please try again later!
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "Something went wrong, please try again later!"
}
Invalid API Token!
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "Invalid API token!"
}