Replace draft document fields for recipients, including USB DSC placement
const url = 'https://app.qsig.in/backend/api/v1/envelopes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/documents/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fields';const options = { method: 'PUT', headers: {'X-Api-Key': '<X-Api-Key>', 'Content-Type': 'application/json'}, body: '{"fields":[{"recipient_id":"00000000-0000-0000-0000-000000000001","field_type":1,"page_number":2,"x":100,"y":560,"width":180,"height":55,"label":"USB DSC signature"},{"recipient_id":"00000000-0000-0000-0000-000000000001","field_type":4,"page_number":2,"x":100,"y":625,"width":220,"height":30,"label":"Full name"},{"recipient_id":"00000000-0000-0000-0000-000000000001","field_type":3,"page_number":2,"x":100,"y":665,"width":180,"height":30,"label":"Date signed"},{"recipient_id":"00000000-0000-0000-0000-000000000001","field_type":8,"page_number":2,"x":100,"y":705,"width":240,"height":30,"label":"Designation","value":"Authorized signatory"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://app.qsig.in/backend/api/v1/envelopes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/documents/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fields \ --header 'Content-Type: application/json' \ --header 'X-Api-Key: <X-Api-Key>' \ --data '{ "fields": [ { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 1, "page_number": 2, "x": 100, "y": 560, "width": 180, "height": 55, "label": "USB DSC signature" }, { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 4, "page_number": 2, "x": 100, "y": 625, "width": 220, "height": 30, "label": "Full name" }, { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 3, "page_number": 2, "x": 100, "y": 665, "width": 180, "height": 30, "label": "Date signed" }, { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 8, "page_number": 2, "x": 100, "y": 705, "width": 240, "height": 30, "label": "Designation", "value": "Authorized signatory" } ] }'Replace all signer fields on this draft PDF before sending. For USB DSC, include exactly one SIGNATURE (field_type 1). Coordinates are PDF points from the top left; page_number starts at 1. For a pre-created empty PDF signature field, pass its exact pdf_signature_field name instead of coordinates. Name, email and signing date are filled from signer details; Text and similar values can be pre-assigned.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body required
Section titled “Request Body required ”object
object
1 Signature; 3 Date Signed; 4 Full Name; 5 First Name; 6 Last Name; 7 Email; 8 Text; 9 Checkbox; 10 Number; 11 Date; 12 Dropdown; 13 Radio. INITIAL (2) is unavailable for USB DSC.
Alternative to x/y/width/height: x1,y1,x2,y2 in top-left PDF points.
For DSC SIGNATURE only: name of an existing empty PDF signature field. Coordinates may be omitted.
Optional pre-assigned value for Text, Date, and similar fields.
object
Examples
Position a USB DSC signature, name, date and pre-filled text
{ "fields": [ { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 1, "page_number": 2, "x": 100, "y": 560, "width": 180, "height": 55, "label": "USB DSC signature" }, { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 4, "page_number": 2, "x": 100, "y": 625, "width": 220, "height": 30, "label": "Full name" }, { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 3, "page_number": 2, "x": 100, "y": 665, "width": 180, "height": 30, "label": "Date signed" }, { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 8, "page_number": 2, "x": 100, "y": 705, "width": 240, "height": 30, "label": "Designation", "value": "Authorized signatory" } ]}Sign a named empty PDF signature field
{ "fields": [ { "recipient_id": "00000000-0000-0000-0000-000000000001", "field_type": 1, "pdf_signature_field": "SpotDraftSignature" } ]}Responses
Section titled “ Responses ”Fields replaced
Invalid field layout
Envelope already sent