Skip to main content
Version: 3.0

API Authentication

Call the MaestroHub API from scripts and other systems with a personal access token or an OAuth2 client. Both give you a JWT bearer token.

Methods
Personal access tokens · OAuth2 clients
Header
Authorization: Bearer <token>
Checked on every call
Signature · expiry · revocation · scopes

MaestroHub provides two mechanisms for authenticating with the platform API programmatically: Personal Access Tokens (PATs) and OAuth2 Clients. Both methods issue standard JWT bearer tokens that can be used with any HTTP client or integration.

Which credential should I use?​

You want to…UseWho sets it up
Use an AI assistant (Claude Desktop, Cursor and others) yourselfSign in, or a personal access token through Connect an AI client in the profile menuYou
Run your own script against the APIA personal access tokenYou, from Profile → Security
Connect a shared system that must keep running when people change roles or leave (ERP, historian, CI pipeline, SIEM)An API client with the Client Credentials grant, given a roleAn administrator who can register API clients
Run an autonomous agent with an identity of its ownAn agent accountAn administrator

A personal access token always acts as you and can never do more than you can. An API client is a separate service identity: it does not depend on, or inherit, the access of the person who created it.

An agent account's token is capped twice: by the roles the agent holds, and by the scopes the token carries. A token is issued only with scopes, each one the agent has been granted (POST /api/v1/auth/agents/{agent_id}/scopes, then scopes on POST /api/v1/auth/agents/{agent_id}/tokens). An agent with no granted scopes can do nothing with a token, whatever its roles. A token issued before 3.0 without scopes is held to the scopes its agent has been granted.

Choosing an Authentication Method​

CriteriaPersonal Access TokensOAuth2 Clients
Best forAutomation scripts, external system integrations, single-user programmatic accessThird-party applications, service-to-service integrations, multi-user apps
IdentityAlways acts as the user who created the tokenActs as the person who signed in (Authorization Code), or as the client itself (Client Credentials). A Client Credentials client has no access until it is given a role, and never inherits its creator's access
SetupCreate from your Profile → Security tabRegister from Admin → Identity & Access → API Clients (Identity, Security or System Administrators)
Grant types-Authorization Code, Client Credentials, Refresh Token
User consentNot requiredRequired for Authorization Code flow
Secret managementToken shown once at creationClient secret shown once at creation (confidential clients)
Expiration30 days to 1 year (configurable)Access tokens have a configurable TTL; refresh tokens extend the session
RevocationRevoke individual tokens from your profileDisable or delete the client; revoke tokens via the OAuth2 revoke endpoint

How Tokens Are Used​

Both methods produce a JWT bearer token. Include it in the Authorization header of your API requests:

Authorization: Bearer <token>

The platform validates the token signature, checks expiration, verifies revocation status, and enforces the scopes embedded in the token.

Scopes cap what a token does​

A token does at most what its scopes allow, whatever the roles of the person or client it belongs to. A token created by an administrator is still refused anything its scopes do not grant, with 403 INSUFFICIENT_SCOPE over the REST API and SCOPE_DENIED over MCP. A signed-in session has no scopes and is not capped. This holds on every endpoint, including the ones that decide access inside the request:

What the token asksWhat it needs
Check another person's access (POST /api/v1/authz/check, MCP manage_access check)roles:read. Checking its own access needs no scope.
Explain another person's access (POST /api/v1/authz/explain)No scope grants it: only a signed-in session explains someone else's access. A token can explain its own.
Plan a share (POST /api/v1/dependencies/share-plan)No scope grants sharing, so a token is refused.
Remove people from a workspace (DELETE /api/v1/authz/workspaces/:id/members)workspaces:manage, and the token goes through the workspace administrator's rules even when its owner is a platform administrator: it cannot remove someone who holds a platform role. The members list marks who the token could remove.
List the people reaching a workspace through a platform role (in GET /api/v1/authz/workspaces/:id/members)users:read for their names. Without it the list gives only how many.
Accessible topics, stewarded branches (GET /api/v1/uns/topics/accessible, GET /api/v1/authz/stewarded-resources)uns:read, or the scope for the verb asked
Resolve an app by its slug (GET /api/v1/appstudio/apps/by-slug/:slug)apps:read

Workspace Context​

Everything in MaestroHub lives in a workspace, and an instance can hold several. Most API endpoints require an X-Workspace-ID header carrying the ID of the workspace the request targets. Without this header, the API cannot tell which workspace you mean and the request will fail.

Include it alongside the Authorization header in every request:

Authorization: Bearer <token>
X-Workspace-ID: <your-workspace-id>

Nothing is created outside a workspace. A request that would create a pipeline, a connection, a dashboard, a library panel or an app with no workspace, or a blank one, is refused with 400 WORKSPACE_REQUIRED, and the answer's remediation says what to send: send the workspace the resource belongs to in the X-Workspace-ID header (a person's session carries one; an agent or API-client token must name its workspace). An OAuth2 client is always registered in a workspace too: there is no platform-wide client.

Finding Your Workspace ID​

Navigate to Admin → Workspaces. Click the actions menu (⋯) on your workspace row and select Copy ID.

The Workspaces page is in the menu when your licence allows more than one workspace. Either way, the workspace Overview shows the start of the ID under the workspace's name; click it to copy the whole ID.

