Before you begin
You need:- An access token. See the quickstart.
- A service account whose role allows Get device and point templating and Manage device and point templating. Get covers discovery and reading operations. Manage covers validate, apply, and clear, including a dry run.
- The
buildingIdof the building, from List buildings. - The ids of the devices to template, from List building devices. Devices in that list carry
_id.
Look up the ontology
The ontology endpoints do not depend on a building. They return the same catalog for your whole organization.1
List canonical types
Call List canonical types and pick the type that fits your devices.Send a canonical type exactly as listed. Values are case-sensitive, so
Ahu does not match ahu.2
List the fields of the type
Call List fields for a canonical type. Add For each field, read:
unitSystem=METRIC for metric units. The default is IMPERIAL.field: The identifier you send asfieldin a mapping.supportedKinds: The point kinds the field can take, fromNumber,Str, andBool. A field applies only to points of a supported kind.unit: The unitsymbolandcategory. A unit override must be in this category.requiredEnumsandoptionalEnums: The values aBoolorStrpoint can map to.displayName: The name the points get. A{{prefix}}or{{suffix}}in it is replaced with the instance number when a device has more than one point with the field.
kind to filter by point kind, and q to search by field identifier.3
List units, if you override a unit
A mapping can override the unit of a field. Call List units by category and choose a unit from the same category as the field’s
unit.category.4
List connections, if you link devices
Templating does not use connections. You need them when you link devices that you template. List connection keys returns every key. List connections for a canonical type returns the connections a device of one type can have, with
type set to INPUT or OUTPUT, whether it accepts several devices in multi, and the canonical types allowed on the other end. A row’s key, multi, and type are the relationship of a device reference.Template points
1
Discover the point groups
Send the devices to Discover templating point groups. Select 1 to 2,000 devices. Template devices of one canonical type together.A group holds the points of the selected devices that share a connector name, kind, writable flag, and unit (for
Number points) or enum values (for Bool and Str points). Virtual and metadata points are not grouped. For each group, read:groupKey: The key you send in a mapping.name,kind,writable,unitSymbol, andpointEnum: The values that define the group.pointsCount: How many points the group holds.templateStatus:NOT_TEMPLATEDorTEMPLATED.enumStatus:N_A,UNMAPPED,PARTIALLY_MAPPED, orMAPPED.N_Ameans the group has no enum to map.currentFields: The fields already applied, with a point count for each.
templateStatuses, kinds, and enumStatuses in the body, and with q on the connector name.2
Drill into a group
To review a group, or to pick single points, call List points in a point group. Send the Each point shows the device it belongs to, the
groupKey and the same deviceIds. Repeat the deviceIds parameter for each device.field it carries now, and its enumStatus. A groupKey that does not match a group of those devices returns 400.3
Build the plan
A plan names the Each mapping has:
canonicalType, the deviceIds, and one mapping for each group or set of points you want to change.match: Send exactly one ofgroupKey, a tuple (name,kind,unitSymbol,writable,pointEnum), orpointIds. A point-level mapping takes precedence over a group mapping that covers the same point.field: Afieldfrom the ontology, and a kind that fits the points.overrides: Optional.displayName,unit,precision,covTolerance,defaultInGraph,prefix,suffix, anddataIntervalreplace the field’s defaults. Withoutprefixandsuffix, the server numbers repeated fields on a device.enumMapping: Optional, forBoolandStrpoints. WithSET,readMappairs each of the point’s own labels (from) with an enum value of the field (to). AwriteMappairs the other way and is accepted only for writable points.UNSETremoves both maps.KEEPis the default and leaves them as they are.
4
Validate the plan
Post the plan to Apply a templating plan with The response holds
validateOnly set to true. Nothing is written.validationReport:valid:truewhen no issue hasERRORseverity.summary:matchedPointsanddevicesAffectedshow how many points and devices the apply would change. Check these numbers before you continue.errorsandwarningscount the issues.mappings[]: The outcome of each mapping, in the order you sent them.statusisOK,WARNING, orERROR.issues: Findings about the whole plan.unmappedGroups: Groups of your devices that no mapping covers.etag: A fingerprint of the resolved plan. Keep it for the next step.
code, a pointer into your request, and a message. Fix every ERROR and validate again until valid is true. Warnings do not stop an apply. Common issues:5
Apply the plan
Send the same body with The response holds
validateOnly removed, and add the etag from the report:operation. Keep the last segment of operation.name as the operationId.- Only
validateOnly: truemakes a dry run. If you leavevalidateOnlyout, the call starts a real run. - The
requestIdis unique per building. If your request times out, send it again with the samerequestIdand body. The API returns the operation it already started instead of starting a second one. A different body with the samerequestIdreturns400. - If the plan changed since you validated it, the
etagno longer matches and the call returns400. Validate again to get a newetag. - The API does not stop two runs from touching the same points. The last write wins.
6
Track the operation
Call Get a templating operation every few seconds until This response is the operation itself. It is not wrapped in
done is true.operation. Read metadata.state:Use
done, not progress, to detect that a run is finished. After SUCCEEDED, graphics, device references, and device linking keep updating in the background, so they can lag behind the point data for a short time. Add fields=done,metadata to return less data while you poll.7
Clear the templating
To remove the templating from points, call Clear a templating plan. It takes the same body as apply, including
requestId, etag, and validateOnly. A clear mapping needs only match.- With
mappings, only the points the mappings match are cleared. - Without
mappings, or with an empty list, every point templated undercanonicalTypeon the selected devices is cleared. Validate first.summary.matchedPointsandsummary.devicesAffectedshow how many points and devices a real clear reaches.
validateOnly, and track the operation as before.What apply and clear change
Both calls change stored point and device data. They do not send values to the equipment.
Some things apply and clear leave alone:
- Virtual points. Apply does not create, change, or template virtual points, and the point groups do not list them.
- Points on platform-managed connectors.
- The point’s value, its connector, and the write commands it accepts. Clear does not remove the
dataIntervalthat apply set. - Any point that the plan does not match.
SUCCEEDED.
Limits
Templating requests also count toward your rate limits.

