Surepass
Templates

Update template

View as Markdown
PUT
/api/v1/templates/update

Update an existing template. name, folder, file_id, and signers are all optional in the request body.

  • If signers is provided, it replaces the saved signer blueprint completely and new field_id values are generated for all elements.
  • If signers is omitted, existing signers are preserved.
  • If file_id is provided, it must belong to the authenticated user.

Authorization

bearerAuth
AuthorizationBearer <token>

Bearer token authentication — paste your access token below.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

client_id*string

Template ID to update (template_...).

file_id?string

If provided, must belong to the authenticated user.

name?string

New template name.

folder?string

New folder name.

signers?array<>

If provided, replaces the saved signer blueprint completely and regenerates all field_id values. If omitted, existing signers are preserved.

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/v1/templates/update" \  -H "Content-Type: application/json" \  -d '{    "client_id": "template_xxx",    "name": "Employment Offer Template v2",    "folder": "HR Updated",    "signers": [      {        "sign_type": "suresign",        "max_retry": 2,        "reason": "Employer sign updated",        "accept_virtual_sign": true,        "elements": [          {            "x": 140,            "y": 120,            "page": 0,            "alignment": "center",            "type": "signature"          }        ]      }    ]  }'
{  "status_code": 0,  "message": "string",  "success": true,  "data": {    "client_id": "string",    "name": "string",    "file_id": "string",    "folder": "string",    "signers": [      {        "sign_type": "aadhaar",        "auth_mode": 0,        "max_retry": 0,        "pfx_id": "string",        "reason": "string",        "verify_email": true,        "verify_mobile": true,        "accept_virtual_sign": true,        "verify_location": true,        "location_source": "device",        "enforce_geofence": true,        "latitude": 0,        "longitude": 0,        "radius": 0,        "elements": [          {            "x": 0,            "y": 0,            "page": 0,            "alignment": "string",            "type": "signature",            "field_id": "string",            "width": 0,            "height": 0,            "font_size": 0,            "format": "string",            "value": "string"          }        ]      }    ]  }}