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.

hide_text_with_asterisks: When enabled, the text on the signed document is hidden from recipients using asterisks, but remains fully visible to the document owner in their OpenSign account. This option is available only on Teams and Enterprise plans.

hint: Specify the hint for widgets. This parameter is optional and is not applicable to the following widgets: checkbox, radio button, dropdown.

  1. email
{
"name": "email",
"readonly": false,
"default": "email@example.com",
"hint": "Provide email",
"hide_text_with_asterisks": false
}
  1. name
{
"name": "name",
"readonly": false,
"default": "joe",
"hint": "Provide name",
"hide_text_with_asterisks": false
}
  1. job Title
{
"name": "job title",
"readonly": false,
"default": "ceo",
"hint": "Provide job title",
"hide_text_with_asterisks": false
}
  1. company
{
"name": "company",
"readonly": false,
"default": "example pvt ltd",
"hint": "Provide company",
"hide_text_with_asterisks": false
}
  1. date
{
"name": "date",
"readonly": false,
"default": "11-05-2025",
"min_date": "",
"max_date": "",
"signing_date": false,
"hint": "Provide date"
}
  • min_date: Provide the minimum restriction date. The date must be in YYYY-MM-DD format.
  • max_date: Provide the maximum restriction date. The date must be in YYYY-MM-DD format.
  • signing_date: If signing_date is set to true, the signing date is shown to the signer during signing. You may set either signing_date or default, but not both. Using both is not supported.
  1. textbox
{
"name": "textbox",
"readonly": false,
"default": "my text",
"hint": "Provide text",
"hide_text_with_asterisks": false
}
  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,
"hint": "Provide number",
"hide_text_with_asterisks": false
}
  1. cells
{
"name": "cells",
"readonly": false,
"cell_count": 5,
"default": "",
"hint": "",
"hide_text_with_asterisks": false
}
  • cell_count: Specify the number of cells that should be returned to the user.

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

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.

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!