With v17.6, OTbase Discovery Manager includes a REST API. You can use it to automate Manager tasks from scripts and other software: organize the nodes registered in Manager, run operations on selected nodes or groups, inspect results, and maintain Manager settings. The API uses the Manager HTTPS port.
Connect to Discovery Manager at https://<manager-host>:<port>/api/v1. The default HTTPS port is 443. The examples use manager.example as a placeholder host; add :<port> to the URL if your Manager uses a different port.
All paths begin with /api/v1. JSON property names use lowerCamelCase.
Log in to Manager
$login = @{ username = 'manager-user'; password = 'manager-password' } |
ConvertTo-Json -Compress
$session = $login | curl.exe 'https://manager.example/api/v1/sessions' `
-H 'Content-Type: application/json' --data-binary '@-' | ConvertFrom-Json
$token = $session.accessTokenThe response is 201:
{"accessToken":"session-token","tokenType":"Bearer","expiresIn":60}Send Authorization: Bearer <accessToken> with subsequent requests. JSON bodies need Content-Type: application/json.
For example, list the nodes registered in Manager:
curl.exe 'https://manager.example/api/v1/nodes' `
-H "Authorization: Bearer $token"| Method | Path | Result |
|---|---|---|
| POST | /api/v1/sessions | Log in; returns the token. |
| GET | /api/v1/sessions | List open REST and desktop sessions. |
| DELETE | /api/v1/sessions/current | Log out; returns 204. |
An idle session expires after 60 seconds. Sessions also expire after eight hours, once any active requests, transfers, or jobs finish. Log in again after expiry. Session list IDs cannot be used as access tokens.
Node credentials
If a node needs different login credentials, supported operations accept:
X-OTbase-Node-Authorization: Basic <base64(username:password)>Keep the Manager bearer token in Authorization. Account operations use their JSON login fields; backup creation uses the configured backup credentials.
Batches
Batch requests for existing nodes select with nodeIds, groupIds, or both:
{"nodeIds":["node-a"],"groupIds":["group-b"]}groupIdsselects the nodes in those groups; duplicate nodes are processed once.- Without either field, all configured nodes are selected.
- For batch actions with a body, put the selection in URL query parameters or in the JSON body (in the manifest for multipart uploads).
GEThas no request body, so its selection goes only in URL query parameters.- Repeat
nodeIdsandgroupIdsin the URL to select multiple IDs. - Import takes new node definitions instead of an existing-node selection.
Each node has its own result. Check results even when the response is 200:
{
"results":[
{"index":0,"nodeId":"node-a","status":204},
{"index":1,"nodeId":"node-b","status":404,"error":"node_not_found","message":"The requested node was not found."}
],
"summary":{"total":2,"succeeded":1,"failed":1}
}Some actions return 202 when at least one node starts background work.
For example, start a probe on two registered nodes without waiting for it to finish:
$selection = @{ nodeIds = @('node-a', 'node-b') } | ConvertTo-Json -Compress
$selection | curl.exe -X PUT `
'https://manager.example/api/v1/batch/nodes/doProbe?wait=false' `
-H "Authorization: Bearer $token" `
-H 'Content-Type: application/json' --data-binary '@-'Nodes and groups
| Method | Path | Body or result |
|---|---|---|
| GET | /api/v1/nodes | {"nodes":[...]}; optional ?groupId=.... |
| POST | /api/v1/nodes | Create a node; returns 201 and {"id":"..."}. |
| PUT | /api/v1/nodes/{nodeId} | Replace editable fields; omitted fields use defaults; returns 204. |
| PATCH | /api/v1/nodes/{nodeId} | Change only the fields supplied; returns 204. |
| DELETE | /api/v1/nodes/{nodeId} | Remove the configured node; returns 204. |
| GET | /api/v1/groups | {"groups":[...]}. |
| POST | /api/v1/groups | {"name":"Production"}; returns 201 and {"id":"..."}. |
| PUT, PATCH | /api/v1/groups/{groupId} | {"name":"New name"}; returns 204. |
| DELETE | /api/v1/groups/{groupId} | Delete the group and its nodes; returns 204. |
| GET | /api/v1/groups/{groupId}/nodes | List the group's nodes. |
| PUT, PATCH | /api/v1/groups/{groupId}/nodes/{nodeId} | Move the node; no body; returns 204. |
For node PUT, host is required; omitted port defaults to 44461 and backupEnabled to false. Node PATCH leaves omitted fields unchanged.
Create a node with an existing group ID:
{"host":"node.example","port":44461,"groupId":"group-id","product":"Discovery Server"}product defaults to Discovery Server; Discovery Agent is also supported. Each node belongs to one group. Nodes remain listed when they cannot connect.
connectionStatus | Meaning |
|---|---|
| 200 | Connected and authenticated. |
| 202 | Waiting, connecting or reconnecting. |
| 400 | Connection failed or node software unavailable. |
| 403 | Missing or rejected node credentials. |
status contains connection details. Changing backupEnabled requires a connected, backup-capable node. Deleting a node does not uninstall its software.
| Method | Batch path | Example body |
|---|---|---|
| POST | /api/v1/batch/nodes/edit | {"nodeIds":["a"],"changes":{"port":44462}} |
| POST | /api/v1/batch/nodes/delete | {"nodeIds":["a"]} |
| POST | /api/v1/batch/nodes/move?nodeIds=a&groupIds=source-group | {"targetGroupId":"target-group"} |
| POST | /api/v1/batch/nodes/import | {"nodes":[{"host":"node.example","port":44461,"groupId":"group-id"}]} |
Import returns a new ID and status 201 per node. Edits, moves and deletions return 204 per node.
Probe, sync and reduce
| Method | Single node | Batch |
|---|---|---|
| PUT, PATCH | /api/v1/nodes/{nodeId}/doProbe | /api/v1/batch/nodes/doProbe |
| PUT, PATCH | /api/v1/nodes/{nodeId}/doSync | /api/v1/batch/nodes/doSync |
| PUT, PATCH | /api/v1/nodes/{nodeId}/doReduceMultipleExportedNetworks | /api/v1/batch/nodes/doReduceMultipleExportedNetworks |
Single-node calls have no body. Batches select nodes with nodeIds, groupIds, or both in the URL query or JSON body. The action options are:
| Parameter | Meaning |
|---|---|
refresh | Probe: refresh known devices, default true. Sync: probe before exporting, default false. Not accepted for reduce. |
wait | Default true: wait for the result. false: start in the background and return 202. |
Use true or false for boolean parameters.
PUT /api/v1/nodes/node-id/doProbe?refresh=false&wait=true
Authorization: Bearer <accessToken>| Node | Probe | Sync | Reduce |
|---|---|---|---|
| Discovery Server 17.6+ | Supports refresh; waits for completion. | Supports refresh. | Supported. |
| Older Discovery Server | Supports refresh; confirms startup only. | Exports without refresh; that option is ignored. | Depends on node version. |
| Discovery Agent | Confirms startup only; refresh is ignored. | 422, unsupported. | 422, unsupported. |
Probe returns 204; for Agents and older Servers this means started, even with wait=true.
Sync and reduce return 200 with a text result. Check that text for errors, even when the HTTP status is 200. With wait=false, check node status for the outcome.
Backups
| Method | Path | Result |
|---|---|---|
| POST | /api/v1/nodes/{nodeId}/createBackup | Create a stored backup; returns 200 with backup. |
| POST | /api/v1/batch/nodes/createBackup | Create backups for selected nodes. |
| GET | /api/v1/nodes/{nodeId}/listBackups | List stored backups. |
| GET | /api/v1/batch/nodes/listBackups | List backups for selected nodes; use URL parameters for selection. |
| GET | /api/v1/nodes/{nodeId}/backups/{filename} | Download raw backup bytes. |
| DELETE | /api/v1/nodes/{nodeId}/backups/{filename} | Delete the stored file; returns 204. |
| POST | /api/v1/nodes/{nodeId}/restoreFromBackup | Restore an uploaded or stored backup; returns 202. |
| POST | /api/v1/batch/nodes/restoreFromBackup | Restore the selected backup for each node. |
Create and restore require a connected, backup-capable node: Server 16.7+ or Agent 2.15+. Stored backups can be listed, downloaded and deleted offline. Creation uses backups.credentials from Manager settings and applies the configured retention policy.
Use the exact listed filename, URL-encoded, for download or deletion:
{"backups":[{"filename":"node_id.ot-base","timestamp":"2026-09-25 10:00:00","size":"0.01 MB"}]}For a single restore, send raw backup bytes with Content-Type: application/octet-stream or JSON selecting a stored file: {"filename":"node_backup.ot-base"}. Check node status after 202; a restart may be needed.
Batch restore accepts JSON with a stored filename for each node:
{"nodeIds":["node-a","node-b"],"nodeOptions":{"node-a":{"filename":"server.ot-base"},"node-b":{"filename":"agent.ot-base"}}}To upload files, send multipart form data with a manifest JSON field. In nodeOptions, use {"backup":"serverFile"} to reference the file part named serverFile. Stored filenames and uploaded files can be mixed in one request. Several nodes can reference the same uploaded file.
Each selected node needs a backup in nodeOptions. HTTP 202 means at least one restore started; check node status for the outcome.
Creation returns the existing backup result; batches include it per node:
{"backup":{"results":{"node-id":"Success"},"successCount":1,"errors":[]}}Failed backup attempts appear in the per-node results.
Software updates
| Method | Path | Purpose |
|---|---|---|
| GET | /api/v1/nodes/{nodeId}/softwareUpdateCapabilities | Read installer requirements and options. |
| POST | /api/v1/batch/nodes/softwareUpdateCapabilities | Read them for nodes selected by nodeIds, groupIds, or both. |
| POST | /api/v1/nodes/{nodeId}/softwareUpdates | Upload one installer. |
| POST | /api/v1/batch/nodes/softwareUpdates | Upload installers for several nodes. |
| GET | /api/v1/softwareUpdates/{updateId} | Read update status. |
| DELETE | /api/v1/softwareUpdates/{updateId} | Cancel a pending update or remove tracking. |
Read capabilities first. Use the returned product, selectionKey, file types and options. Server updates require version 13.4+.
For one node, send multipart form data with an installer file and optional settings JSON text field:
curl.exe -X POST `
'https://manager.example/api/v1/nodes/node-id/softwareUpdates' `
-H "Authorization: Bearer $token" `
-F 'installer=@OTbase Network Discovery Installer V17.5.exe' `
-F 'settings={};type=application/json'For a batch, send a manifest JSON text field and a file part per installer ID:
{
"nodeIds":["windows-node","linux-node","agent-node"],
"installers":[
{"id":"win","product":"Discovery Server","selectionKey":"windows"},
{"id":"linux","product":"Discovery Server","selectionKey":"debian;amd64"},
{"id":"agent","product":"Discovery Agent","selectionKey":"windows"}
],
"nodeOptions":{"linux-node":{"installer":"linux","settings":{}}}
}curl.exe -X POST `
'https://manager.example/api/v1/batch/nodes/softwareUpdates' `
-H "Authorization: Bearer $token" `
-F 'manifest=<manifest.json;type=application/json' `
-F 'win=@OTbase Network Discovery Installer V17.5.exe' `
-F 'linux=@discovery-service-amd64.deb' `
-F 'agent=@OTbase Discovery Agent Installer V2.16.exe'Each node must match one installer by product and selectionKey. Use nodeOptions to choose an installer and settings for individual nodes.
202 returns a softwareUpdate with an ID. Batches return one per accepted node. Poll each ID:
| Status | Meaning |
|---|---|
starting | Preparing or transferring the installer. |
accepted | Node accepted the installer; waiting for reconnect. |
completed | Node reconnected successfully. |
failed | Read error and message. |
cancelling, cancelled | Cancellation requested or completed before acceptance. |
Deleting a starting update requests cancellation. Deleting an accepted or finished update removes its status record; it does not undo installation.
Software uninstall
| Method | Path | Selection |
|---|---|---|
| DELETE | /api/v1/nodes/{nodeId}/softwareUninstall | Node ID in the path. |
| DELETE | /api/v1/batch/nodes/softwareUninstall | nodeIds and groupIds in the URL or JSON body. |
Requires a connected Server or Agent with remote updates enabled. Docker is unsupported. 202 means accepted; check node status for the outcome.
Local accounts
| Method | Single node | Batch |
|---|---|---|
| PUT, PATCH | /api/v1/nodes/{nodeId}/doUpdateCredentials | /api/v1/batch/nodes/doUpdateCredentials |
| POST | /api/v1/nodes/{nodeId}/doGetCredentials | /api/v1/batch/nodes/doGetCredentials |
| PUT, PATCH | /api/v1/nodes/{nodeId}/doRemoveCredentials | /api/v1/batch/nodes/doRemoveCredentials |
| DELETE | /api/v1/nodes/{nodeId}/doRemoveAllCredentials | /api/v1/batch/nodes/doRemoveAllCredentials |
Both forms take JSON. Batches select nodeIds and groupIds in the URL or body; omitting both selects all configured nodes. Use the JSON login fields for node authentication.
| Field | Use |
|---|---|
credentials | Additional login pairs: [{"user":"admin","password":"password"}]. |
oldPasswords | Previous passwords for the Manager session's username. |
nodeIds | Batch targets; optional. |
groupIds | Batch groups; their nodes are included in the targets. |
Login attempts use session credentials, then oldPasswords, then credentials.
These are local accounts; LDAP accounts are excluded. Changes require remote configuration. A node that does not expose the required account operations returns 422.
Add users or change passwords
{
"nodeIds":["node-a","node-b"],
"oldPasswords":["previous-password"],
"credentials":[{"user":"bootstrap-admin","password":"bootstrap-password"}],
"users":[{"user":"operator","password":"new-password"}],
"addUser":true
}All fields are optional. users defaults to the session account. addUser=true creates missing local admins; otherwise missing users return not_found.
oldPasswords helps authenticate with a previous password; it does not change the Manager password. Check each user's result.
List or remove users
doGetCredentials accepts {} plus the optional login fields. It returns the primary user first, then additional admins, without passwords or hashes:
{"nodeId":"node-a","status":200,"users":[{"user":"admin","primary":true},{"user":"operator","primary":false}]}doRemoveCredentials requires a nonempty username list: {"users":["operator"]}. The primary user cannot be removed. Check each user's result.
doRemoveAllCredentials removes all additional admins and preserves the primary account. It accepts optional login fields and batch selection, but no users or addUser.
Batch responses contain one result per node.
Diagnostics
| Method | Path | Purpose |
|---|---|---|
| POST | /api/v1/nodes/{nodeId}/createDiagnosticArchives | Start a job; returns 202 and its ID. |
| POST | /api/v1/batch/nodes/createDiagnosticArchives | Start one job per selected node. |
| GET | /api/v1/diagnosticArchives/{archiveId} | Read job status. |
| GET | /api/v1/diagnosticArchives/{archiveId}/content | Download the ready ZIP. |
| DELETE | /api/v1/diagnosticArchives/{archiveId} | Cancel or delete the job. |
Requires Server 17.0+ or Agent 2.15+. Select files with an optional JSON body:
{"include":["logs","diagnostics","export"]}Defaults are diagnostics for Servers and config plus logs for Agents. Other choices depend on node support. Poll until the job is ready or failed; ready includes downloadUrl. Check warnings for missing components.
For a batch, put nodeIds, groupIds, or both in the URL or the same body:
{"nodeIds":["node-a","node-b"],"include":["logs"]}Omit both selectors to include all configured nodes. Each result contains the node's job or an error. Poll and download accepted jobs using the paths above.
History and settings
| Method | Path | Result |
|---|---|---|
| GET | /api/v1/fileHistory | {"records":[...]}. |
| GET | /api/v1/auditLog | {"records":[...]}; optional ?eventType=login,connection. |
| GET | /api/v1/settings | {"settings":{...}}; omits passwords and private keys. |
| POST | /api/v1/settings | Update changed fields; returns 204. |
Audit event types: backup, blocked, connection, diagnostics, group, login, node, security, session, settings.
Settings use the UI's nested field names:
{"reconnectEnabled":true,"backups":{"enabled":true,"startAt":"03:00"}}Settings changes require an exclusive Manager session. name and proxy.tempPath are read-only. Passwords and private keys are write-only.
settings.admins contains additional Manager administrators, not local accounts from Discovery Server or Discovery Agent.
Lists such as admins, backups.credentials and LDAP settings are replaced as a whole. An existing username without a new password keeps its password:
{"admins":[{"user":"existing-admin"},{"user":"new-admin","password":"new-password"}]}Errors
Errors contain error and message, sometimes nodeId. Account operations can also include partial per-user results.
{"error":"node_not_found","message":"The requested node was not found."}Common HTTP status codes are:
| Status | Meaning |
|---|---|
| 200 | The request succeeded and returned a response body. For a batch, individual results can still report failures. |
| 201 | Manager created a session, node, or group. |
| 202 | Manager accepted background work; check the job or node status later. |
| 204 | The request succeeded without a response body. |
| 400 | The request or its parameters are invalid. Read error and message. |
| 401 | Manager authentication failed: login credentials or the access token are invalid or expired. |
| 403 | The requested operation is forbidden, for example because node credentials are missing or rejected. |
| 404 | The requested resource was not found. |
| 409 | The request conflicts with an active operation or another Manager session. |
| 422 | The target does not support the requested operation. |
Other failures can report 5xx status codes. Read the response body for the specific cause.
Comments
0 comments
Please sign in to leave a comment.