Empirum REST API — Cloud Permission Management & Local Principals
Discover how to effectively manage cloud permissions using the Empirum REST API for streamlined access control and security.
Table of Contents
Empirum REST-API
The Empirum REST API provides programmatic access to Matrix42 Empirum. Customers and partners can use it to integrate Empirum with third-party systems (ITSM, CMDB, SIEM, reporting platforms, orchestration tools) and to automate recurring administrative tasks such as software rollouts, reinstallations, patch remediation, inventory exports and fleet health checks.
See the dedicated articles for more details.
Overview
Each Cloud instance runs at its own host, https://empirumXXX.m42cloud.com. The instance's first administrator is an Entra (Azure AD) user following the naming convention empcloudXXX-1@m42cloud.com. This account is assigned during provisioning and already holds the admin.manage role.
Throughout this article, replace XXX with your instance number.
To let your own applications or scripts call the REST API, the administrator signs in to the Permission Management web UI at https://empirumXXX.m42cloud.com/admin and creates a Local Principal there: a client_id / client_secret pair with a specific set of roles. Your application then exchanges that pair for a short-lived access token and calls the REST API with it, the same way as any on-premises client.
Signing in to Permission Management
- Open
https://empirumXXX.m42cloud.com/adminin a browser. - Sign in with your Entra account (e.g.
empcloudXXX-1@m42cloud.com).
In the Cloud, sign-in is Entra-only. The Client ID / Secret login form shown on-premises is not available here, and the admin.manage role can never be granted to a Local Principal, only to an Entra (IdP) user. This keeps every administrative action tied to a real, auditable Entra identity.
Creating a Local Principal
- In the left navigation, open Local Principals.
- Click Create Principal.
- Fill in the New Client Credential form:
- Description: optional free text to identify the client later (e.g. "Ticketing system integration").
-
Expires: enter a number of days, or pick a date. Leave empty for no expiry. An expired credential is rejected at
POST /api/auth/tokenthe same as a revoked one. -
Roles: check every role this application actually needs (least privilege). Select all selects every role except
admin.manage, which can never be assigned to a Local Principal in the Cloud.
- Click Create.
A green panel appears: "New credential created — save the secret now, it will not be shown again." It shows the generated Client ID and Secret, each with a Copy button.
This is the only time the secret is ever shown. The server stores only a one-way hash of the secret, never the plaintext. There is no "reveal secret" or "reset secret" action later. Copy both values into a password manager or your application's secret store immediately.
If the secret is lost, delete the Local Principal and create a new one. Existing roles and the description are not transferable to a new secret.
Choosing roles
Assign only the roles your application actually calls. Never include admin.manage; it is reserved for Entra administrators.
| Role | Grants |
|---|---|
computer.read |
Read computers, inventory, issues, security posture |
computer.write |
Modify computer records |
group.read |
Read groups and memberships |
group.write |
Create/modify groups, memberships, package assignments |
package.read |
Read packages |
package.write |
Import/modify packages |
pm.read |
Read patch management groups/status |
pm.write |
Modify patch management groups |
pm.approve |
Approve patches |
pm.execute |
Emergency patching actions |
reinstall.execute |
Trigger/cancel a software reinstall |
scan.execute |
Trigger an inventory/patch rescan |
reboot.execute |
Request a computer reboot |
activation.execute |
Activate/wake a computer or group, incl. software uninstall |
For a read-only integration (reporting, dashboards), grant only the *.read roles it needs.
Using the credential in your application
Your application exchanges the client_id / client_secret for a Bearer token exactly like an on-premises client. See PowerShell examples for the full set of helper functions and examples.
Minimal PowerShell example:
$tokenBody = @{
grant_type = 'client_credentials'
client_id = '<the Client ID from the panel above>'
client_secret = '<the Secret from the panel above>'
}
# Replace XXX with your instance
$token = Invoke-RestMethod -Method Post `
-Uri 'https://empirumXXX.m42cloud.com/api/auth/token' `
-ContentType 'application/x-www-form-urlencoded' `
-Headers @{ 'api-version' = '1' } `
-Body $tokenBody
# $token.access_token is a Bearer JWT, valid for $token.expires_in seconds
Invoke-RestMethod -Uri 'https://empirumXXX.m42cloud.com/api/system' `
-Headers @{ Authorization = "Bearer $($token.access_token)"; 'api-version' = '1' }POST /api/auth/token is rate-limited per client IP (10 requests / 60 seconds by default). If your application re-authenticates on every call instead of caching the token until shortly before expires_in, it may be throttled with 429 Too Many Requests.
Managing an existing Local Principal
On the Local Principals page, each row shows Client ID, Description, Roles, Status (Active / Expired / Revoked), Expires, and Created date, with the following per-row actions:
- Edit: change the description, roles, or expiry. Does not require or reveal the secret.
- Revoke / Restore: immediately block or re-enable the credential without deleting it.
-
Delete: permanently remove the credential. Any application still using it will get
401on its next token request.
The Local Principal you are currently signed in with (marked You) cannot revoke or delete itself. Principals marked Protected (used internally, e.g. for Matrix42 integrations) cannot be deleted from this UI.