Public API Reference
The MantisRMM Public API is a simple REST/JSON interface for reading your fleet and updating device metadata programmatically — for dashboards, integrations, and automation. Every request is authenticated with an API key and scoped to the tenant that issued it.
Overview
- Base URL:
https://api.rmm.mantisops.net - Version: all endpoints are under the
/public/v1prefix. - Format: JSON request and response bodies; UTF-8.
- Auth: a Bearer API key on every request (below).
- Tenancy: a key only ever sees data for the tenant that created it.
Authentication
Create keys in the Customer Portal (portal.mantisops.net) → API keys → Create API key. Account owners and admins can create keys. Set MantisRMM to Read or Write (and the other products to None unless the integration needs them), choose any limits (below), check the Review step, and create the key. Confirming it's you is required. If you grant more than one product, you get one key per product.
The key is shown once. Copy it, then click Run test from here or run the curl command shown to check it works. It can't be shown again. If a key is lost or exposed, revoke it and create a new one. MantisRMM keys begin with mk_live_.
Keys are created only in the Customer Portal. In MantisRMM, Admin settings → API Keys shows your existing keys and their limits, and you can revoke a key there.
Pass the key in the Authorization header as a Bearer token:
Verify a key and see its scopes with the ping endpoint:
Key limits
You set these when you create a key in the Customer Portal. To change them later, choose Edit limits… in the key's row menu: you can change the companies, allowed IP addresses and expiry; the key itself stays the same. The name and permissions can't be changed: create a new key instead.
| Limit | What it does |
|---|---|
| Expires | 30 days, 90 days (the default), 1 year, a date up to 3 years away, or Never. From the expiry time the key is refused with 401 { "error": "API key expired" }. The key's creator and the account's owners and admins get a reminder email 14 days and 3 days before it expires, and one more after it expires. |
| Allowed IP addresses | Up to 50 IPv4 or IPv6 addresses or CIDR ranges. A call from any other address is refused with 403 { "error": "API key not allowed from this IP address" }. |
| Companies | All companies or Only some. A limited key only sees and changes those companies' agents, sites, alerts, jobs, software and patches: lists are filtered, and a single item outside them returns 404. ping also returns the key's allowedCompanies. One endpoint covers the whole account and can't be split by company: a limited key gets 403 with "code": "company_restricted" from GET /public/v1/activity. |
The key list in the Portal shows when each key was last used and from which IP address, and warns about keys that have expired, expire within 14 days or have never been used.
Scopes
Each key is granted one of two scopes when created. In the Customer Portal, Read gives read and Write gives read & write.
| Scope | Grants |
|---|---|
| read | All GET endpoints — list and read agents. |
| read & write | Everything read allows, plus write endpoints (e.g. setting custom fields). |
A request to a write endpoint with a read-only key returns 403. Grant the narrowest scope an integration needs.
429 + Retry-After when exceeded). CORS is enabled (Access-Control-Allow-Origin: *) so browser apps can call the API with a key.?limit=N&offset=M (limit capped at 1000). Omit limit to receive the full list (default — unchanged behavior). List responses include limit, offset, hasMore, and (on most endpoints) total alongside the items — page by incrementing offset until hasMore is false.Errors
Errors use standard HTTP status codes and a JSON body of the form { "error": "message" }.
| Status | Meaning |
|---|---|
| 400 | Malformed request (e.g. a required field is missing). |
| 401 | Missing, malformed, revoked, or unknown API key: { "error": "Invalid or missing API key" }. |
| 401 | The key has expired: { "error": "API key expired" }. Give it a later expiry with Edit limits in the Portal, or create a new key. |
| 403 | The key is valid but lacks the required scope: { "error": "Insufficient scope: 'write' required" }. |
| 403 | The call came from an address that isn't on the key's allowed IP list: { "error": "API key not allowed from this IP address" }. |
| 403 | A key limited to specific companies called an account-wide endpoint: "code": "company_restricted". |
| 404 | The resource (e.g. an agent or custom field) was not found, or it's outside the companies the key is limited to. |
| 429 | Rate limit exceeded (120 requests / 60 s per key). Wait for the number of seconds in Retry-After. |
Endpoints
Verify an API key and return the tenant it belongs to plus its scopes. Useful as a connection test.
List every agent in your tenant. Returns an array of agent objects and a total count.
Fetch a single agent by its id. Returns 404 if no such agent exists in your tenant.
Set a custom field value on an agent. The field must already exist for your tenant (create fields under Settings → Custom Fields); reference it by its label. Send value: null to clear it.
label (required) — the exact label of an existing custom field; value (string, or null to clear). A label with no matching field returns 404.List every site in your tenant. Fields: id, name, description, createdAt.
List threshold alert events (most recent first, last 7 days). Query: ?active=1 for unacknowledged only, ?agentId=, ?limit=. Fields: id, agentId, hostname, metric, value, threshold, firedAt, resolvedAt, acknowledgedAt, active.
List recent jobs (scripts, patch installs, etc.). Query: ?agentId=, ?limit=. Fields: id, agentId, type, status, error, createdAt, startedAt, finishedAt.
Fleet-wide software inventory — one row per (platform, title) with the machine count and observed versions. Fields: name, publisher, platform, machines, versions[].
Installed OS-patch history (KBs applied per agent), most recent first. Query: ?agentId=, ?limit=. Fields: id, agentId, hostname, kbId, title, resultCode, installedAt.
Tenant-wide activity / audit log, most recent first. Query: ?action= (prefix match), ?limit=. Fields: id, userEmail, action, target, details, createdAt.
Acknowledge an alert so it stops showing as active. Requires a read & write key. Returns { ok, acknowledged } (acknowledged: false if it was already acknowledged or not found).
Agent object
Fields returned for an agent. Optional fields are omitted when not available for a device.
| Field | Type | Description |
|---|---|---|
| id | string | Unique agent identifier. |
| name | string | Display name. |
| hostname | string | Reported hostname. |
| platform | string | windows, linux, or darwin. |
| osVersion | string | Operating-system version string. |
| arch | string | CPU architecture (e.g. amd64, arm64). |
| agentVersion | string | Installed agent version. |
| status | string | online or offline. |
| lastSeenAt | number | Last check-in (Unix epoch ms). |
| firstSeenAt | number | Enrollment time (Unix epoch ms). |
| currentUser | string | Logged-in user, if reported. |
| ipAddress | string | Primary IP address. |
| macAddress | string | Primary MAC address. |
| manufacturer / model / serialNumber | string | Hardware identity. |
| cpuModel / cpuCount / memTotal | string / number | CPU model, logical core count, total RAM in bytes. |
| companyId / siteId / groupId | string | Organizational placement. |
| labels | string[] | Agent labels. |
| alarmCount | number | Active (unacknowledged) alerts. |
| customFields | object | Map of custom-field label → value. |