You can only create a transaction only from a published
template.
When creating a transaction from a template, only the template_id
parameter is required. All other parameters are optional, unless they are requested by the template creator.
The template creator may define some elements (document, specimen or participant) as optional. In this case, when creating a transaction, you can choose to include optional elements or remove them (as shown in the request example below).
To create a transaction from a template, send a request to POST /v1/transactions/template
and set the template_id
argument.
curl
https://api.universign.com/v1/transactions/template \
-d template_id: tpl_weVPZX7wDvm7 \
-d folder_id: fol_DGX2qbq6yGmm \
-d autostart: true \
-d name: MyTemplateTransaction \
-d participants[$1740405926564].email: [email protected] \
-d participants[[email protected]].remove: true \
-d documents[doc_0VK8].file: file_3D2xGaD8ZzaEdsl3mDwv4Lq2zA \
-d documents[doc_0VK8].name: Contract template.pdf \
-d fields[fld_dn0].x: 324 \
-d fields[fld_dn0].y: 422 \
-d fields[fld_dn0].page: 2 \
-d fields[fld_QPYM].x: 64 \
-d fields[fld_QPYM].y: 425 \
-d fields[fld_QPYM].page: 2
template_id
: The id of the template used to create the transaction.folder_id
: The id of the folder in which you want to create the transaction.autostart
: Whether the transaction must be started automatically or not.name
: The name of the transaction.participant[$id].email
: The unknown participant’s email.participant[email].remove
: Set totrue
if you don’t want the participant to be included in the transaction. Set only ifremovable
is true.document[$id].file
: The file ID of the final document to replace the specimen of the template.document[$id].name
: The name of the final document to replace the specimen of the template. Cannot be set if the specimen name is locked by the template creator.fields[id].x
: The field horizontal coordinate on the document page (in pixels).fields[id].y
: The field vertical coordinate on the document page (in pixels).fields[id].page
: The page number on which you want to position the field.
In this request example, the template creator requested:
- an optional known participant,
- a mandatory unknown participant to be defined,
- a specimen to be replaced by the final document to be signed.
The API returns a transaction object.
{
"object" : "transaction",
"id" : "tx_kLVed6DQdd34",
"folder_id" : "fol_DGX2qbq6yGmm",
"created_at" : "2025-02-24T16:43:41Z",
"started_at" : "2025-02-24T16:43:41Z",
"expires_at" : "2025-03-10T16:43:41Z",
"name" : "MyTemplateTransaction",
"folder_name" : "Default folder",
"stalled" : false,
"language" : "fr",
"sender_name_display" : "issuing_entity",
"creator" : {
"name" : "John ",
"email" : "[email protected]",
"workspace_name" : "DemoWS"
},
"state" : "started",
"participants" : [ {
"email" : "[email protected]",
"phone_number_type" : "suggestion",
"min_signature_level" : "level1",
"schedule" : [ 0 ],
"ongoing_conversation" : false,
"has_unread_message" : false,
"state" : "open",
"access_control" : "standard",
"shared_contact" : false,
"waiting_period" : 0,
"full_name_type" : "suggestion"
} ],
"watchers" : [ {
"member_id" : "mbr_x7qgzxz9e1XM",
"email" : "[email protected]",
"full_name" : "John "
} ],
"sealers" : [ ],
"documents" : [ {
"id" : "doc_GX67",
"name" : "Mandatory document",
"editable" : true,
"updatable" : true,
"deletable" : false,
"fields" : [ {
"id" : "fld_v5K",
"position" : {
"page" : 2,
"x" : 324,
"y" : 422,
"width" : 200,
"height" : 50
},
"type" : "signature",
"built_in" : false,
"consents" : [ ],
"optional_consents" : [ ],
"updatable" : true,
"deletable" : true
}, {
"id" : "fld_64aO",
"position" : {
"page" : 2,
"x" : 64,
"y" : 425,
"width" : 200,
"height" : 50
},
"type" : "signature",
"built_in" : false,
"consents" : [ ],
"optional_consents" : [ ],
"updatable" : true,
"deletable" : false
} ],
"big_file" : false,
"available" : true
} ],
"field_groups" : [ {
"id" : "fld_v5K",
"type" : "field"
}, {
"id" : "fld_64aO",
"type" : "field"
} ],
"instructions" : {
"signatures" : [ {
"signer" : "[email protected]",
"field" : "fld_64aO"
} ],
"reviews" : [ ],
"captures" : [ ],
"sequencing" : [ ],
"editions" : [ ]
},
"actions" : [ {
"id" : "act_1ZOnqm0kxxkaZ",
"actor" : "[email protected]",
"state" : "open",
"url" : "https://apps.universign.net/npds/act_1ZOnqm0kxxkaZ",
"tasks" : [ {
"type" : "signature",
"state" : "todo",
"field" : "fld_64aO"
} ],
"stalled" : false
} ],
"action_graph" : {
"start" : [ "act_1ZOnqm0kxxkaZ" ],
"act_1ZOnqm0kxxkaZ" : [ "end" ]
},
"metadata" : { },
"progress_value" : 0,
"ongoing_conversation" : false,
"has_unread_message" : false,
"origin" : "webapp",
"carbon_copies" : [ ],
"task_count" : 1,
"tasks_to_do" : 1,
"collected" : [ ],
"can_reviewer_access_signed_documents" : true,
"issuing_entity" : {
"id" : "iss_aX0wDPD86DlQ",
"name" : "DemoWS",
"lock_sender_name_display" : false
},
"max_expiry" : "180_days",
"uploads" : [ ],
"private" : true
}