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.
Useful links
As mentioned earlier, all endpoints perform authentication and authorization checks. In order for these checks to succeed, a valid token should be presented in the Authorization header in the form of Bearer <JWT>.
Suggested application logic
If you plan to integrate MetaDefender Storage Security in your custom application or workflow, please consider the following scenarios for successfully making REST API requests:
| Scenario | Possible use cases |
|---|---|
| Short-lived integration | You are building or enhancing an application that requires sporadic or on-demand access to MetaDefender Storage Security REST APIs. |
| The application is not expected to make more than a few REST API calls per hour. | |
| The application does not need to preserve a session. | |
| Long-lived integration | You are building or enhancing an application that requires continuous, uninterrupted, or hard to predict access to MetaDefender Storage Security REST APIs. |
| Requests are being triggered based on external factors and your application should maintain connectivity with MetaDefender Storage Security REST API. | |
| Session preserving is necessary and authentication should happen without user-interaction. | |
| Your application will make a significant number of REST API requests and you need increased performance | |
| API Key integration | You are building or enhancing an application that requires continuous, uninterrupted, or hard to predict access to MetaDefender Storage Security REST APIs. |
| Requests are being triggered based on external factors and your application should maintain connectivity with MetaDefender Storage Security REST API. | |
| Authentication should happen without user-interaction. | |
| Your application will make a significant number of REST API requests and you need increased performance. |
Short-lived integration
Obtain a signed accessToken by calling
/api/user/authenticateAPIUse this token to call your desired REST API by providing it in the Authorization header
Expire the token by calling
/api/user/logoutRepeat steps 1-3 the next time your application needs to call a REST API
Long-lived integration
Obtain a signed token by calling
/api/user/authenticateAPISecurely save the received accessToken and the refreshToken
Use the accessToken to call your desired REST API by providing it in the Authorization header
Add an exception handler in case you receive a 401 Unauthorized response because the JWT has expired call
/api/user/refreshTokento obtain a new accessToken by providing the saved refreshToken.a) the accessToken expires after an hour of creation; the expiry time is represented in UTC format by the accessTokenExpiryTime value.
b) the refreshToken expires after an hour of creation; the expiry time is represented in UTC format by the refreshTokenExpiryTime value. c) if the refreshToken has expired as well, obtain a signed token by calling/api/user/authenticateAPIUse the newly issued accessToken to call your desired REST API by providing it in the Authorization header
API Key integration
In the MetaDefender Storage Security interface, navigate to Settings → Profile → Configure API Key
Generate the key, copy it, and store it somewhere safe
Use the API Key to call your desired REST API by providing it as a header with the Key:
ApiKeyand Value:<the value of your API Key>
General considerations
The access token expiration date cannot be extended. By default, the access token is valid for an hour after calling
/api/user/authenticateAPI to obtain it. The refresh token is also valid for an hour but can be extended by calling/api/user/refreshTokenand it is also automatically extended with an hour with each non-GET request.A refresh token is used to request a new access token when the current one expires without requiring re-authentication using a username and password.
The refresh token is used to forcibly expire any previously issued JWT when the refresh token expires or is removed by calling
/api/user/logout.A 3rd party application that needs persistent connectivity with MetaDefender Storage Security should implement a timeout mechanism to ensure that the refresh token is renewed before it expires by calling
/api/user/refreshTokenwhenever the JWT (access token) is expired but before the refresh token expires as well.API Keys cannot be used to authenticate requests to the
/api/userand/api/apikeyendpoints.
Abac
Attribute-Based Access Control management endpoints
Get Roles
Retrieve all ABAC roles. Set includePermissions to true to include the full permission list for each role.
Create Role
Create a new ABAC role. Provide an optional templateRoleId to inherit all permissions from an existing role; any IDs in permissionIds are merged on top of the template.
Get Role by ID
Retrieve a single role and its associated permissions by role ID.
Update Role
Replace an existing role's name and full permission set in a single operation. The supplied permissionIds become the role's complete permission list (previously assigned permissions not in the list are removed). Predefined system roles cannot be updated.
Delete Role
Permanently delete a role. Predefined system roles cannot be deleted.
Get Permissions
Retrieve all available ABAC permissions (action + resource pairs).
Create Permission
Create a new ABAC permission defined by an action and a resource.
Delete Permission
Permanently delete a permission by ID. Predefined base permissions cannot be deleted.
Assign Permission to Role
Assign a permission to the specified role.
Remove Permission from Role
Remove a permission from the specified role. Permissions that were assigned to a predefined role during initialization cannot be removed.
Assign Role to User
Assign a role to a user, optionally with an expiry date after which the assignment is no longer valid.
Replace User Roles
Atomically replace all role assignments for a user with the provided set of role IDs. All existing role bindings are removed and new ones are created in a single transaction.
Remove Role from User
Remove a role binding from a user using the role binding ID.
Assign Permission to User
Assign a permission directly to a user, optionally with an expiry date.
Remove Permission from User
Remove a directly assigned permission from a user using the user permission ID.
Add an account
Add a new storage account to the system
Bulk delete accounts
Deletes up to 100 accounts in a single request. Per-account ABAC (Accounts.Delete) plus per-cascaded-storage ABAC (Storages.Delete) are enforced. When forceDelete=true, child storages are cascade-deleted along with their scans. If any cascaded storage has a running scan, the request is rejected with HTTP 409. When forceDelete=false, accounts with children are returned in the failed list with localized reason; only empty accounts are deleted.
List accounts (paginated, filtered, sorted)
Returns a paginated, filtered, and sorted list of accounts. Supports multi-value filters: vendorType (StorageVendorType) and protocolType (StorageProtocolType). The autodiscoveryEnabled boolean filter restricts results to accounts with auto-discovery enabled or disabled. The includeStorages flag (default true) controls whether associated storage units are loaded per account; set to false to skip the per-account N+1 storage scan RPC calls. Default Count is 100 (maximum 100). Returns an IPagedResponse containing Items, TotalCount, StartIndex, and Count.
Update an account
Update an existing account's configuration
Delete an account
Permanently delete an account and its storage references
Fetch account by ID
Retrieve a single account's details by ID
Fetch available storage units for an account
List all storage units linked to a particular account
Fetch account sources
Fetch account sources
Audit
List audit information
Fetch audit logs
Configuration
Import or export configuration file
Export configuration file
Export the current configuration settings to an archive. The file will be encrypted using the provided password.
Import configuration file
Get enabled modules
Retrieve external loggers
Update external logger state
Add a new Syslog server configuration
Update a Syslog server configuration
Add a new Kafka server configuration
Update a Kafka server configuration
Delete external logger
File
Retrieve processed files information
Rescan 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.
Enumerate processed files
Rescan multiple files on demand
This request is used to rescan and update existing files from a scan based on a filter.
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..
Retrieve archive scan results
Retrieve the archive scan results using either the scanResultId or the parentId
Cancel a file in an ongoing scan
Add a group
Bulk delete groups
Deletes up to 100 groups in a single request. Per-group ABAC (Groups.Delete) plus per-cascaded-storage ABAC (Storages.Delete) are enforced. When forceDelete=true, child accounts and storages are cascade-deleted along with their scans. If any cascaded storage has a running scan, the request is rejected with HTTP 409. When forceDelete=false, groups with children are returned in the failed list with localized reason; only empty groups are deleted.
List groups (paginated, filtered, sorted)
Returns a paginated, filtered, and sorted list of groups. The name filter performs a case-insensitive substring (ILIKE) match. The includeStorages flag (default true) controls whether associated storage units are loaded per group; set to false to skip the per-group N+1 storage scan RPC calls. Default Count is 100 (maximum 100). Returns an IPagedResponse containing Items, TotalCount, StartIndex, and Count.
Update a group
Delete a group
Fetch group by ID
Fetch the number of groups
Health Status
API that responds with 200 OK if application is running.
Get health status
Onboarding
Manage onboarding
Fetch onboarding configuration
Finish onboarding
Accept Eula
Remediations
Remediations information
Get Remediations by workflow id
Get Remediation by id
Delete Remediation
Add Remediation
Update Remediation
Bulk delete remediations
Deletes multiple remediations in a single request. Returns per-id succeeded/failed results; a non-existent id is reported as failed (not found).
Report
Generate reports
Get scans report
Download PDF Report
Get scan by ID
Start a scan
To scan a specific folder using the optional Folder parameter, provide the absolute folder path: For Amazon S3 / S3 Compatible Types, Azure Blob, Azure Files, Google Cloud, Alibaba Cloud and Oracle Native: Including the Folder Location integrated in MDSS and excluding the Bucket Name, Container, etc. For Box: With or without the "All Files" folder For Sharepoint and Onedrive: Excluding the Document Library, Site, or Group For OPSWAT MFT Storage: The desired Folder Path when integrating with user For NFS / SMB / SFTP / FTP / SharePoint OnPrem: Only the folder path beyond your configured storage root (do not include the base path set during integration) Provide the absolute folder path in the following format "{"Folder":"PATH_TO_SCAN"}
Stop a scan
Bulk delete scans
Deletes up to 100 scan records across any storages the caller can access. Per-scan ABAC is enforced and inaccessible scan IDs are returned in the failed list with a localized reason. Partial-delete model — running scans are NOT a hard block: they are returned in the failed list with reasonKey BULK_OPERATION_SCAN_RUNNING while the rest of the batch is deleted normally.
Bulk stop scans
Dispatches stop signals for up to 100 scans in a single request. Per-scan ABAC is enforced and inaccessible scan IDs are returned in the failed list with a localized reason. Stop is fire-and-forget — the response field 'dispatched' contains the scan IDs for which a stop signal was queued; the actual transition to Cancelled happens asynchronously.
Delete scans
Fetch last completed scan
Get an active scan by scan ID
Get Real-Time scan by storage Id
Scan Instance
List, add, update and delete Scan Instances
Get Scan Instances
Add a new Scan Instance
Update an existing Scan Instance
Get Scan Instance by ID
Delete a Scan Instance
Test
Scan Pool
List, add, update and delete Scan Pools
Get Scan Pools
Add a new Scan Pool
Update an existing Scan Pool
Get Scan Pool by ID
Delete a Scan Pool
Scan Workflow Snapshot
List scan workflow snapshots
Get all scan workflow snapshots by scan ID
Settings
List or update your settings
Update notifications configuration
Get notifications configuration
Update SMTP configuration
Fetch SMTP configuration
Online license activation
Offline license activation
Get license details
Deactivate license
Update retention configuration
Fetch retention configuration
Generate encryption key
Generate a new encryption key, replacing the old one if it exists.
Get encryption key creation date
Get the creation date of the encryption key.
Update SSL configuration
Update SSL configuration of MDSS by uploading a certificate and a key to enable SSL.
Get SSL configuration
Get current SSL configuration status.
Update Single User Session
Update Simultaneous Sessions allowed for a Single User.
Get Single User Session
Get Simultaneous Sessions allowed for a Single User.
Get Telemetry configuration
Get MDSS Open Telemetry configuration.
Update Telemetry configuration
Update MDSS Open Telemetry configuration.
Sso
Sso Authentication and Sso configuration update
Get Sso Configuration
Allows retrieval of the current SSO configuration.
Update Sso Configuration
Allows updating the current Sso Configuration.
Storage
Manage your storage units
Fetch storage by ID
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}"
Graph storage units:
Credentials: "{"TenantId":null,"ClientId":null,"ClientSecret":null}"
Source: "{"Group":null}"
Delete a storage
List storage units (paginated, filtered, sorted)
Returns a paginated, filtered, and sorted list of storage units. Supports multi-value comma-separated filters: status (StorageStatusType), vendorType (StorageVendorType), protocolType (StorageProtocolType), accountId, and groupId. The name filter performs a case-insensitive substring (ILIKE) match. Sorting is configurable by id or name. Default Count is 100 (maximum 100). Returns an IPagedResponse containing Items, TotalCount, StartIndex, and Count.
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}"
Graph storage units:
Credentials: "{"TenantId":null,"ClientId":null,"ClientSecret":null}"
Source: "{"Group":null}"
Bulk move storages to a target group
Moves up to 100 storages to a target group in a single request. Per-storage ABAC (Write) is enforced — inaccessible storage IDs are returned in the failed list with a localized reason. The target group must exist and be accessible; otherwise the entire request fails with a localized 'target group not found' response.