Add devices from your own code with the REST API
If devices are created by your own tooling (a provisioning workflow, a self-service portal, a build pipeline), rConfig should be told in the same step. The REST API creates, updates and removes devices with the same fields and the same checks as the device form, so your tooling can keep rConfig current without anyone opening the UI.
If this is you
- A new device already goes through your own workflow before it reaches the network, and you want rConfig added to that workflow.
- You’re building your own sync from a system rConfig has no driver for. If that system can only export files, the file feed page shows the same pattern built around an export.
- You need more control than a one-off import gives: updates, removals, your own naming and tagging rules.
The recommended route
Use v1 POST /devices to create, PUT /devices/{id} to update and v2 POST /devices/{id}/disable to take a device out of service without losing its history. Authenticate with an apitoken header from a token owned by a service account, with only the abilities it needs (devices.read and devices.write for inventory work). The API & Developer guides cover tokens, paging and how the API behaves.
Uplink guideChoose the right way into rConfigREST API, webhooks, MCP, API Collections, SIE, Custom Commands and Workflows compared: who builds each, where it runs and when to use it.Read the guide
Uplink guideAPI tokens and least privilegeHow rConfig REST API tokens are scoped by abilities and by their owner's role, and how to give each integration only the access it needs.Read the guide
What happens when you create a device
- The request is checked with the same rules as the device form: a unique name of at least 5 characters with no spaces, a valid IP address or hostname, and a vendor, model, template, command group (with at least one command), tags, main prompt and roles.
- rConfig queues a first backup straight away, so a wrong template or credential shows up within minutes.
- Unlike a device added in the UI, a device created through the API isn’t proposed to a Central Manager. In multi-region Vector, add devices through the Central Manager instead.
Decisions to make first
- Defaults: decide the template, command group, credential set and tags your code gives each kind of device. Reading them from a device profile keeps them in one place.
- Ownership: tag the devices your code creates, and only let it change those.
- Credentials in responses: v2 device responses include credentials unless you pass
with_credentials=false, or the server setsMASK_DEVICE_CREDENTIALS. Ask only for what your code needs.
How to know it worked
Each create returns the new device’s ID. Check that device’s first backup a few minutes later, through the API or the UI.