This section of the user guide describes how you can programmatically interact with the MetaDefender Storage Security REST API. Below are some common tasks that can be done using the available REST APIs:

  • Authenticate to obtain a JSON Web Token(JWT)
  • Start or stop a process(scan)
  • Add / remove storage units

About this REST API

The exposed endpoint is located by default at http(s)://md-storage-server/api/ (for example, the authentication endpoint is available at http(s)://md-storage-server/api/user/authenticate). All requests are handled by the NGINX web server before being proxied to the backend API Gateway service.

All endpoints perform authentication and authorization checks. For these checks to succeed, a valid token should be presented in the Authorization header in the form of Bearer.

Please note that all issued tokens have a timestamp and signature associated in order to prevent long-term usage without re - authentication.The lifespan of the token is currently set to 60 minutes, meaning you will have to request a new token before it expires in order to avoid error responses.

Server
http://<MDSS_HOST>
Server Variables

Fetch all accounts

Auth
GET /api/account
Responses
200
Response

Add an account

Auth
Request Body
POST /api/account
Responses
200
Response

Update an account

Auth
Request Body
PATCH /api/account
Responses
200
Response

Fetch account by ID

Auth
Path Params
GET /api/account/{accountId}
Responses
200
Response

Delete an account

Auth
Path Params
DELETE /api/account/{accountId}
Responses
200
Response

Fetch the number of accounts

Auth
GET /api/account/count
Responses
200
Response

Audit

List audit information

Fetch audit logs

Auth
Path Params
Query String
GET /api/audit/{startIndex}/{count}
Responses
200
Response

Export configuration file

Auth
Query String
GET /api/configuration/export
Responses
200
Response

Import configuration file

Auth
Request Body
POST /api/configuration/import
Responses
200
Response

Get enabled modules

Auth
GET /api/configuration/enabledModules
Responses
200
Response

Deep Cdr

Manage sanitized files

Revert encrypted file

Auth
Path Params
POST /api/deepcdr/revert/{fileId}
Responses
200
Response

Retrieve external loggers

Auth
GET /api/externallogger
Responses
200
Response

Update external logger state

Auth
Request Body
PUT /api/externallogger/status
Responses
200
Response

Update a Syslog server configuration

Auth
Request Body
PUT /api/externallogger/udpSyslog
Responses
200
Response

Add a new Syslog server configuration

Auth
Request Body
POST /api/externallogger/udpSyslog
Responses
200
Response

Delete external logger

Auth
Path Params
DELETE /api/externallogger/{id}
Responses
200
Response

Scan a file on demand

This request is used to update a scanned file with passwords, in case it is an encrypted archive andit could not be scanned because the passwords to decrypt it were not provided. It can also be used withoutproviding any passwords to simply rescan a specific file from a finished scan.

Auth
Request Body
PUT /api/file
Responses
200
Response

Fetch processing results for a file

File processing is done asynchronously and each analysis request is tracked by a file ID. Because processing a file is a potentially time-consuming operation, scheduling a file for processing and retrieving the results needs to be done using two separate API calls.

This request needs to be made multiple times until the analysis is complete. Analysis completion can be tracked using the processingState and the progress values from the response..

Auth
Path Params
GET /api/file/{fileId}
Responses
200
Response

Enumerate processed files

Auth
Path Params
Query String
GET /api/file/{scanId}/{startIndex}/{count}
Responses
200
Response

Fetch all groups

Auth
GET /api/group
Responses
200
Response

Add a group

Auth
Request Body
POST /api/group
Responses
200
Response

Update a group

Auth
Request Body
PATCH /api/group
Responses
200
Response

Fetch group by ID

Auth
Path Params
GET /api/group/{groupId}
Responses
200
Response

Delete a group

Auth
Path Params
DELETE /api/group/{groupId}
Responses
200
Response

Fetch the number of groups

Auth
GET /api/group/count
Responses
200
Response

Health Status

API that responds with 200 OK if application is running.

Get health status

Auth
Query String
GET /api/health
Responses
200
Response

