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.
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
Open the Auto Provision card
Open the product on its Profile tab and click Add in the Auto Provision card. Set the Provision Identifier.
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](/screenshots/products-auto-provision.webp)
Auto Provision rule of a product Save it
On Settings, set the Name and Description that new devices get, leave Enabled on and click Save.
API
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
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.