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}}), with template_values.
  • Give a prefilled value to a field of each signer, with submitters[].values or submitters[].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

FieldTypeDescription
template_idnumberTemplate ID.
template_valuesobjectOne value per data key, such as {"cliente.nombre": "Ana Pérez"}. Only for tagged templates.
submitterslistSigners.
submitters[].roletextMust match a role of the template ({{firma:ROLE}}).
submitters[].nametextSigner name.
submitters[].emailtextSigner email.
submitters[].signature_typetextSignature type of this signer in this send. See Signature type per signer.
submitters[].valuesobjectOne prefilled value: {"field": "<field name>", "value": "<value>"}.
submitters[].fieldslistSeveral 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.

KindWhere it is sentWhat it fills
Data keys ({{key}})template_values, once per sendThe {{key}} tags of the text. Each key fills every place where it appears.
Template fieldssubmitters[].values or submitters[].fieldsThe 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[].values accepts one object per signer. For more fields, use submitters[].fields.
  • If the same field appears in values and in fields[].default_value, default_value wins. The value from values is 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:

  1. The signature_type of the signer in the send.
  2. The fixed type of the role in the template.
  3. 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 include signature_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.

CauseResponse text (example)
template_values on a PDF templatela plantilla no usa etiquetas
A prefilled field does not exist in the templatelos campos ["numero_cliente"] no existen en la plantilla "<name>"
A prefilled value is longer than 10000 charactersel valor prellenado del campo "<field>" excede 10000 caracteres
signature_type is not validinvalid signature type "<value>" for <email>; allowed: simple, advanced, biometric, advanced_biometric, notarial, efirma_sat
The role is at_send and the signer has no typesignature type required for role <ROLE>
A template_values key does not exist in the templateThe template service responds with an error that names the key.
The signer role does not exist in the templateThe 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.

Next steps