Create and update an Azure IoT Central device template via the REST API using PUT for creation

domain: iot · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Obtain an IoT Central API token or Azure AD bearer token — every REST API call requires an authorization header
  2. Author the device template body: a DTMI `@id` (e.g. `dtmi:contoso:mythermostattemplate;1`), `@type: ["ModelDefinition","DeviceModel"]`, `@context`, and a DTDL v2 `capabilityModel` defining telemetry, properties, and commands
  3. Create/publish the template with `PUT https://{appSubdomain}.azureiotcentral.com/api/deviceTemplates/{deviceTemplateId}?api-version=2022-07-31` — the `deviceTemplateId` in the URL must match the body's `@id`; this call is a create/upsert and IoT Central auto-generates default views
  4. To modify fields on an already-created template (e.g. adding a cloud property), send `PATCH` to the same `.../deviceTemplates/{deviceTemplateId}?api-version=2022-07-31` URL with only the changed fields — current docs specify PATCH, not PUT, for in-place edits
  5. Verify with `GET .../deviceTemplates/{deviceTemplateId}?api-version=2022-07-31`, and use `DELETE` on the same path to remove a template

Known gotchas

Related routes

Synchronize device configuration using Azure IoT Hub device twins and invoke direct methods
azure.microsoft.com · 6 steps · unrated
Roll out a firmware update to a device group using Azure Device Update for IoT Hub with automatic rollback on failure
learn.microsoft.com · 5 steps · unrated
Create and update work orders programmatically via UpKeep's REST API
onupkeep.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans