Instead of a ready-made file, you can create a document from a template — a template stored in Signi with fillable fields. Via the API you then send only the field values, no file.
Templates are a paid Signi add-on.
Creating templates
You can create templates in the app in the Template Editor. A template contains the document text with fillable fields — via the API you then just insert values into the fields.
How it works
In the JSON instructions, instead of the file field you use template — the template ID and the values of its parameters:
{
"people": [
{
"is_proposer": true,
"email": "vas@email.cz",
"contract_role": "sign"
},
{
"is_proposer": false,
"party_order": 2,
"email": "protistrana@email.cz",
"contract_role": "sign",
"first_name": "Jan",
"last_name": "Novák",
"person_type": "legal"
}
],
"template": {
"id": 8,
"parameters": [
{ "id": "11", "value": "Praha" }
]
}
}
The call is then simpler — only the JSON is sent, without a file:
curl -X POST "https://api.signi.com/api/v1/contract/" \
-H "x-api-key: VAS_API_KLIC" \
-F "data=@dokument.json;type=application/json"
What party_order is for
A template has predefined contracting parties (e.g. the client and the contractor). party_order specifies which template party a person belongs to — the party number. In the example above, the counterparty is party no. 2.
You don't need to deal with signature positions — they are defined by the template.
A concrete example
Try filling out the Consent to electronic communication — download the sample JSON (replace the e-mails and phone with your own):
{
"contract_name": "Souhlas s elektronickou komunikací - Test Tester",
"locale": "cs",
"state": "pending",
"settings": {
"signing_order": "all_at_once",
"autosign_proposers": "V Praze"
},
"people": [
{
"is_proposer": true,
"email": "test@signi.com",
"contract_role": "sign"
},
{
"is_proposer": false,
"email": "test+1@signi.com",
"contract_role": "sign",
"phone": "603123456",
"first_name": "Test",
"last_name": "Tester",
"person_type": "nature"
}
],
"template": {
"id": "2105",
"parameters": [
{ "id": "101", "name": "Jméno / Název společnosti", "value": "Test Tester" },
{ "id": "102", "name": "Adresa / Místo podnikání", "value": "Testovací 123, 110 00 Praha" },
{ "id": "103", "name": "Datum narození / IČO", "value": "8.8.2006" },
{ "id": "131", "name": "Název", "value": "Ukázková firma s.r.o." },
{ "id": "132", "name": "IČO", "value": "12345678" },
{ "id": "121", "name": "např", "value": "pracovní smlouvy, dohody, mzdové výměry" },
{ "id": "141", "name": "Pro společnost", "value": "Ukázková firma s.r.o." },
{ "id": "142", "name": "IČ", "value": "12345678" },
{ "id": "143", "name": "Sídlo", "value": "Firemní 1, 110 00 Praha" },
{ "id": "151", "name": "Email", "value": "test+1@signi.com" },
{ "id": "152", "name": "Telefon", "value": "603123456" }
]
}
}
Note the contract_name field (document name), locale (communication language), and settings.autosign_proposers — the proposer signs automatically, only the place of signature is added.
Submitting:
curl -X POST "https://api.signi.com/api/v1/contract/" \
-H "x-api-key: VAS_API_KLIC" \
-F "data=@vzor-souhlas-el-komunikace.json;type=application/json"
What you get back:
{
"contract_id": 1234567,
"state": "pending",
"notifications": [
{ "email": "vas@email.cz",
"links": { "contract": "https://app.signi.com/dashboard/workspace/…/documents/1234567" } },
{ "email": "protistrana@email.cz",
"links": { "contract": "https://app.signi.com/signing/…/received" } }
]
}
- contract_id — the document ID for further calls (status, download).
- notifications — links for individual people: the proposer to the workspace, the counterparty directly to the signing page. You can show the link to the counterparty right in your own app, so they don't have to wait for the e-mail.
Where to find the template and parameter IDs
The list of workspace templates is returned by:
curl -H "x-api-key: VAS_API_KLIC" https://api.signi.com/api/v1/contract/templates
{
"templates": [
{
"id": 123,
"name": "Souhlas s elektronickou komunikací",
"parameters": [
{ "id": "101", "type": "con-textarea", "name": "Jméno / Název společnosti", "values": null },
{ "id": "131", "type": "con-options", "name": "Předmět smlouvy", "values": ["první", "druhá"] }
]
}
]
}
For each template you see the ID and the list of parameters — the con-options type means a choice from the values in values.
The values the counterparty filled into the template can be read back via the API — see Values filled in a template.
Where to go next
- Multiple signers
- Automatic signature of the proposer — handy for documents generated from templates
- Quickstart — your first document to sign via API
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article