Skip to main content

Create Document from Template

POST 

/createdocument/:template_id

The Create Document from template API allows you to generate new documents by just providing template_id instead of uploading a new file(in the form of base64 or binary) every time you need to create a document. Templates for repeatedly used files can be created from user interface at Debug UI or using the Create Template API.

You can provide default value for all widgets based on their name all widgets support except signature, stamp, initials, image.

  1. email
{
"name": "email",
"readonly": false,
"default": "email@example.com"
}
  1. name
{
"name": "name",
"readonly": false,
"default": "joe"
}
  1. job Title
{
"name": "job title",
"readonly": false,
"default": "ceo"
}
  1. company
{
"name": "company",
"readonly": false,
"default": "example pvt ltd"
}
  1. date
{
"name": "date",
"readonly": false,
"default": "11-05-2025"
}
  1. textbox
{
"name": "textbox",
"readonly": false,
"default": "my text"
}
  1. checkbox
{
"name": "checkbox",
"readonly": false,
"default": ["option-2"]
}
  • default: You can have one or more than one value that needs to be selected by default.
  1. dropdown
{
"name": "dropdown",
"readonly": false,
"default": "option1"
}
  1. radio button
{
"name": "radio",
"readonly": false,
"default": "option1"
}
  1. number
{
"name": "number",
"readonly": false,
"default": 0,
"formula": "",
"decimalplaces": 2,
}

Prefill Widgets: Prefill widgets are elements that are inserted into a document before it is shared with a user. Only the document creator has permission to add them.

response: Provide the value that should replace the existing response.

List of widgets supported in Prefill

  1. textbox
{
"name":"textbox",
"response":"andrew bee"
}
  1. date
{
"name": "date",
"response": "04/15/2024"
}
  1. checkbox
{
"name": "checkbox",
"response": ["male", "female"]
}
  • response: Must be chosen from the existing values of checkbox defined in the template.
  1. radio button
{
"name": "radio button",
"response": "male"
}
  • response: Must be chosen from the existing values of radio button defined in the template.
  1. image
{
"name": "image",
"response":"iVBORw0KGgoAAAANSUhEUgAAAmoAAA..."
}

  1. dropdown
{
"name": "dropdown",
"response": "female"
}
  • response: Must be chosen from the existing values of dropdown defined in the template.

Request

Responses

Document created successfully!