Skip to main content
A document is created from a template — or from a file you already have, see Uploading your own document. The template defines the print form and the set of variables filled in when a document is created. These variables are described in variable_schema — a JSON schema that template_values in the POST /documents body must conform to. The workflow is simple: find a template → read its variable_schema → prepare template_values per that schema. All template reading is covered by the documents:read scope.

Searching templates

GET /document_templates returns active templates only, page by page. Narrow the selection with the search parameter by name:
The list follows the general pagination: limit (defaults to 100, maximum 1000) and an opaque page_token. Inactive templates are not returned through the Developer API.

Reading the variable schema

GET /document_templates/{template_id} returns the template together with its variable_schema:
The contents of variable_schema depend on the specific template — read it before creating a document rather than relying on memory. For the “Employment order” template in the example, template_values is assembled from the three required fields:
Pin the template version: pass template_version in POST /documents equal to the version from the response. That way the document is created against the schema you read, even if the template is updated later.
If template_values does not conform to the template’s variable_schema (a required field is missing, a wrong type), POST /documents returns 400. Check your values against the schema before sending.

Next

Signing

Create a document from a template and run it through the route.

Documents overview

Statuses, object structure, and files.