Skip to main content
POST
/
v1
/
templates
Upload a Template
curl --request POST \
  --url https://reporter.sandbox.lerian.net/v1/templates \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-Organization-id: <x-organization-id>' \
  --form template='@example-file' \
  --form outputFormat=TXT \
  --form 'description=List of holders'
{
  "id": "0196b270-a315-7137-9408-3f16af2685e1",
  "outputFormat": "TXT",
  "description": "List of holders",
  "fileName": "0196b270-a315-7137-9408-3f16af2685e1.tpl",
  "createdAt": "2025-05-09T00:27:28.405080783Z",
  "updatedAt": "2025-05-09T00:27:28.405080783Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt

Use this file to discover all available pages before exploring further.

Need a sample to test this endpoint? Click here to download a sample .tpl file.

Headers

Authorization
string

The authorization token in the 'Bearer ' format.

Important: This header is required if your environment has Access Manager enabled. For more information, refer to the Access Manager documentation.

Content-Type
string
required

The request content type. Important: For this endpoint, it must be multipart/form-data.

X-Organization-id
string
required

The unique identifier of the Organization associated with the request.

X-Idempotency
string

Optional idempotency key for safe retries. If omitted, the server may generate one automatically.

See Retries and idempotency for details.

Body

multipart/form-data
template
file
required

The .tpl file you've created to serve as the template definition.

outputFormat
enum<string>
required

The format of the report that the template will generate.

Available options:
HTML,
CSV,
XML,
PDF,
TXT
Example:

"TXT"

description
string
required

A brief description about the template.

Example:

"List of holders"

Response

Indicates that the template was successfully created.

The response includes the X-Idempotency-Replayed header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

The response may also include warnings when schema validation could not fully validate one or more data sources referenced by the template. The template is still created.

See Retries and idempotency for more details.

Details about the template that was created or updated.

id
string

Unique ID that identifies the template (UUID format).

outputFormat
string

The format of the generated output (e.g., HTML, CSV, PDF, TXT, XML).

description
string

Briefly describes what the template is for or what it contains.

fileName
string

The name of the template file as stored in the system. Follows the <template_id>.tpl format.

createdAt
string

Timestamp indicating when the template was created.

updatedAt
string

Timestamp indicating the last time the template was updated.

warnings
object[]

Returned when schema validation could not fully validate one or more data sources referenced by the template. The create or update operation still succeeds. Absent when no warnings were produced.