(subject, data_key) pair. A template made
from a real form often arrives with boxes that have no data_key, or with keys derived from the
printed labels, such as yes or date_birth. This page is about fixing that once, on the
template, so that every envelope created from it afterwards is addressed the way your data is.
How much of a template you can address
GET /api/v1/templates/{templateId} carries coverage, counted by
the same code as the line under the template’s name in the editor, so the two always agree.
Two fields of the same other type at one address are not a collision: that is one datum printed
twice, such as an ID number on the application and again on the declaration, and one value fills
both.
Reading a template only when it has changed
Every read of a template answers with anETag: the hash of the whole body, context, coverage
and warnings included, so it changes whenever anything in the body does. Send it back as
If-None-Match and, while nothing has changed, the answer has no body. It still counts as a
request against your rate limit. Test and live keys holding
templates:read both get it.
Renaming fields
PATCH /api/v1/templates/{templateId}/fields sets a
field’s data_key, label and subject, and a question’s label.
PATCH /api/v1/templates/{templateId}/fields/{fieldId} does
the same for one field.
- Names only. Nothing else about a field can change here: not where it is, its type, who fills
it, its options, its rules or its conditions. Any other property is refused. A name is not inert,
though: a field’s
data_keydecides which value an envelope can be created with in that box, and itssubjectwhether the box is shown when that person is not on the envelope. That holds for a required field too: moving one to a subject who may be absent makes it optional whenever they are, exactly as the same change in the editor does. - A dedicated scope. The key must name
templates:name. A full-access key does not hold it; choose it by name when you create the key. - Live keys only. A template has no environment: the same template serves test and live sends.
A rename made with a
vsk_test_key would change what live envelopes contain, so it is refused withtest_key_cannot_edit_templates. A key whose creator has left your organisation is refused withapi_key_owner_removed. - Against the version you read. Send the template’s
ETagasIf-Match. Without it, or with*, the answer isprecondition_required. If the template has changed since, the answer istemplate_changedwith the currentETag, and nothing is renamed: read the template again and look at what changed before you retry. A retry of a rename that succeeded, whose answer you lost, is answered as a success: every name it asks for is already there. - All or nothing. At most 500 fields and 200 questions in one request. Every change applies, or none does.
- Only envelopes created afterwards use the new names. An envelope already created, sent or not, keeps the names it was created with, and the values it holds stay where they were.
- Recorded. Every change is kept in the template’s naming record with the key that made it, and each request that changes a name appears in your organisation’s activity. A rename in the editor is recorded the same way.
What a name may be
A key you set is at most 100 characters and follows the naming grammar:namespace.attribute or namespace.entity.attribute, each segment snake_case starting with a
letter and at most 40 characters, such as medical_aid.plan or funeral.cover.amount.
- The namespaces
person, employer, employment, residential_address, postal_address, bankbelong to the core vocabulary, a shared list of keys that is not published yet. No key in them can be set until it is. - A namespace may not be a subject key, either one the template declares or one of the standard
ones,
spouse, dependant_<n>, beneficiary_<n>, witness_<n>, where n counts from one. The subject is never part of the key: setsubjectinstead. - A key a field already has may be kept, whatever it says.
data_key: nullremoves it. - A box in a question takes no key or subject of its own; name it with
label. Option values, and a question’s own key, come with the core vocabulary. - A rename may not make a collision, as
coveragecounts them. A collision the template already had does not stop you renaming other fields, which is how you fix it. - A
labelis at most 200 characters, and not blank;nullremoves it. It may be changed on any field, a signature or a question’s box included, as in the editor. A label is Vumasign’s name for the box; it does not change the printed document, which is what decides what a tick or a signature means. Asubjectmust be declared on the template. - ⚠️ A
subjectnever changes here on a field nobody may prefill: a signature, initials, an attachment or a field the product stamps. On those fields the subject decides whether somebody must sign or complete them, and a key must not be able to change that unseen. The request is refused withvalue_not_writable. This is deliberately stricter than the editor, which allows it.
naming_rule_broken, and the message names the rule and
the fields. A key or a new subject on a field nobody may prefill is value_not_writable, a subject
the template does not declare is value_subject_unknown, and an id that is not
one of the template’s is field_unknown.
Sending against the template you checked
POST /api/v1/envelopes and
POST /api/v1/envelopes/batches take an optional
template_etag: the ETag you read, or the template_etag that
validate-values answers with. If the template has
changed since, the create is refused with template_changed (for a batch,
template_changed), and nothing is created.
Send it on every envelope. A value for a key that no longer exists is refused loudly. But if two
addresses were swapped, say the member’s ID number and the spouse’s, a value would land in the
wrong box and nothing would say so. template_etag is what catches that.