Litmus Edge Manager 3.0.x - Edge Lifecycle: Templates
Templates List
GET {{LEM_URL}}/api/v1/template/list?companyName={{company_name}}&limit=10&projectId={{project_id}}
Templates List
Returns the templates available in one company / project. A template is a saved configuration snapshot (devices, flows, analytics processors, integrations, digital twin models) that can be applied to new devices during onboarding.
Updated in 3.0. New optional query parameters:
templateName,version.
Endpoint
GET {{LEM_URL}}/api/v1/template/list?companyName={{company_name}}&limit=10&projectId={{project_id}}
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Response |
200 OK -- application/json. Each entry: companyName, projectId, deviceId, scope, timestamp, name, desc, parameterized, stat (JSON-encoded stats string).
Errors
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Response
Status: 200 OK
[
{
"companyName": "Litmus",
"projectId": "231234adf323424124445",
"deviceId": "231234adf323424124445",
"scope": "COMPANY",
"timestamp": 1523234233,
"name": "Litmus/<project ID>/<device ID>/PROJECT/1523234233",
"desc": "Template for Siemens devices",
"parameterized": false,
"stat":"{\"devices\":8,\"flows\":2,\"marketplace\":{\"marketplaces\":3,\"applications\":1,\"registries\":15},\"connectors\":3,\"analytics\":62,\"dtwin\":{\"instances\":3,\"models\":2}}"
}
]
Template Composition
GET {{LEM_URL}}/api/v1/template/composition?projectId={{project_id}}&deviceId={{device_id}}
Template Composition
Returns the composition catalog for a device -- what is available to include in a new template (auth providers, connectors, devices, country, etc.). Use this as the basis for the creationOptions body of Create Template.
Endpoint
GET {{LEM_URL}}/api/v1/template/composition?projectId={{project_id}}&deviceId={{device_id}}
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Errors |
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Response
Status: 200 OK
{
"auth": {
"providers": null
},
"connectors": [
{
"id": "843e6ca7-f995-4a5b-80ad-29610230cb7b",
"name": "data-rate-test",
"provider": "gcloud-pubsub"
},
{
"id": "c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",
"name": "ClarifyIOssl",
"provider": "generic-mqtt-ssl"
}
],
"country": false,
"devices": [
{
"id": "41FBD12E-C6CD-4539-AD50-336D278B207C",
"name": "Rack 2b M258"
},
{
"id": "474E42B0-C7B8-42DE-8DE2-FFED7030A563",
"name": "DTA windows tia"
},
{
"id": "4C4B9CCC-F5E4-4C2E-A4C0-EAF5C32B0D1A",
"name": "AB CLX API testing"
},
{
"id": "779F42F3-54FC-4A87-B9A6-CD39CFA4A97D",
"name": "Simulator2"
},
{
"id": "89C52E9A-0901-4D8D-B842-7B533F64E1B7",
"name": "ClassificationSimulator"
},
{
"id": "BAFD349E-21B6-408A-AE2F-B9C682912571",
"name": "Boiler"
},
{
"id": "CDC283FB-72E2-42DF-A587-4D6299D70C9A",
"name": "sim1"
}
],
"dns": false,
"docker": false,
"dtwin": {
"instances": [
{
"id": "d0c8844d-ef72-4933-bb5e-b74372b33f4b",
"name": "Instance1"
},
{
"id": "5992744a-65b9-431f-880c-4efa2644a57f",
"name": "apiInstance"
}
],
"models": [
{
"id": "d9117ae5-3f3e-4436-9a2a-6dd725fbd8fb",
"name": "Digital-Twin-1"
},
{
"id": "3a923971-5dfc-4633-b5af-a6bf8c0b60e9",
"name": "apiTest"
}
]
},
"flows": [
{
"id": "1",
"label": "flow-1"
},
{
"id": "4",
"label": "videoprocessing"
}
],
"groups": [
{
"name": "default"
},
{
"name": "ml-classification"
},
{
"name": "sensorAnalytics"
}
],
"marketplace": {
"catalogs": [
{
"applications": null,
"id": "2de5c161-1a8d-11ed-8d9d-94c6911b9c77",
"name": "Solutions Catalog"
},
{
"applications": [
{
"id": "ca877b46-1a8c-11ed-8791-94c6911b9c77",
"name": "MySQL"
}
],
"id": "c93dbe1b-1a8c-11ed-8d9d-94c6911b9c77",
"name": "Catalog Applications"
},
{
"applications": null,
"id": "default-marketplace",
"name": "Default Marketplace Catalog"
}
],
"registries": [
{
"id": "06c1831c-e1c3-4dec-9462-927045c68cc5",
"name": "Elastic docker registry"
},
{
"id": "1c3e352b-18d9-476c-bffb-c2d6860b91af",
"name": "GOOGLE REGISTRY"
},
{
"id": "37089c8a-a4bf-4743-ba91-a308a3d2879b",
"name": "Elastic docker registry"
},
{
"id": "4eb828ff-ada3-404c-ad0b-63551ee1e42f",
"name": "Public Docker Hub"
},
{
"id": "507380c5-e3a9-475c-9b8f-8dcfef9f6bc1",
"name": "Microsoft Docker Container registry"
},
{
"id": "619022b2-2144-4bd0-9d24-18c0be55d158",
"name": "Microsoft Docker Container registry"
},
{
"id": "694a9804-4a20-4d61-bbef-c5c72e969a94",
"name": "Elastic public docker registry"
},
{
"id": "6a77715d-0ade-4040-bae0-f41568d07e8c",
"name": "Public docker repository"
},
{
"id": "70f7c354-af13-4768-b6a5-ff969e2f1a5f",
"name": "Elastic docker repository"
},
{
"id": "8e22251d-d304-11ec-a0f9-94c6911b9c77",
"name": "litmusjupyter"
},
{
"id": "b90acb33-a037-4f84-8311-e17ffabe8ccf",
"name": "Public docker hub"
},
{
"id": "d6ea3123-d2d2-49a7-82e3-5fc9ff4aefdc",
"name": "GCR-solutions-registry"
},
{
"id": "e2d72df6-50df-11ee-abb6-94c6911b9c77",
"name": ""
},
{
"id": "eb33db83-3bfd-4eff-8a6f-a7ca72cebaab",
"name": "Microsoft Docker Container registry"
},
{
"id": "faedaf64-acdd-4a34-8238-3003e8ad77c5",
"name": "Public docker hub"
}
]
},
"ntp": false,
"opcua": [
{
"name": "EdgeDevice",
"type": "FOLDER"
},
{
"name": "Users",
"type": "CONFIG"
},
{
"name": "Modes",
"type": "CONFIG"
},
{
"name": "Policies",
"type": "CONFIG"
},
{
"name": "Enabled",
"type": "CONFIG"
},
{
"name": "Certificates",
"type": "CONFIG"
}
],
"timezone": false
}
List all Variables of Template
GET {{LEM_URL}}/api/v1/template/list-variables?templateName={{template_name}}
List all Variables of Template
Returns the variables declared in one template. Variables are placeholders that get substituted when the template is applied to a new device.
Endpoint
GET {{LEM_URL}}/api/v1/template/list-variables?templateName={{template_name}}
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Errors |
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Response
Status: 200 OK
[
{
"name": "Variable name",
"type": "String value",
"description": "Variable description"
}
]
Create Template
POST {{LEM_URL}}/api/v1/template/create
Create Template
Creates a new template from one source device. The body specifies which categories (auth, connectors, devices, country, ...) to include.
3.0.x:
friendlyName(request body) is required; without it the call fails withFriendly name is required.templateDescriptionis no longer required.creationOptionsmust listdevices,flowsandconnectors(empty arrays are allowed).
Endpoint
POST {{LEM_URL}}/api/v1/template/create
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Request body |
{
"deviceId": "1a5wiavluwxuhwai5leb1v0hc",
"templateDescription": "newTemplate",
"creationOptions": {
"auth": { "providers": [] },
"connectors": ["843e6ca7-..."],
"country": true,
"devices": ["41FBD12E-..."]
}
}
Errors
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Request Body
{
"deviceId": "1a5wiavluwxuhwai5leb1v0hc",
"templateDescription": "newTemplate",
"creationOptions": {
"auth": {
"providers": []
},
"connectors": [
"843e6ca7-f995-4a5b-80ad-29610230cb7b",
"c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0"
],
"country": true,
"devices": [
"41FBD12E-C6CD-4539-AD50-336D278B207C",
"474E42B0-C7B8-42DE-8DE2-FFED7030A563",
"4C4B9CCC-F5E4-4C2E-A4C0-EAF5C32B0D1A",
"779F42F3-54FC-4A87-B9A6-CD39CFA4A97D",
"89C52E9A-0901-4D8D-B842-7B533F64E1B7",
"BAFD349E-21B6-408A-AE2F-B9C682912571",
"CDC283FB-72E2-42DF-A587-4D6299D70C9A"
],
"dns": true,
"docker": true,
"digitalTwin": {
"instances": [
{
"id": "d0c8844d-ef72-4933-bb5e-b74372b33f4b",
"name": "Instance1"
},
{
"id": "5992744a-65b9-431f-880c-4efa2644a57f",
"name": "apiInstance"
}
],
"models": [
{
"id": "d9117ae5-3f3e-4436-9a2a-6dd725fbd8fb",
"name": "Digital-Twin-1"
},
{
"id": "3a923971-5dfc-4633-b5af-a6bf8c0b60e9",
"name": "apiTest"
}
]
},
"flows": [
"1",
"4"
],
"groups": [
"default",
"ml-classification",
"sensorAnalytics"
],
"marketplace": {
"catalogs": [
{
"id": "2de5c161-1a8d-11ed-8d9d-94c6911b9c77",
"name": "Solutions Catalog",
"applications": []
},
{
"id": "c93dbe1b-1a8c-11ed-8d9d-94c6911b9c77",
"name": "Catalog Applications",
"applications": [
{
"id": "ca877b46-1a8c-11ed-8791-94c6911b9c77",
"name": "MySQL"
}
]
},
{
"id": "default-marketplace",
"name": "Default Marketplace Catalog",
"applications": []
}
],
"registries": [
{
"id": "06c1831c-e1c3-4dec-9462-927045c68cc5",
"name": "Elastic docker registry"
},
{
"id": "1c3e352b-18d9-476c-bffb-c2d6860b91af",
"name": "GOOGLE REGISTRY"
},
{
"id": "37089c8a-a4bf-4743-ba91-a308a3d2879b",
"name": "Elastic docker registry"
},
{
"id": "4eb828ff-ada3-404c-ad0b-63551ee1e42f",
"name": "Public Docker Hub"
},
{
"id": "507380c5-e3a9-475c-9b8f-8dcfef9f6bc1",
"name": "Microsoft Docker Container registry"
},
{
"id": "619022b2-2144-4bd0-9d24-18c0be55d158",
"name": "Microsoft Docker Container registry"
},
{
"id": "694a9804-4a20-4d61-bbef-c5c72e969a94",
"name": "Elastic public docker registry"
},
{
"id": "6a77715d-0ade-4040-bae0-f41568d07e8c",
"name": "Public docker repository"
},
{
"id": "70f7c354-af13-4768-b6a5-ff969e2f1a5f",
"name": "Elastic docker repository"
},
{
"id": "8e22251d-d304-11ec-a0f9-94c6911b9c77",
"name": "litmusjupyter"
},
{
"id": "b90acb33-a037-4f84-8311-e17ffabe8ccf",
"name": "Public docker hub"
},
{
"id": "d6ea3123-d2d2-49a7-82e3-5fc9ff4aefdc",
"name": "GCR-solutions-registry"
},
{
"id": "e2d72df6-50df-11ee-abb6-94c6911b9c77",
"name": ""
},
{
"id": "eb33db83-3bfd-4eff-8a6f-a7ca72cebaab",
"name": "Microsoft Docker Container registry"
},
{
"id": "faedaf64-acdd-4a34-8238-3003e8ad77c5",
"name": "Public docker hub"
}
]
},
"ntp": true,
"opcua": [
{
"name": "EdgeDevice",
"type": "FOLDER"
},
{
"name": "Users",
"type": "CONFIG"
},
{
"name": "Modes",
"type": "CONFIG"
},
{
"name": "Policies",
"type": "CONFIG"
},
{
"name": "Enabled",
"type": "CONFIG"
},
{
"name": "Certificates",
"type": "CONFIG"
}
],
"timezone": true
},
"friendlyName": "Line 3 baseline"
}
Response
Status: 200 OK
{
"code": "S",
"message": null,
"messageDetails": null
}
Upload Template
POST {{LEM_URL}}/api/v1/template/upload?scope=PROJECT&companyName={{company_name}}&projectId={{project_id}}&description=Line 3 baseline&friendlyName=Line 3 baseline
Upload Template
Uploads a Litmus Edge template file (the JSON an LE exports) into LEM. LEM names it <companyName>/<projectId>/<deviceId>/<SCOPE>/<timestamp>; read the name back from Templates List.
3.0.x:
friendlyName(query parameter) is required; without it the call fails withRequired request parameter 'friendlyName' ... is not present. An optionaluserEncryptionKeyencrypts embedded secrets.
Endpoint
POST {{LEM_URL}}/api/v1/template/upload?scope=PROJECT&companyName={{company_name}}&projectId={{project_id}}&description=...
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scope |
string | Yes | PROJECT, DEVICE or INSTANCE. |
companyName |
string | For PROJECT / DEVICE |
Company slug. |
projectId |
string | For PROJECT / DEVICE |
Project ID. |
deviceId |
string | For DEVICE |
Device ID. Project templates get default. |
description |
string | No | Shown as the template description. |
Request body
multipart/form-data with one file part: the template JSON.
Response
200 OK with {"code": "S"}.
Errors
| HTTP status | When it happens |
|---|---|
401 Unauthorized |
Missing or invalid X-AuthToken. |
400 Bad Request |
scope or file missing. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Request Body
Response
Status: 200 OK
{
"code": "S",
"message": null,
"messageDetails": null
}
Download Template
POST {{LEM_URL}}/api/v1/template/download?templateName={{template_name}}
Download Template
Returns a template's content by name, as JSON in the response body (no file link despite the spec summary).
Endpoint
POST {{LEM_URL}}/api/v1/template/download?templateName={{template_name}}
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
templateName |
string | Yes | Full name from Templates List, e.g. companya/<projectId>/default/PROJECT/1791998015784. URL-encode the slashes. |
Response
200 OK. The template JSON as uploaded.
Errors
| HTTP status | When it happens |
|---|---|
401 Unauthorized |
Missing or invalid X-AuthToken. |
404 Not Found |
Not found. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Response
Status: 200 OK
{
"stats": {
"timeseries_db": {
"source": "internal",
"enabled": true
},
"version": {
"Git": "33a036cdbf",
"Version": "2.2.2"
}
}
}
Delete Template
DELETE {{LEM_URL}}/api/v1/template?templateName={{template_name}}
Delete Template
Deletes a template by name.
Endpoint
DELETE {{LEM_URL}}/api/v1/template?templateName={{template_name}}
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
templateName |
string | Yes | Full template name, URL-encoded. |
Response
204 No Content, empty body. The spec documents 200 with {code}; that is what the admin console route (DELETE {{LEM_adminURL}}/admin/v1/template) returns.
Errors
| HTTP status | When it happens |
|---|---|
401 Unauthorized |
Missing or invalid X-AuthToken. |
404 Not Found |
Template <name> not found. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Response
Status: 204 No Content
Get template content by name
GET {{LEM_URL}}/api/v1/template/content?templateName=
Get template content by name
Returns the stored content of a configuration template by name.
Endpoint
GET {{LEM_URL}}/api/v1/template/content
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Parameters |
| templateName | query | Required. The template name. |
Response
TemplateContent (the template payload and metadata).
Errors
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
List Solution Template Parameters
GET {{LEM_URL}}/api/v1/template/list-variables/v2?templateName={{template_name}}
New in 3.0.
List Solution Template Parameters
Lists the parameters declared inside a Solution Template document (version 2.0.0 templates), by scope: _global first, then components alphabetically.
This is a different parameterization mechanism, not a successor to List all Variables of Template (GET /template/list-variables): that call serves the LEM-side .params / .vars variables of a 1.x template, and answers 400 for a Solution Template (... is a Solution Template (version 2.0.0). It has no template variables - its parameters are declared in the template document itself. Use GET /template/list-variables/v2 instead.).
Endpoint
GET {{LEM_URL}}/api/v1/template/list-variables/v2?templateName=<name>
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Parameters |
| Parameter | In | Notes |
|---|---|---|
templateName |
query | Required. Full template name from Templates List. An unknown name answers 404. |
Response
200 OK. Scope -> list of {UniqueName, Description, DataType, DefaultValue}, where DataType is STRING, INTEGER, FLOAT or BOOLEAN. A Solution Template that declares no parameters answers {}.
{
"_global": [
{ "UniqueName": "siteId", "Description": "Site identifier", "DataType": "STRING", "DefaultValue": "SITE-XX" }
]
}
Errors
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Get Template Composition (v2)
GET {{LEM_URL}}/api/v1/template/composition/v2?projectId={{project_id}}&deviceId={{deviceID}}
New in 2.35.
Get Template Composition (v2)
Returns what a template created from this device would contain, per section, using the device's config API (Solution Template, version 2.0.0). Use it to choose creationOptions for Create Template (v2). The 1.x counterpart is Template Composition.
Endpoint
GET {{LEM_URL}}/api/v1/template/composition/v2?projectId={{project_id}}&deviceId={{deviceID}}
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Parameters |
| Parameter | In | Notes |
|---|---|---|
projectId |
query | Required. |
deviceId |
query | Required. The source device; it must be online. |
Response
200 OK. version plus one entry per section the device can contribute: devices (DeviceHub devices), connectors, flows, analyticsGroups, marketplace, opcua and dm (device-management settings such as DNS, NTP, firewall and proxy).
Errors
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Response
Status: 200 OK
{
"version": "2.0.0",
"devices": [
{
"id": "4035FB84-0F79-4C99-BE6C-2EAB5B559517",
"name": "gen"
},
{
"id": "E8BE239F-E294-4AD1-9BCB-BBED2C347694",
"name": "mqtt-broker"
}
],
"opcua": [
{
"type": "FOLDER",
"name": "EdgeDevice"
},
{
"type": "CONFIG",
"name": "Users"
},
{
"type": "CONFIG",
"name": "Modes"
},
{
"type": "CONFIG",
"name": "Policies"
},
{
"type": "CONFIG",
"name": "Enabled"
},
{
"type": "CONFIG",
"name": "Certificates"
}
],
"connectors": [
{
"id": "68b6bd49-9f2c-4bd7-8a34-6a3074580690",
"name": "mqtt-client",
"provider": "0e04a6f5-dc0c-4bd8-84b9-dc2b1b74b110"
}
],
"dm": {
"dns": false,
"ntp": false,
"country": false,
"timezone": false,
"dockerConfig": false,
"firewall": {},
"proxy": {
"components": [
{
"name": "loopedge-dm"
},
{
"name": "loopedge-auth"
},
{
"name": "loopedge-licensing"
}
]
}
},
"auth": {},
"marketplace": {
"registries": [
{
"id": "07d29bd5-4350-441b-83f2-13c65a3c5d02",
"name": "Sales Enablement"
},
{
"id": "3881faf8-41c7-481c-a775-c41613a5f697",
"name": "GCR Solutions Prod Read Only"
},
{
"id": "3a54d877-daf0-4773-bd55-926be98ad79b",
"name": "Public docker hub"
},
{
"id": "51421393-88cf-4587-b3f3-3526c14cf56f",
"name": "Public Solutions"
},
{
"id": "5b80d18e-7520-4519-a561-25e04d21c48b",
"name": "Public Docker Hub"
},
{
"id": "619022b2-2144-4bd0-9d24-18c0be55d158",
"name": "Microsoft Docker Container registry"
},
{
"id": "694a9804-4a20-4d61-bbef-c5c72e969a94",
"name": "Elastic public docker registry"
},
{
"id": "7b61a0a6-6229-4d12-8890-58abc6ce2499",
"name": "Solutions Prod"
}
]
},
"analytics": {
"groups": [
"default"
]
},
"digitalTwin": {
"models": [
{
"id": "32d1eb72-433d-42ba-913e-d40ffcac6331",
"name": "Machine_Data"
}
]
},
"cloudStorage": {},
"sysinfo": {
"labels": true
}
}
Create Template (v2)
POST {{LEM_URL}}/api/v1/template/create/v2
New in 2.35.
Create Template (v2)
Creates a Solution Template (version 2.0.0) from a device's current configuration, using the device's config API. The 1.x counterpart is Create Template.
Endpoint
POST {{LEM_URL}}/api/v1/template/create/v2
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Request body |
| Field | Type | Notes |
|---|---|---|
deviceId |
string | Required. Source device. |
friendlyName |
string | Required. Display name. |
creationOptions |
object | Required. Which parts of the composition to include; see Get Template Composition (v2). |
templateDescription |
string | Optional. |
userEncryptionKey |
string | Optional. Encrypts the template; the same key is needed to apply it. |
{
"deviceId": "{{deviceID}}",
"friendlyName": "Siemens S7-1500 Base",
"templateDescription": "Line 1 baseline",
"creationOptions": {}
}
Response
200 OK. {"code": "...", "message": "...", "messageDetails": "..."}. Not exercised against a live device by these docs yet.
Errors
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Request Body
{
"deviceId": "deviceId",
"templateDescription": "Description",
"friendlyName": "Siemens S7-1500 Base",
"creationOptions": {},
"userEncryptionKey": "mySecretKey"
}
Preview Template Apply
POST {{LEM_URL}}/api/v1/template/preview
New in 3.0.
Preview Template Apply
Reports what applying a template to one device would change, without changing it. Needs LitmusEdge 4.3.0 or later on the device: LEM saves the resolved document on the device as a transient template, asks the device to plan the apply, and deletes the transient again.
Give parameter values keyed by scope in parameters for a Solution Template, or flat in values for a LEM-parameterized 1.x template, never both.
Endpoint
POST {{LEM_URL}}/api/v1/template/preview
Authentication
API key in a request header (case sensitive). The value is the LEM admin API token.
| URL prefix | Auth header |
|---|---|
{{LEM_URL}}/api/v1/... (main fleet API) |
X-AuthToken: <token> |
{{LEM_adminURL}}/admin/v1/... (admin console, port 8446) |
X-AuthToken: <token> |
{{LEM_URL}}/mpcs/... (Marketplace Catalog) |
Authorization: <token> (3.0.x also accepts X-AuthToken) |
| ## Request body |
| Field | Type | Notes |
|---|---|---|
templateName |
string | Template to preview. |
deviceId |
string | Target device. |
mode |
string | Apply mode to preview: LEGACY, USE or MERGE. |
parameters |
object | Solution Template parameter values, scope -> list of {UniqueName, UserValue}. |
values |
object | 1.x template variable values, {name: value}. |
{
"templateName": "{{company_name}}/default/default/COMPANY/1791836046753",
"deviceId": "{{deviceID}}",
"mode": "MERGE",
"parameters": {
"_global": [{ "UniqueName": "siteId", "UserValue": "NYC-01" }]
}
}
Response
200 OK:
| Field | Meaning |
|---|---|
conflicts |
Changes that would overwrite existing device configuration ({section, path, id, name}). |
additions |
Changes that would add new configuration. |
kept |
Configuration the apply would leave alone. |
sections |
Template sections the apply would touch. |
resetRequested |
Components a USE apply would reset first. |
components |
Per component: name, participating, reason. |
note |
Remark from the device. |
Errors carry a machine-readable code:
| Status | When |
|---|---|
400 |
The device does not support preview, values and parameters were both given, or a parameter scope or name is unknown. |
409 |
confirm_required, plan_stale, plan_not_found or snapshot_protected, or the upload session was lost to a concurrent template operation. |
429 |
preview_busy: another template operation holds the device. Retry. |
Not exercised against a live device by these docs yet.
Errors
| HTTP status | When it happens |
|---|---|
400 Bad Request |
Missing or malformed query/body parameter. |
401 Unauthorized |
Missing or invalid credentials. |
403 Forbidden |
Token lacks permission for this operation. |
404 Not Found |
Target entity does not exist. |
5xx |
Service is unreachable, restarting, or internally errored. Inspect device logs under System > Support. |
TLS note: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.
Request Body
{
"templateName": "Google/project1/1756123456789",
"deviceId": "d1",
"mode": "LEGACY",
"parameters": {},
"values": {}
}