Opswat Central Management

Manage OPSWAT Central Management integration

Get OCM configuration

Auth
GET /api/ocm
Responses
200
Response

Enroll to OCM

Auth
Request Body
PUT /api/ocm
Responses
200
Response

UnEnroll to OCM

Auth
POST /api/ocm
Responses
200
Response

Get managed status

Check if MDSS is managed by OCM. This is called by OCM v7.

Auth
GET /api/ocm/manage
Responses
200
Response

Set managed status

Notify that MDSS is managed. This is called by OCM v7.

Auth
Query String
Request Body
POST /api/ocm/manage
Responses
200
Response

Delete managed status

Remove MDSS from being managed. This is called by OCM v7.

Auth
DELETE /api/ocm/manage
Responses
200
Response

Fetch onboarding configuration

Auth
Query String
GET /api/onboarding
Responses
200
Response

Finish onboarding

Auth
POST /api/onboarding
Responses
200
Response

Accept Eula

Auth
POST /api/onboarding/eula
Responses
200
Response

Report

Generate reports

Get scans report

Auth
Query String
GET /api/report
Responses
200
Response

Get Scan Configurations

Auth
GET /api/scanconfiguration
Responses
200
Response

Add a new Scan Configuration

Auth
Request Body
POST /api/scanconfiguration
Responses
200
Response

Update an existing Scan Configuration

Auth
Request Body
PATCH /api/scanconfiguration
Responses
200
Response

Get Scan Configuration by ID

Auth
Path Params
GET /api/scanconfiguration/{id}
Responses
200
Response

Delete a Scan Configuration

Auth
Path Params
DELETE /api/scanconfiguration/{id}
Responses
200
Response

Set a Scan Configuration as default

Auth
Path Params
POST /api/scanconfiguration/setDefault/{id}
Responses
200
Response

Get scan by ID

Auth
Path Params
GET /api/scan/{scanId}
Responses
200
Response

Get scan by ID with information regarding the previous and next scan

Auth
Path Params
Query String
GET /api/scan/sequence/{scanId}
Responses
200
Response

Start a scan

To scan a specific folder using the optional Folder parameter, provide the folder's name if you're using Box, OneDrive, or SharePoint integrations. For other storage integrations, you should provide the absolute path to the folder you want to scan.

Auth
Request Body
POST /api/scan/start
Responses
200
Response

Stop a scan

Auth
Path Params
POST /api/scan/stop/{scanId}
Responses
200
Response

Get next scheduled scan

Auth
Path Params
GET /api/scan/scheduled/{storageId}
Responses
200
Response

Delete scans

Auth
Path Params
Request Body
DELETE /api/scan/{storageId}
Responses
200
Response

Get Scan Instances

Auth
Query String
GET /api/scaninstance
Responses
200
Response

Update an existing Scan Instance

Auth
Request Body
PUT /api/scaninstance
Responses
200
Response

Add a new Scan Instance

Auth
Request Body
POST /api/scaninstance
Responses
200
Response

Get Scan Instance by ID

Auth
Path Params
GET /api/scaninstance/{id}
Responses
200
Response

Delete a Scan Instance

Auth
Path Params
DELETE /api/scaninstance/{id}
Responses
200
Response

Test

Auth
Request Body
POST /api/scaninstance/Test
Responses
200
Response

Get Scan Pools

Auth
GET /api/scanpool
Responses
200
Response

Update an existing Scan Pool

Auth
Request Body
PUT /api/scanpool
Responses
200
Response

Add a new Scan Pool

Auth
Request Body
POST /api/scanpool
Responses
200
Response

Get Scan Pool by ID

Auth
Path Params
GET /api/scanpool/{id}
Responses
200
Response

Delete a Scan Pool

Auth
Path Params
DELETE /api/scanpool/{id}
Responses
200
Response

Scan Workflow Snapshot

List scan workflow snapshots

Get all scan workflow snapshots by scan ID

Auth
Path Params
GET /api/scanworkflowsnapshot/getAllFromScan/{scanId}
Responses
200
Response

