Skip to content

List a template's variables

GET
/v1/templates/{id}/variables
curl -H "X-Api-Key: $KEY" "http://localhost:9027/v1/templates/$ID/variables"

Lists the data a template reads: each path, which paths are arrays it loops over, and the fields it reads from their items, with a skeleton of data. Read from the template’s tags, so a path built at render time, such as row[column], is listed only as far as it is written.

id
required
string

The template’s id, or an alias as name or name@version

What the template reads

Media typeapplication/json

What a stored template reads from its data.

object
example
required

Data of the right shape, with empty strings where values go.

object
format
required
string
templateId
required

The template’s id, also when it was asked for by alias.

string
variables
required

Every path the template reads, parents first: customer.name, items (an array), items[].price. For a PDF form, its fields’ names and the tags in their values; tags in annotations are not listed.

Array<object>

One path the template reads.

object
path
required

Dotted, with [] for each item of an array: items[].price. items[] itself says what each item is.

string
type
required

What a template does with a path.

string
Allowed values: value object array

Example

{
"format": "docx",
"variables": [
{
"path": "items[].price",
"type": "value"
}
]
}

This caller has no such template

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

The template has syntax errors

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

RUSTICDOC_STORE is not set

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

The store cannot be reached

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}