Workspaces page showing the actions menu with Copy ID option highlightedWorkspaces page showing the actions menu with Copy ID option highlighted

Available Scopes​

Both Personal Access Tokens and OAuth2 Clients use the same set of scopes to control what the bearer can do. The available scopes depend on your workspace's RBAC level:

RBAC LevelBehavior
NoneRBAC is off. Tokens carry no scopes and have the full access of the account that owns them.
Basic and AdvancedScopes are enforced: a token can do only what its scopes grant. You can grant a scope only when your role holds every action it covers, in each workspace the token is for.

When RBAC is enabled, the following scopes exist. The token dialog offers only the scopes your own role allows in the workspace, so you may see fewer.

GroupPermissionScopeGrants
PipelinesReadpipelines:readView pipelines, execution history, and node configurations
Writepipelines:writeCreate, edit, clone, and delete pipelines
Executepipelines:executeRun, test, retry, and cancel pipeline executions
ConnectorsReadconnectors:readView connections, functions, and their configurations
Writeconnectors:writeCreate, edit, and delete connections and functions
Executeconnectors:executeStart, stop, and test connections
FunctionsReadfunctions:readExecute read-effect functions (query telemetry, read tags, list data); no writes, no deletes
Writefunctions:writeExecute write-effect functions (send commands, publish, write tags)
Streamfunctions:streamExecute stream-effect functions (subscribe, tail, watch)
Discoverfunctions:discoverExecute discover-effect functions (browse namespaces, enumerate operations, list capabilities)
Deletefunctions:deleteExecute delete-effect functions (destructive: DROP, DELETE, retained-clear)
Invokefunctions:invokeExecute invoke-effect functions (fail-closed ceiling for unclassified function types)
UNSReaduns:readView UNS topics and their data, including live values
Writeuns:writeCreate, edit, and delete UNS topics
Publishuns:publishPublish and subscribe to UNS topics
AlertsAcknowledgealerts:ackSilence alerts on topics the caller can already see
DashboardsReaddashboards:readView UNS dashboards and widgets
Writedashboards:writeCreate, edit, and delete dashboards
Library PanelsReadlibrary_panels:readView reusable library panel definitions
Writelibrary_panels:writeCreate, edit, and delete reusable library panel definitions
WorkspacesReadworkspaces:readView workspace settings and details
Manageworkspaces:manageUpdate workspace settings and manage role assignments
Audit LogReadaudit_log:readView the audit trail, run queries, and stream integrity verification status
Exportaudit_log:exportBulk-export audit records in SIEM formats (NDJSON, CSV, CEF, ECS); the machine-to-machine surface a SIEM collector consumes
Apps (App Studio, in release 3.0 as Beta, a paid add-on)Readapps:readView App Studio apps and their versions
Writeapps:writeCreate, edit, and delete App Studio apps
Runapps:runOpen and run published App Studio apps
Publishapps:publishActivate app versions for the workspace's viewers
MonitoringReadmonitoring:readQuery platform metrics and metric names
ApprovalsReadapprovals:readView pending and decided pipeline approvals
Decideapprovals:decideApprove or reject pending pipeline approvals; the pipeline then continues or stops
Entities (Knowledge Graph, coming soon, not part of release 3.0)Readentities:readView entities, their relationships, bindings and computed status
Writeentities:writeCreate, edit, relate, archive and restore entities; record what happens to them and declare their state
Recordentities:recordRecord what happened to things in the plant's log: rejects, lab results, fills, changeovers
Declare stateentities:declareDeclare what a thing is doing (maintenance, changeover, stopped); it and everything under it stop alarming
Entity Types (Knowledge Graph, coming soon, not part of release 3.0)Readentity_types:readView entity types, their properties, allowances and version history
Writeentity_types:writeCreate, edit and delete entity types; bump versions; archive and restore
SemanticsReadsemantics:readView semantic libraries and their properties, the meanings bound to topics and the validation rules of the topic tree
Writesemantics:writeCreate, edit and retire semantic libraries and properties; draft, edit and retire the meanings bound to topics (a person applies them)
Read (replaced by semantics:read)data_schemas:readReplaced in 3.0 by semantics:read, which it grants: data schemas became the semantic layer
Write (replaced by semantics:write)data_schemas:writeReplaced in 3.0 by semantics:write, which it grants: data schemas became the semantic layer
UsersReadusers:readList and view users, with their email and status, and user statistics
RolesReadroles:readView roles, who holds them and the roles a user holds
Assignroles:assignGive and take roles in the workspace, within the permissions you hold yourself
Identity ProvidersReadidentity_providers:readView the configured sign-in providers (OIDC, LDAP, SAML)
Proposals (Knowledge Graph, coming soon, not part of release 3.0)Readproposals:readView the proposal queue and its batches
Proposeproposals:writeSubmit proposals into the queue (a producer, an agent)
Decideproposals:decideApprove or reject proposals; approving also needs the review scope of what is created
LogsReadlogs:readRead the application logs: search lines by time, level, text and trace

OAuth2 Clients additionally support OIDC Scopes (openid, profile, email, offline_access) for identity information. Scopes outside this catalogue are refused, apart from two special-purpose ones; see Scopes.