Send with template values by API
Beta
This feature is in beta. For now it is available only to some users. We will release it gradually to more accounts once testing ends. If you want to use it, ask your JAAK contact for access.
Description
POST /api/v1/submissions creates a signature request. With this endpoint you can:
- Fill the data keys of a tagged template (
{{key}}), withtemplate_values. - Give a prefilled value to a field of each signer, with
submitters[].valuesorsubmitters[].fields[].default_value. - Choose a signature type for each signer, with
submitters[].signature_type.
Use the company token in the Authorization: Bearer <token> header.
To create the template before the send, see Templates from Markdown or HTML by API or Create templates with AI by API.
Example
curl -X POST https://<host-api>/api/v1/submissions \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"template_id": 1234,
"template_values": {
"empresa.razon_social": "Empresa Demo SA de CV",
"cliente.nombre": "Ana Pérez",
"contrato.fecha": "2026-11-23"
},
"submitters": [
{
"role": "EL PRESTADOR",
"name": "Representante Demo",
"email": "representante@example.com",
"signature_type": "efirma_sat"
},
{
"role": "EL CLIENTE",
"name": "Ana Pérez",
"email": "ana.perez@example.com",
"signature_type": "simple",
"values": { "field": "numero_cliente", "value": "000123" }
}
]
}'
Request fields
| Field | Type | Description |
|---|---|---|
template_id | number | Template ID. |
template_values | object | One value per data key, such as {"cliente.nombre": "Ana Pérez"}. Only for tagged templates. |
submitters | list | Signers. |
submitters[].role | text | Must match a role of the template ({{firma:ROLE}}). |
submitters[].name | text | Signer name. |
submitters[].email | text | Signer email. |
submitters[].signature_type | text | Signature type of this signer in this send. See Signature type per signer. |
submitters[].values | object | One prefilled value: {"field": "<field name>", "value": "<value>"}. |
submitters[].fields | list | Several prefilled values. Each item has name, default_value and an optional required. |
Data keys and fields
There are two kinds of values. Do not mix them.
| Kind | Where it is sent | What it fills |
|---|---|---|
Data keys ({{key}}) | template_values, once per send | The {{key}} tags of the text. Each key fills every place where it appears. |
| Template fields | submitters[].values or submitters[].fields | The field of a signer, by its name. |
Rules for template_values:
- It works only with tagged templates. In a PDF template, the request fails.
- The date uses the format
YYYY-MM-DD. - The server creates a hidden version of the template for each send, with the values. The original template does not change.
Rules for prefilled values per signer:
- The field name must exist in the template. If it does not, the request fails and the error lists the names.
- A value cannot be longer than 10000 characters.
submitters[].valuesaccepts one object per signer. For more fields, usesubmitters[].fields.- If the same field appears in
valuesand infields[].default_value,default_valuewins. The value fromvaluesis not used.
Read-only fields
A field that the template marks as read-only is filled with the value that you send in values or in fields. The template sets the lock. The send only sets the value.
For the template design, see Templates with tags (mail merge).
Signature type per signer in the send
Each signer can include signature_type. The type is resolved in this order:
- The
signature_typeof the signer in the send. - The fixed type of the role in the template.
- The type of the template.
Valid signature_type values in the send:
simple, advanced, biometric, advanced_biometric, notarial, efirma_sat.
Rules:
- If the role of the template is
at_send(Define at send), the signer must includesignature_type. If it is missing, the request fails. - If the signer includes
signature_type, that value wins over the role. - The value applies only to this send. The template does not change.
- A send never stores
at_send. It stores the resolved type of each signer.
Errors
Validation errors return 400. The response text gives the cause.
| Cause | Response text (example) |
|---|---|
template_values on a PDF template | la plantilla no usa etiquetas |
| A prefilled field does not exist in the template | los campos ["numero_cliente"] no existen en la plantilla "<name>" |
| A prefilled value is longer than 10000 characters | el valor prellenado del campo "<field>" excede 10000 caracteres |
signature_type is not valid | invalid signature type "<value>" for <email>; allowed: simple, advanced, biometric, advanced_biometric, notarial, efirma_sat |
The role is at_send and the signer has no type | signature type required for role <ROLE> |
A template_values key does not exist in the template | The template service responds with an error that names the key. |
| The signer role does not exist in the template | The request is rejected and no submission is created. |
The API messages in this table are in Spanish. Field names appear in the error messages. Values do not.