Magistrala
User-guideDevice Management

Devices

Manage devices and connections

A Device in Magistrala can be either a physical device or an application that publishes or subscribes to messages.

Create a Device

To create a device, click on the Create button. You can also create multiple devices at once by clicking on the Upload button and uploading a .csv file with device names and any other fields you would like to add.

Create device

Device Information

Each device requires a name.
You may also add an optional key (must be unique), tags, and metadata.

Device information

The device key is used to authorize the device when sending messages.

Bulk Creation

Devices can be created in bulk using a .csv file with the following fields (in order):

  1. Name (Required)
  2. Secret
  3. Tags
  4. Metadata

A sample devices CSV file is available.

Bulk create devices

View a Device

After creation, devices are listed in the Devices table.
Click a row (or the View button in the row actions) to open the device’s configuration page.

View device

Configurations

The device configuration page has two tabs: Configuration and Metadata.

Configuration Tab

The Configuration tab displays key details about a device and allows you to edit core properties:

Editable Fields:

  • Name – Device identifier
  • Device Key – Authorization key for message sending. The key is hidden by default; click the eye icon to reveal it.
  • Tags – Keywords for organization (press Enter after each tag to confirm)
  • Status – Enable or disable the device using the toggle switch

View-Only Fields:

  • ID – Unique device identifier
  • Metadata – View existing metadata in JSON format (managed in the Metadata tab)

To update a field, click the pencil icon next to it. Once you have updated the value, click the check icon to save changes or the cross icon to cancel.

Device Configuration

Metadata Tab

The Metadata tab allows you to add, view, and manage additional information for the device. Metadata supports various value types including text, numbers, booleans, JSON objects, locations, and perimeters.

For detailed instructions on managing metadata, including working with interactive maps for location and perimeter data, see the Metadata Management Guide.

Device Metadata

Connect to a Channel

Navigate to the Connections tab of the device sidebar to see connected channels.

Connections page

In this page you are able to add a connection by clicking on the Connect button on the top right corner.

A dialog will open where you can select channels and connection types. A device can have both connection types selected.
There are two connection type options:

  1. Publish: allows the device to send messages in the channel
  2. Subscribe: allows the device to read messages in the channel

Connect channel

To disconnect from the channel, click on the Disconnect button at the end of the channel row.

Disconnect channel button

This will open up a dialog that allows you to select which connection type you want to remove. You can remove one or both of the connection types if you have multiple.

Disconnect channel dialog

Device Roles

Roles define a set of actions that can be allocated to users. The Roles table lists each role's Name, Created By, Created At, Updated By and Updated At.

To create a role, navigate to the Roles tab on the device sidebar. Click on the Create button and provide a role name. The actions and members are optional fields.

Create device role

Role Information

Device role information

The Role name is compulsory. You can optionally provide the role actions by selecting from the available actions. You can also optionally provide the members by searching for a user with their username.

The following is the list of available actions for a device:

  • read
  • write
  • delete
  • role.manage
  • policy.manage

Update Device Roles

Click a role in the Roles table to open its page. The page shows the role's Name and ID, its Permissions (the selected actions, with buttons to add or remove actions), and an Assignments table of the members currently holding the role.

To update a role name, click on the pencil icon on the far right end of the field, update the value then click on the check icon to update the changes or the cross icon to cancel the changes.

Update role name

To update the role's Permissions, use the Add actions / Remove actions buttons to open a dialog box allowing you to select the actions you want to add or remove.

Update role actions

To update the Assignments, click the Add Members button. A popup dialog will appear with the list of Workspace Members from which a user can select.

Update role members

Delete Device Roles

You can also delete actions and members by clicking on the trash icon. It pops up a dialog that allows you to select which action you want to remove. There is also an option for clearing the whole list if that is needed as well.

Delete role actions

When it comes to Assignments, you can clear the whole table with the Delete All Members which will lead to this alert dialog:

Delete All Role Members

To delete specific members from the Assignments table, click on the trash icon.

Delete role members

Device Members

While we can create new members from the Roles section alongside the new roles actions, we can also assign members to the device through the Members Section.

Clicking on the Assign Member button will open a dialog box that allows the user to select amongst the Workspace Members present as well as the Roles present in the Device.

Assign Members

Device Alarms

Enterprise Edition

This section requires the Alarms service, which is part of Magistrala Enterprise Edition (EE). See the Alarms documentation for details.

The Alarms section displays all alarms triggered by this specific device. This provides a focused view of alerts related to the device's activity and helps with targeted troubleshooting.

From this page, you can perform all standard alarm management actions:

  • View alarm details
  • Assign alarms to team members
  • Acknowledge alarms
  • Clear/resolve alarms
  • Delete alarms

For detailed instructions on managing alarms, see the Alarms documentation.

Device Alarms

Journals

The Journals tab (formerly named Audit Logs) tracks all device-related events, including creation, updates, disabling, connectivity and role changes

Each log entry displays the operation, an Occured At timestamp, and optional details for deeper inspection.

You can search logs by operation type using the search input above the log table.

The most recent operations—such as entity.create, credential.create, and entity.update—are displayed at the top.

Device Audit Logs

Clicking on the ··· button at the end of each row opens a modal displaying structured details about the selected operation.

For most operations, the details modal shows an outcome field (e.g., "allow"), which is the access-control decision for that action.

This enables users to trace changes, audit security, and diagnose issues efficiently.

View Device Audit Log Actions

Delete a Device

To delete a device, click the Delete button in the row actions of the devices table, or from the device view page.

A confirmation dialog appears asking you to type the device's name before deletion is finalized. Use the copy button to copy the name, paste it into the input field, then click Delete to permanently remove the device.

Delete Device

On this page