Create Template From File

Create Template for Enterprise API

This endpoint allows you to create a new template by uploading a file and specifying template details. The template can include custom field mappings, such as the location and size of signature fields on the document.

Endpoint

plaintextPOST {{host}}/api/v2/templates?    user_type=ENTERPRISE_API

Authentication

  • Type: Bearer Token

  • Header: Authorization: Bearer {USER-TOKEN}

  • A valid bearer token is required to access this endpoint.

Query Parameters

NameTypeRequiredDescription
user_typestringYesMust be set to ENTERPRISE_API.

Request Body

  • Type: multipart/form-data

  • Fields:

NameTypeRequiredDescription
filefileYesThe file to be used for the template (e.g., PDF, Excel).
nametextYesThe name of the template.
mappingtextNoJSON string describing the mapping of fields (e.g., signature locations, sizes, page number).
organization_idtextNoOrganization identifier.
manual_mappingtextNoIndicates if manual mapping is used (e.g., 0 or 1).
number_of_signatoriestextNoNumber of signatories required for the template.

Example mapping value:

json[    {        "signatures": [            {                "x": 35,                "y": 703,                "width": 95,                "height": 65,                "pageNo": 1,                "isRequired": 1            }        ]    }]

Example Request

httpPOST {{host}}/api/v2/templates?    user_type=ENTERPRISE_APIAuthorization: Bearer {USER-TOKEN}Content-Type: multipart/form-datafile: <file upload>name: Copy of Manual PR FORMmapping: [{"signatures":[{"x":35,"y":703,    "width":95,"height":65,"pageNo":1,    "isRequired":1}]}]organization_id: 0manual_mapping: 0number_of_signatories: 0

Example Successful Response

json{    "message": "Template created         successfully",    "data": {        "client_id": 123,        "name": "Copy of Manual PR FORM",        "path": "/templates/            Copy_of_Manual_PR_FORM.xlsx",        "created_at":             "2024-06-10T12:34:56Z",        "updated_at":             "2024-06-10T12:34:56Z",        "id": 141    }}

Error Responses

Status CodeDescription
200Success. Returns the created template data.
400Bad Request. Invalid or missing parameters.
401Unauthorized. Missing or invalid token.
403Forbidden. Insufficient permissions.
500Internal Server Error.

Notes

  • The file and name fields are required.

  • The mapping field should be a valid JSON string if provided.

  • The user_type query parameter must be set to ENTERPRISE_API.

  • This endpoint is intended for enterprise API users who need to create and configure document template.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string
Body Params
file
string
string

Sample format: [{"signatures":[{"x":35,"y":703,"width":95,"height":65,"pageNo":1,"isRequired":1},{"x":137,"y":703,"width":95,"height":65,"pageNo":1,"isRequired":1},{"x":404,"y":703,"width":95,"height":65,"pageNo":1,"isRequired":1},{"x":538,"y":703,"width":95,"height":65,"pageNo":1,"isRequired":1}]}]

integer

number: optional

integer
integer
Response

Language
Credentials
Bearer
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!