Skip to main content

Public Template

POST 

/publictemplate

The Public Template API allows users to create templates that serve as blueprints for generating documents with predefined structures. When a template is successfully created, the API returns a unique template_id and a public_url. The public_url is publicly accessible and may be shared with any user, enabling them to generate and sign documents based on the template. However, the template itself cannot be modified through this URL; it can only be used for document creation and signing.

Tip: Upload your PDF document to our Debug UI, where you can easily add widgets, then copy coordinates, page numbers, and more in a ready-to-use JSON format. Plus, you can directly copy the document's base64 string, making it quick to send to the API.

Supported Widgets:

Below are the common parameters that are required with all widgets:

  • name: Unique identifier for this widget.
  • 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.
  • color: Specifies the color of the widget content. Available options include black, blue, red, and yellow, with black as the default selection if no color is specified. This parameter is optional and is applicable to the following widgets: email, name, job title, company, date, textbox, checkbox, radio button, and dropdown.
  • fontsize: Specifies the fontsize of the widget content. Available options include 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, and 28, with a default fontsize of 12 if not specified. This parameter is optional and is applicable to the following widgets: email, name, job title, company, date, textbox, checkbox, radio button, and dropdown.
  • 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.

List of all supported widgets:

  1. signature
{
"type": "signature",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"hint": "Provide signature"
}
}
  1. stamp
{
"type": "stamp",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "stamp",
"hint": "Provide stamp"
}
}
  1. initials
{
"type": "initials",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "initials",
"hint": "Provide initials"
}
}
  1. email
{
"type": "email",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "email",
"color": "black",
"fontsize": 12,
"hint": "Provide email",
"hide_text_with_asterisks": false
}
}
  1. name
{
"type": "name",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "name",
"color": "black",
"fontsize": 12,
"hint": "Provide name",
"hide_text_with_asterisks": false
}
}
  1. job Title
{
"type": "job title",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "job title",
"color": "black",
"fontsize": 12,
"hint": "Provide job title",
"hide_text_with_asterisks": false
}
}
  1. company
{
"type": "company",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "company",
"color": "black",
"fontsize": 12,
"hint": "Provide company",
"hide_text_with_asterisks": false
}
}
  1. 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",
"color": "black",
"fontsize": 12,
"min_date": "",
"max_date": "",
"readonly": false,
"signing_date": false,
"hint": "Provide date"
}
}
  • 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.
    • "mm/dd/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",
    • "dd/mm/yyyy",
    • "dd.mm.yyyy".
  • 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
{
"type": "textbox",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"name": "textbox",
"required": true,
"readonly": false,
"default": "name",
"hint": "provide name",
"regularexpression": "",
"color": "black",
"fontsize": 12,
"hide_text_with_asterisks": false
}
}
  • default: Provide a default value for the textbox (Optional).
  • regularexpression: A custom regex pattern for validation - for example, /^\d+$/ to permit only digits, /^[A-Z]+$/ to permit only uppercase letters, etc. help (Optional).
  • readonly: Set to true if you want to set the textbox as readonly. By default, it's false.
  1. 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,
