Surepass
Templates

Save template

POST
/api/v1/templates/save

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.

  • signers is ordered: the first template signer maps to the first runtime signer supplied later in initialize-from-template, and so on.
  • Every signer must contain at least one signature element.
  • A field_id is generated automatically for each saved element and returned in template reads; those values are what initialize-from-template.signers[].element_values uses later.
  • file_id must belong to the authenticated user.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication. Paste your access token below.

Request Body

application/json
  1. body
name*string

Template name.

file_id*string

Must belong to the authenticated user.

folder?string

Folder 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.

Items1 <= items

Response Body

Template saved.

application/json
  1. response

Standard response envelope.

status_code?integer

HTTP status code echoed in the response body.

message?string

Human-readable result message.

success?boolean

true when the request succeeded.

data?
Example Request
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
}