Skip to content

Platform

Auto Provision

Let a product create its devices when they first connect or are first called, with an ID pattern, an asset type, an asset group and a project.

Feature2 min read

The Auto Provision card of a product profile creates devices on their own. You set a pattern for the device ID; when a device that does not exist yet reaches the platform with an ID that matches it, the platform creates the device in the product, with the asset type, the asset group and the project you choose.

When to use it ​

  • To deploy a fleet without creating each device by hand: flash the same firmware with a different ID on each unit.
  • To accept the devices that a gateway, a network server or an external system starts sending.

To compare Auto Provision with adding devices by hand and with claims, which hand your devices to other accounts, see Provisioning. Claims are configured in Toolbox > Claims.

How a device is created ​

A rule applies when a device that does not exist tries to authenticate, or when a device resource of the product is called for a device that does not exist, and its ID matches the Device Pattern. The new device belongs to the product, so it gets its properties, Data Buckets, API resources and dashboard at once. What starts the creation depends on the device type: see Provisioning. An IOTMP or MQTT device is refused on that first connection and is accepted when it reconnects; an HTTP device is created by its first request, which then goes through.

IOTMP AND MQTT DEVICESHTTP AND SUBDEVICESDevicenot created yetThinger.io serveryour accountProductAuto Provision rule1 · connects as meter_0001232 · refused: unknown device3 · ID matches the pattern?^meter_[0-9]{6}$4 · creates the devicein the product, with assettype, group and projectand the credentials it sent5 · connects again6 · accepted1 · first requestto the device callback2 · ID matchesthe device is createdin the product3 · request goes onno retry neededA subdevice is created whena product flow receivesits first message.
Auto Provision on first connection

Add an Auto Provision rule ​

YOUR_SERVER is iot.thinger.io on the free Cloud account, or the domain of your private instance. YOUR_PRODUCT is the product ID.

Console

  1. Open the Auto Provision card

    Open the product on its Profile tab and click Add in the Auto Provision card. Set the Provision Identifier.

  2. Set the pattern

    On Auto Provision, leave the Provisioning Mode in Device Pattern and type the Device Pattern, a regular expression such as ^meter_[0-9]{6}$. Optionally, choose the Device Type (asset type), the Device Group (asset group) and the Project of the new devices.

    Auto Provision modal of the meter product with the device pattern ^meter_[0-9]{3}$, the energy_meter asset type and the madrid_plant asset group
    Auto Provision rule of a product
  3. Save it

    On Settings, set the Name and Description that new devices get, leave Enabled on and click Save.

API

PUT/v1/users/{user}/products/{product}/profile/{category}/{resource}API reference
bash
curl -X PUT "https://YOUR_SERVER/v1/users/YOUR_USER/products/YOUR_PRODUCT/profile/autoprovisions/meters" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "config": {
      "mode": "pattern",
      "pattern": "^meter_[0-9]{6}$",
      "type": "meter",
      "group": "plant_a"
    }
  }'

config.project adds the new devices to a project.

CLI

The CLI cannot edit profile entries. Include them in the profile.autoprovisions of the document you pass to thinger product create YOUR_PRODUCT --from product.json.

AI

Ask your AI agent

Make the product YOUR_PRODUCT create any device whose ID is meter_ followed by six digits, in the asset type meter and the group plant_a.

The agent uses thinger_resource_create with the product_profile_autoprovision type. See MCP tools.

Limits ​

  • The pattern is a regular expression on the device ID. Anchor it with ^ and $, and keep it narrow: any ID that matches creates a device in your account.
  • A device created this way counts like any other device: see Plans and limits.
  • A rule only works while it and the product are enabled. Disabling it does not remove the devices it created.