"color": "black",
"fontsize": 12,
"layout": "vertical",
"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.
  1. dropdown
{
"type": "dropdown",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "dropdown",
"readonly": false,
"values": ["male", "female", "other"],
"default": "",
"color": "black",
"fontsize": 12
}
}
  • values: Provide options for the dropdown list.
  • default: Provide the value that needs to be selected by default. Only one value is accepted. (Optional).
  • readonly: Set to true if you want to set the dropdown as readonly. By default, it's false.
  1. radio button
{
"type": "radio button",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "radio button",
"readonly": false,
"values": ["male", "female", "other"],
"default": "male",
"color": "black",
"fontsize": 12,
"layout": "vertical"
}
}
  • 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).
  • readonly: Set to true if you want to set the radio button as readonly. By default, it's false.
  1. image
{
"type": "image",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "image"
}
}
  1. number
{
"type": "number",
"page": 1,
"x": 107,
"y": 528,
"w": 60,
"h": 21,
"options": {
"name": "number",
"required": true,
"readonly": false,
"default": 0,
"hint": "Provide number",
"formula": "",
"decimalplaces": 2,
"color": "black",
"fontsize": 12,
"hide_text_with_asterisks": false
}
}
  • formula: Compute the value from other number widgets using +, -, *, /, (, ). Reference widgets by their name in double curly braces, e.g. {{quantity}} * {{rate}}. to know more visit here (optional).
  • default: Provide a default number (Optional).
  • readonly: Set to true if you want to set the textbox as readonly. By default, it's false.
  • decimalplaces: Number of digits to display after the decimal point. e.g: 2 => 12.00, 0 => 12 (default 2)
  1. cells
{
"type": "cells",
"page": 1,
"x": 100,
"y": 100,
"w": 114,
"h": 50,
"options": {
"name": "cells",
"required": true,
"readonly": false,
"cell_count": 5,
"default": "",
"hint": "",
"regularexpression": "",
"color": "black",
"fontsize": 12,
"hide_text_with_asterisks": false
}
}
  • cell_count: Specify the number of cells that should be returned to the user.
  1. attachments
{
"type": "attachments",
"page": 1,
"x": 327,
"y": 628,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "attachment widget",
"hint": "Provide files"
}
}

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
{
"type": "textbox",
"page": 1,
"x": 290,
"y": 165,
"w": 150,
"h": 20,
"options": {
"required": true,
"name": "textbox",
"response": "joe",
"color": "red",
"fontsize": 12
}
}
  • response: Enter the text you would like to display inside the textbox.
  • color: Choose the text color (options: black, blue, or red).
  1. date
{
"type": "date",
"page": 1,
"x": 173,
"y": 588,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "date",
"response": "04/15/2024",
"format": "mm/dd/yyyy",
"color": "black",
"fontsize": 12
}
}
  • response: Enter the date you would like to display inside the date box.
  • format: Specify the date format of your choice from the options below.
    • "mm/dd/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",
    • "dd/mm/yyyy",
    • "dd.mm.yyyy".
  • color: Choose the text color (options: black, blue, or red).
  1. checkbox
{
"type": "checkbox",
"page": 1,
"x": 172,
"y": 630,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "checkbox",
"values": ["male", "female", "other"],
"response": ["male", "female"],
"hidelabel": false,
"color": "black",
"fontsize": 12
}
}
  • values: Provide options for the checkbox list.
  • response: Provide values that need to be selected.
  • hidelabel: Set to true if you want to hide labels of the checkbox. By default, it's false.
  • color: Choose the text color (options: black, blue, or red).
  1. radio button
{
"type": "radio button",
"page": 1,
"x": 173,
"y": 718,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "radio button",
"values": ["male", "female", "other"],
"response": "male",
"hidelabel": false,
"color": "black",
"fontsize": 12
}
}
  • values: Provide options for the radio button list.
  • response: Provide the value that needs to be selected. Only one value is accepted.
  • hidelabel: Set to true if you want to hide labels of the radio button. By default, it's false.
  • color: Choose the text color (options: black, blue, or red).
  1. image
{
"type": "image",
"page": 1,
"x": 100,
"y": 95,
"w": 92,
"h": 55,
"options": {
"required": true,
"name": "image",
"response":"iVBORw0KGgoAAAANSUhEUgAAAmoAAA..."
}
}
  • response: Provide image in base64 format like iVBORw0KGgoAAAANSUhEUgA... or data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA....
  1. dropdown
{
"type": "dropdown",
"page": 1,
"x": 327,
"y": 528,
"w": 114,
"h": 21,
"options": {
"required": true,
"name": "dropdown",
"values": ["male", "female", "other"],
"response": "female",
"color": "black",
"fontsize": 12
}
}
  • values: Provide options for the dropdown list.
  • response: Provide the value that needs to be selected. Only one value is accepted.
  • color: Choose the text color (options: black, blue, or red).

Request

Responses

Template created successfully!