Fetch storage security checklist

Auth
Path Params
GET /api/security-checklist/{storageId}
Responses
200
Response

Fetch security checklist details

Auth
Path Params
GET /api/security-checklist/{storageId}/info
Responses
200
Response

Update security checklist item

Auth
Path Params
Request Body
PUT /api/security-checklist/{storageId}/item
Responses
200
Response

Verify the security checklist for storage

Auth
Path Params
PUT /api/security-checklist/{storageId}/verify
Responses
200
Response

Enable/Disable the security checklist

Auth
Request Body
PATCH /api/security-checklist
Responses
200
Response

Enable all security checklist items

Auth
Path Params
PUT /api/security-checklist/{storageId}/enable-all
Responses
200
Response

Get notifications configuration

Auth
GET /api/settings/notifications
Responses
200
Response

Update notifications configuration

Auth
Request Body
PUT /api/settings/notifications
Responses
200
Response

Fetch SMTP configuration

Auth
GET /api/settings/smtp
Responses
200
Response

Update SMTP configuration

Auth
Request Body
PATCH /api/settings/smtp
Responses
200
Response

Online license activation

Auth
Request Body
POST /api/settings/admin/license/activate/online
Responses
200
Response

Offline license activation

Auth
Request Body
POST /api/settings/admin/license/activate/offline
Responses
200
Response

Get license details

Auth
GET /api/settings/admin/license
Responses
200
Response

Deactivate license

Auth
POST /api/settings/admin/license/deactivate
Responses
200
Response

Fetch retention configuration

Auth
GET /api/settings/retention
Responses
200
Response

Update retention configuration

Auth
Request Body
PUT /api/settings/retention
Responses
200
Response

Sso

Sso Authentication and Sso configuration update

Get Sso Configuration

Auth
GET /api/sso/config
Responses
200
Response

Update Sso Configuration

Auth
Request Body
PATCH /api/sso
Responses
200
Response

Fetch all storages

Auth
GET /api/storage/all
Responses
200
Response

Fetch storage by ID

Auth
Path Params
GET /api/storage/{storageId}
Responses
200
Response

Delete a storage

Auth
Path Params
DELETE /api/storage/{storageId}
Responses
200
Response

Update a storage

Note! The following are templates for what is expected in the Credentials, CredentialsFile and Source fields. Please provide the correct values for your storage integration instead of null/false

Alibaba Cloud storage units:
Credentials: "{"Endpoint":null,"AccessKeyId":null,"AccessKeySecret":null,"UseRamRole":false}"
Source: "{"BucketName":null,"FolderLocation":null}"

Amazon S3 / S3 Compatible storage units:
Credentials: "{"ServiceUrl":null,"AccessKeyId":null,"SecretAccessKey":null,"RegionEndpoint":null,"AssumeRoleArn":null,"UseIamRole":false}"
Source: "{"BucketName":null,"FolderLocation":null}"

Azure Blob storage units:
Credentials: "{"TenantId":null,"ClientId":null,"ClientSecret":null,"StorageAccount":null}"
Source: "{"Container":null}"

Azure Files storage units:
Credentials: "{"AccountName":null,"AccountKey":null,"ShareName":null}"
Source: "{"FolderLocation":null}"

Box storage units:
CredentialsFile: upload the credentials file
Source: "{"FolderLocation":null}"

Dell Isilon / SMB Compatible storage units:
Credentials: "{"User":null,"Password":null,"Server":null}"
Source: "{"SharePath":null}"

Google Cloud storage units:
CredentialsFile: upload the credentials file
Credentials: "{"UseAdc":false}"
Source: "{"BucketName":null,"FolderLocation":null}"

OneDrive storage units:
Credentials: "{"TenantId":null,"ClientId":null,"ClientSecret":null}"
Source: "{"Group":null}"

Auth
Path Params
Request Body
PATCH /api/storage/{storageId}
Responses
200
Response

Fetch storage users

Auth
Path Params
Query String
GET /api/storage/{storageId}/users
Responses
200
Response

