Device Templates
Global signal maps and command vocabularies
List device templates (global catalog)
Query Parameters
Filter templates by assignment level (PLANT or SUB_DEVICE).
"PLANT" | "SUB_DEVICE"Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://loading/api/v1/device-templates"{
"actions": [
{}
],
"createdAt": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"isSystem": true,
"level": "PLANT",
"name": "string",
"signals": [
{}
],
"type": "CABINET",
"updatedAt": "2019-08-24T14:15:22Z",
"version": 0
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Invalid query parameter (e.g. unknown level value)",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden — writes require super-admin",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Create a device template (super-admin only)
Request Body
application/json
Command action vocabulary with typed params
"SUB_DEVICE""PLANT" | "SUB_DEVICE"Template display name
1 <= length <= 120Signal definitions — binary (with bit) or numeric (with field)
"CABINET" | "METER" | "INVERTER" | "BATTERY"Template version
11 <= valueResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://loading/api/v1/device-templates" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "signals": [ {} ], "type": "CABINET" }'{
"actions": [
{}
],
"createdAt": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"isSystem": true,
"level": "PLANT",
"name": "string",
"signals": [
{}
],
"type": "CABINET",
"updatedAt": "2019-08-24T14:15:22Z",
"version": 0
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Invalid signal or action definitions",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden — writes require super-admin",
"statusCode": 400
}{
"code": "CONFLICT",
"details": {},
"error": "Conflict",
"message": "Template name + version already exists",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Get a device template by ID
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://loading/api/v1/device-templates/string"{
"actions": [
{}
],
"createdAt": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"isSystem": true,
"level": "PLANT",
"name": "string",
"signals": [
{}
],
"type": "CABINET",
"updatedAt": "2019-08-24T14:15:22Z",
"version": 0
}{
"code": "INVALID_UUID",
"details": {},
"error": "Bad Request",
"message": "Invalid UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "FORBIDDEN",
"details": {},
"error": "Forbidden",
"message": "Forbidden — writes require super-admin",
"statusCode": 400
}{
"code": "DEVICE_TEMPLATE_NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Template not found",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Update a device template (super-admin only; editing signals bumps version)
Path Parameters
Request Body
application/json
1 <= length <= 120Signal definitions — editing signals bumps version
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://loading/api/v1/device-templates/string" \ -H "Content-Type: application/json" \ -d '{}'{
"actions": [
{}
],
"createdAt": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"isSystem": true,
"level": "PLANT",
"name": "string",
"signals": [
{}
],
"type": "CABINET",
"updatedAt": "2019-08-24T14:15:22Z",
"version": 0
}{
"code": "VALIDATION_ERROR",
"details": {},
"error": "Bad Request",
"message": "Invalid UUID or payload",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "DEVICE_TEMPLATE_SYSTEM_READONLY",
"details": {},
"error": "Forbidden",
"message": "System templates are read-only",
"statusCode": 400
}{
"code": "DEVICE_TEMPLATE_NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Template not found",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}Delete a device template (super-admin only; blocked when in use)
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://loading/api/v1/device-templates/string"{
"message": "string"
}{
"code": "INVALID_UUID",
"details": {},
"error": "Bad Request",
"message": "Invalid UUID",
"statusCode": 400
}{
"code": "UNAUTHORIZED",
"details": {},
"error": "Unauthorized",
"message": "Unauthorized",
"statusCode": 400
}{
"code": "DEVICE_TEMPLATE_SYSTEM_READONLY",
"details": {},
"error": "Forbidden",
"message": "System templates are read-only",
"statusCode": 400
}{
"code": "DEVICE_TEMPLATE_NOT_FOUND",
"details": {},
"error": "Not Found",
"message": "Template not found",
"statusCode": 400
}{
"code": "DEVICE_TEMPLATE_IN_USE",
"details": {},
"error": "Conflict",
"message": "Template is referenced by one or more sub-devices",
"statusCode": 400
}{
"code": "INTERNAL_SERVER_ERROR",
"details": {},
"error": "Internal Server Error",
"message": "Internal server error",
"statusCode": 400
}