Templates
Save template
POST
Save a reusable template blueprint for a file. A template stores the
source file_id and an ordered signers array, where each signer
contains its own PDF elements and optional signer-level defaults.
signersis ordered: the first template signer maps to the first runtime signer supplied later ininitialize-from-template, and so on.- Every signer must contain at least one
signatureelement. - A
field_idis generated automatically for each saved element and returned in template reads; those values are whatinitialize-from-template.signers[].element_valuesuses later. file_idmust belong to the authenticated user.
bearerAuthheader
AuthorizationBearer <token>Bearer token authentication. Paste your access token below.
application/json- body
name*stringTemplate name.
file_id*stringMust belong to the authenticated user.
folder?stringFolder name to organize the template under.
signers*array<>The first template signer maps to the first runtime signer in
initialize-from-template, the second to the second, and so on.
Items
1 <= itemsTemplate saved.
application/json- response
Standard response envelope.
status_code?integerHTTP status code echoed in the response body.
message?stringHuman-readable result message.
success?booleantrue when the request succeeded.
data?curl -X POST 'https://prod-esign-api-v2.surepass.app/api/v1/templates/save' \
-H 'Content-Type: application/json' \
-d '{
"name": "Employment Offer Template",
"file_id": "file_onwEUoMxnWhewUzodZeW",
"folder": "HR",
"signers": [
{
"sign_type": "suresign",
"auth_mode": 1,
"max_retry": 1,
"reason": "Employer sign",
"verify_email": false,
"verify_mobile": false,
"elements": [
{
"x": 100,
"y": 120,
"page": 0,
"alignment": "center",
"type": "signature",
"label": "Employer signature"
},
{
"x": 100,
"y": 170,
"page": 0,
"alignment": "center",
"type": "text",
"label": "Job title"
}
]
},
{
"sign_type": "suresign",
"auth_mode": 1,
"reason": "Employee sign",
"verify_email": true,
"verify_location": true,
"location_source": "ip",
"enforce_geofence": true,
"latitude": 19.076,
"longitude": 72.8777,
"radius": 500,
"elements": [
{
"x": 100,
"y": 220,
"page": 0,
"alignment": "center",
"type": "signature",
"label": "Employee signature"
}
]
}
]
}'Example Response
{
"data": {
"client_id": "template_xxx",
"name": "Employment Offer Template",
"file_id": "file_onwEUoMxnWhewUzodZeW",
"folder": "HR",
"signers": [
{
"sign_type": "suresign",
"auth_mode": [
1
],
"max_retry": 1,
"pfx_id": null,
"reason": "Employer sign",
"verify_email": false,
"verify_mobile": false,
"accept_virtual_sign": false,
"verify_location": false,
"location_source": "device",
"enforce_geofence": false,
"latitude": null,
"longitude": null,
"radius": null,
"elements": [
{
"field_id": "field_xxx",
"x": 100,
"y": 120,
"page": 0,
"type": "signature",
"alignment": "center",
"label": "Employer signature",
"width": 50,
"height": 50,
"font_size": null,
"format": null,
"value": null
},
{
"field_id": "field_aaa",
"x": 100,
"y": 170,
"page": 0,
"type": "text",
"alignment": "center",
"label": "Job title",
"width": 100,
"height": 50,
"font_size": 14,
"format": null,
"value": null
}
]
},
{
"sign_type": "suresign",
"auth_mode": [
1
],
"max_retry": null,
"pfx_id": null,
"reason": "Employee sign",
"verify_email": true,
"verify_mobile": false,
"accept_virtual_sign": false,
"verify_location": true,
"location_source": "ip",
"enforce_geofence": true,
"latitude": 19.076,
"longitude": 72.8777,
"radius": 500,
"elements": [
{
"field_id": "field_bbb",
"x": 100,
"y": 220,
"page": 0,
"type": "signature",
"alignment": "center",
"label": "Employee signature",
"width": 50,
"height": 50,
"font_size": null,
"format": null,
"value": null
}
]
}
]
},
"status_code": 200,
"message": "Success",
"success": true
}