Add a storage

Note! The following are templates for what is expected in the Credentials, CredentialsFile and Source fields. Please provide the correct values for your storage integration instead of null/false

Alibaba Cloud storage units:
Credentials: "{"Endpoint":null,"AccessKeyId":null,"AccessKeySecret":null,"UseRamRole":false}"
Source: "{"BucketName":null,"FolderLocation":null}"

Amazon S3 / S3 Compatible storage units:
Credentials: "{"ServiceUrl":null,"AccessKeyId":null,"SecretAccessKey":null,"RegionEndpoint":null,"AssumeRoleArn":null,"UseIamRole":false}"
Source: "{"BucketName":null,"FolderLocation":null}"

Azure Blob storage units:
Credentials: "{"TenantId":null,"ClientId":null,"ClientSecret":null,"StorageAccount":null}"
Source: "{"Container":null}"

Azure Files storage units:
Credentials: "{"AccountName":null,"AccountKey":null,"ShareName":null}"
Source: "{"FolderLocation":null}"

Box storage units:
CredentialsFile: upload the credentials file
Source: "{"FolderLocation":null}"

Dell Isilon / SMB Compatible storage units:
Credentials: "{"User":null,"Password":null,"Server":null}"
Source: "{"SharePath":null}"

Google Cloud storage units:
CredentialsFile: upload the credentials file
Credentials: "{"UseAdc":false}"
Source: "{"BucketName":null,"FolderLocation":null}"

OneDrive storage units:
Credentials: "{"TenantId":null,"ClientId":null,"ClientSecret":null}"
Source: "{"Group":null}"

Auth
Request Body
POST /api/storage
Responses
200
Response

Update scan configuration

Auth
Path Params
Request Body
PATCH /api/storage/{storageId}/scan_config
Responses
200
Response

Add a scan schedule

Auth
Path Params
Request Body
PUT /api/storage/{storageId}/scan_schedule
Responses
200
Response

Update a scan schedule

Auth
Path Params
Request Body
PUT /api/storage/scan_schedule/update/{storageId}
Responses
200
Response

Fetch scan schedules

Auth
Path Params
Query String
GET /api/storage/scan_schedules/{storageId}/{sortDirection}/{startIndex}/{count}
Responses
200
Response

Delete scan schedules

Auth
Request Body
DELETE /api/storage/scan_schedule
Responses
200
Response

Retrieve storage user name

Auth
Path Params
GET /api/storage/{storageId}/{userId}
Responses
200
Response

Fetch active users

Auth
Headers
Path Params
GET /api/user/active/{startIndex}/{count}
Responses
200
Response

Register a user

Auth
Request Body
POST /api/user/register
Responses
200
Response

Create a user

Auth
Request Body
POST /api/user/create
Responses
200
Response

Authenticate with a username and password

Authenticate with a username and password to obtain a JWT token,Most of the APIs require authentication in the form of providing a JWT token. Call this API in order to receive a token but please note that it's only valid for an hour so it should be periodically refreshed.

Auth
Request Body
POST /api/user/authenticate
Responses
200
Response

Refresh user token

Auth
Request Body
POST /api/user/refreshToken
Responses
200
Response

Logout

Auth
POST /api/user/logout
Responses
200
Response

Update user role

Auth
Request Body
PUT /api/user/role
Responses
200
Response

Fetch users

Auth
GET /api/user/requests
Responses
200
Response

Delete a user

Auth
Path Params
DELETE /api/user/{userId}
Responses
200
Response

Update a user

Auth
Request Body
PUT /api/user
Responses
200
Response

Request password reset

Auth
Request Body
POST /api/user/password/reset
Responses
200
Response

Reset user password

Auth
Request Body
POST /api/user/password
Responses
200
Response

Object event trigger of real time processing

This endpoint takes the parameters and tries to find the file in the specified storage and applies the scan configuration for the specified file

Auth
Request Body
POST /api/webhook/realtime
Responses
200
400
404
Response

Responses
Response