post
https://{host}/api/v2/templates
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
| Name | Type | Required | Description |
|---|---|---|---|
| user_type | string | Yes | Must be set to ENTERPRISE_API. |
Request Body
-
Type: multipart/form-data
-
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
| file | file | Yes | The file to be used for the template (e.g., PDF, Excel). |
| name | text | Yes | The name of the template. |
| mapping | text | No | JSON string describing the mapping of fields (e.g., signature locations, sizes, page number). |
| organization_id | text | No | Organization identifier. |
| manual_mapping | text | No | Indicates if manual mapping is used (e.g., 0 or 1). |
| number_of_signatories | text | No | Number 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 Code | Description |
|---|---|
| 200 | Success. Returns the created template data. |
| 400 | Bad Request. Invalid or missing parameters. |
| 401 | Unauthorized. Missing or invalid token. |
| 403 | Forbidden. Insufficient permissions. |
| 500 | Internal Server Error. |
Notes
-
The
fileandnamefields are required. -
The
mappingfield should be a valid JSON string if provided. -
The
user_typequery parameter must be set toENTERPRISE_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
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
