Magistrala
User-guide

Personal Access Tokens

Manage access tokens and scopes securely

Overview

Personal access tokens are an alternative to using bearer tokens to perform various operations on the entities. To access personal access tokens (PATs) click on Personal Access Token tab on the user profile picture or avatar at the top right.

User Popover

Create a PAT

To create a PAT, click on the + Create PAT button.

Pat Table

This action redirects the user to the PAT creation page, where required details can be provided. The name should be a recognizable label for the token, and the duration sets the period for which the token will remain valid. Additionally, the user can enter an optional description and define scopes, which specify the operations the PAT is allowed to perform. Each PAT can be restricted to specific operations on particular entities, providing fine-grained access control.

Create Pat

Available scope entities are Clients, Channels, Groups, Workspace, Rules, Reports, and Bootstrap. Each entity type exposes a distinct set of operations:

Clients

The scope entity is still labeled Clients in the PAT scope selector even though this same entity is called Device elsewhere in the product — the rename hasn't reached this part of the UI yet.

OperationDescription
createCreates a client
viewView a client
updateUpdate client information
update_tagsUpdate client tags
update_secretUpdate client secret/credentials
enableEnable a client
disableDisable a client
deleteDelete a client
set_parent_groupAssign a parent group to a client
remove_parent_groupRemove the parent group from a client
connect_to_channelConnect a client to a channel
disconnect_from_channelDisconnect a client from a channel

Channels

OperationDescription
createCreates a channel
viewView a channel
updateUpdate channel information
update_tagsUpdate channel tags
enableEnable a channel
disableDisable a channel
deleteDelete a channel
set_parent_groupAssign a parent group to a channel
remove_parent_groupRemove the parent group from a channel
connect_clientConnect a client to the channel
disconnect_clientDisconnect a client from the channel

Groups

OperationDescription
createCreates a group
viewView a group
updateUpdate group information
update_tagsUpdate group tags
enableEnable a group
disableDisable a group
deleteDelete a group
retrieve_group_hierarchyRetrieve the group hierarchy
add_parent_groupAssign a parent group
remove_parent_groupRemove the parent group
add_children_groupsAdd child groups
remove_children_groupsRemove specific child groups
remove_all_children_groupsRemove all child groups
list_children_groupsList child groups
set_child_clientAssign a client as a child of the group
remove_child_clientRemove a client from the group
set_child_channelAssign a channel as a child of the group
remove_child_channelRemove a channel from the group

Workspace

The Workspace entity scope is automatically locked to the current workspace.

OperationDescription
updateUpdate workspace information
readRead workspace details
enableEnable the workspace
disableDisable the workspace
listList workspaces
send_invitationSend a workspace invitation
list_invitationList invitations sent by the user
list_workspace_invitationList all invitations for the workspace
delete_invitationDelete a workspace invitation
create_clientsCreate clients within the workspace
list_clientsList clients in the workspace
create_channelsCreate channels within the workspace
list_channelsList channels in the workspace
create_groupsCreate groups within the workspace
list_groupsList groups in the workspace

There's no create operation here — a Workspace-scoped PAT is always locked to a workspace that already exists, so it can't be used to create a new one.

Rules

OperationDescription
createCreate a rule
listList rules
viewView a rule
updateUpdate rule configuration
update_tagsUpdate rule tags
update_scheduleUpdate rule schedule
enableEnable a rule
disableDisable a rule
deleteDelete a rule
alarm_assignAssign an alarm to a user
alarm_acknowledgeAcknowledge an alarm
alarm_resolveResolve an alarm

Note: Alarm-related permissions apply to all alarms linked to the selected rules.

Reports

OperationDescription
createCreate a report
listList reports
generateGenerate a report
viewView a report
updateUpdate report configuration
update_scheduleUpdate report schedule
enableEnable a report
disableDisable a report
deleteDelete a report
update_templateUpdate the report template
view_templateView the report template
delete_templateDelete the report template

Bootstrap

OperationDescription
createCreate a Bootstrap configuration
viewView a Bootstrap configuration
updateUpdate a Bootstrap configuration
deleteDelete a Bootstrap configuration
enableEnable a Bootstrap configuration
disableDisable a Bootstrap configuration
create_profileCreate a Bootstrap profile
view_profileView a Bootstrap profile
update_profileUpdate a Bootstrap profile
delete_profileDelete a Bootstrap profile

View a PAT

After a PAT is created, the user is redirected to the PAT detail page. Alternatively, the user can view an existing PAT by clicking on the row or the View button in the row actions.

Upon creation, the PAT secret is displayed once, allowing the user to copy it. This secret will not be shown again once the page is reloaded.

Pat Id

Manage scopes

Add a scope

To add a new scope to an existing PAT, the user can click the Add Scope button. This allows the user to define additional permissions for the token.

Add Scope

Delete a scope

The user can delete a specific scope from a PAT by clicking the trash icon in the scopes table. To remove all scopes associated with a PAT, the user can click the Delete All button.

Manage Scopes

Revoke a PAT

To revoke a PAT, click on the Revoke button located in the status row of the PAT detail page.
Once a PAT is revoked, it becomes inactive and can no longer be used to perform any of the scoped operations.

Revoke Pats

Regenerate a PAT

After revocation, the user can regenerate the PAT by clicking the Regenerate button. A dialog will appear, allowing the user to select a new validity duration. This creates a new secret while preserving all other PAT details such as the name, description, and scopes.

Regenerate Pat

Expired tokens can also be regenerated. To do this, the user should navigate to the PATs page and change the status filter to Expired to view all expired tokens.

Expired Pat

The user must then click on the expired PAT to view its details, and from there, click the Regenerate button. A dialog will appear, allowing the user to select a new duration. This process reactivates the PAT and generates a new secret, while maintaining the original configuration.

Delete a PAT

The user can delete an individual PAT by clicking Delete in the row actions.

Delete Pat

To remove all PATs, the user can click the Delete All button located on the PATs table.

On this page