Managing Shares and Permissions via MyWorkDrive Server Public API
MyWorkDrive Server version 7.1 introduces a powerful new Public API that allows administrators to automate the creation, configuration, and removal of file shares and permissions using HTTP requests. This API is designed for advanced users who need to integrate share management into external systems, scripts, or orchestration workflows.
Getting Started
- Enable the API
- Go to the Enterprise Tab in the Admin Panel
- Enable the Public API
- Copy your API Key
- Send a request to the server
Quick Examples
PowerShell
Invoke-WebRequest -Headers @{ "ApiKey" = "YourApiKey" } -Uri "http://127.0.0.1:8360/api/v3/ListShares"
curl
curl -H "ApiKey: YourApiKey" http://127.0.0.1:8360/api/v3/ListShares
Server URLs
By default the server is only accessible through http://127.0.0.1:8360. To provide access remotely, please see Publishing for Remote Access.
Share Management Endpoints
| Operation | Method | Endpoint | Notes |
| List all shares | GET | /api/v3/ListShares |
Returns array of all shares |
|
Get a share by name |
GET |
/api/v3/GetShare?name={shareName} |
Returns share if it exists |
|
Create a new share |
GET |
/api/v3/CreateShare?name={name}&path={path}&storageProviderId={id} |
Requires storageProviderId |
|
Delete a share |
GET |
/api/v3/DeleteShare?name={name} |
Does NOT auto-remove permissions |
Note: Shares will only appear in the Admin Panel if at least one permission is assigned. API changes may take up to 5 minutes to reflect due to caching.
Permission Management Endpoints
|
Operation |
Method |
Endpoint |
Notes |
|
List all permissions |
GET |
/api/v3/ListPermissions |
Lists all entries |
|
List permissions for user/group |
GET |
/api/v3/ListPermissions?name={name} |
Filters by name |
|
Create/Update permission |
GET |
/api/v3/PlacePermission?... |
See below |
|
Delete permission |
GET |
/api/v3/DeletePermission?... |
All fields required |
PlacePermission Parameters
|
Parameter |
Type |
Required |
Description |
|
name |
string |
✅ |
User or Group name |
|
domainName |
string |
✅ for users optional for groups in Entra ID mode |
Use empty string for Entra ID groups |
|
shareName |
string |
✅ |
Name of the share |
|
isGroup |
boolean |
✅ |
true for groups |
|
webClientAllowed |
boolean |
✅ |
Enable web client access |
|
desktopClientAllowed |
boolean |
✅ |
Enable mapped drive (desktop) access |
|
mobileClientAllowed |
boolean |
✅ |
Enable mobile app access |
|
publicSharingEnabled |
boolean |
✅ |
Allow public link sharing |
|
dlpDownloadEnabled |
boolean |
✅ |
Allow file download (if DLP enabled) |
|
dlpOfficeOnlineEditEnabled |
boolean |
✅ |
Allow Office Online editing only |
This example uses the query parameters listed below to set permissions for the group "All Entra ID Members".
- name=All%20Entra%20ID%20Members
- shareName=LocalTest
- domainName=
- isGroup=true
- webClientAllowed=true
- desktopClientAllowed=true
- mobileClientAllowed=true
- publicSharingEnabled=true
- dlpDownloadEnabled=true
- dlpOfficeOnlineEditEnabled=true
/api/v3/PlacePermission?name=All%20Entra%20ID%20Members&shareName=LocalTest&domainName=&isGroup=true&webClientAllowed=true&desktopClientAllowed=true&mobileClientAllowed=true&publicSharingEnabled=true&dlpDownloadEnabled=true&dlpOfficeOnlineEditEnabled=true
Storage Providers
To create a share, you need the storageProviderId.
How to Retrieve It:
- Go to Admin Panel, then Integrations
- Create a new storage entry (e.g. Azure Blob, Azure Files, SMB)
- Check the General.xml file in Wanpath\wanpath.data\settings for the generated storageProviderId.
⚠️ Currently, API support for managing storage providers (add/delete) is under consideration.
Notes
- Updates may take up to 5 minutes to appear in the Admin Panel.
- Deleting a share does NOT automatically delete associated permissions (must be done through a separate request).
- The API is verb-agnostic (GET, POST, etc.). Examples use GET for simplicity.
- URL parameters must be URL-encoded (e.g., All Entra ID Members → All%20Entra%20ID%20Members).
- Shares cannot be modified. Delete the first share, then create a new share.
Example: Export Shares and Permissions to CSV
This example uses the ListShares and ListPermissions endpoints to export every configured share, its path, and the users and groups assigned to it into a CSV file. It is a read-only operation and does not change any shares or permissions.
Run the steps below on the MyWorkDrive server.
1. Enable the Public API
In the MyWorkDrive Admin Panel, go to Enterprise, enable Public API, and save your changes. Copy the API key shown there. Treat this key like a password.
2. Run the export script
Open PowerShell on the MyWorkDrive server. Copy and run the complete script below, and paste your API key when prompted.
``` $apiKey = Read-Host "Enter your MyWorkDrive API key" $headers = @{ ApiKey = $apiKey } $baseUrl = "http://127.0.0.1:8360/api/v3"
$shares = Invoke-RestMethod -Headers $headers -Uri "$baseUrl/ListShares" -Method Get -ErrorAction Stop $permissions = Invoke-RestMethod -Headers $headers -Uri "$baseUrl/ListPermissions" -Method Get -ErrorAction Stop
$report = foreach ($share in $shares) { $matchingPermissions = @($permissions | Where-Object { $_.ShareName -eq $share.Name }) $users = $matchingPermissions | Where-Object { $_.IsGroup -eq $false } | ForEach-Object { if ($_.DomainName) { "$($_.DomainName)\$($_.Name)" } else { $_.Name } } $groups = $matchingPermissions | Where-Object { $_.IsGroup -eq $true } | ForEach-Object { if ($_.DomainName) { "$($_.DomainName)\$($_.Name)" } else { $_.Name } }
[PSCustomObject]@{
'Share Name' = $share.Name
'Share Path' = $share.Path
'Users' = ($users | Sort-Object -Unique) -join '; '
'Groups' = ($groups | Sort-Object -Unique) -join '; '
}
}
$desktop = [Environment]::GetFolderPath('Desktop') $fileName = "MyWorkDrive-Mappings-$(Get-Date -Format 'yyyyMMdd-HHmmss').csv" $csvPath = Join-Path $desktop $fileName
$report | Export-Csv -Path $csvPath -NoTypeInformation -Encoding UTF8 Write-Host "Export completed: $csvPath" ```
3. Open the exported file
When the script finishes, it displays the full path to the CSV. The file is saved to the Desktop of the Windows account that ran PowerShell, named MyWorkDrive-Mappings- followed by the date and time.
The CSV contains one row per share with these columns:
| Column | Description |
|---|---|
| Share Name | Name of the share in MyWorkDrive |
| Share Path | Storage path the share points to |
| Users | Users assigned to the share, formatted as DOMAIN\username |
| Groups | Groups assigned to the share, formatted as DOMAIN\groupname |
Multiple users or groups in a column are separated by semicolons. Entra ID groups have no domain and appear by name only.
Note: The report lists the users and groups assigned to each share in MyWorkDrive. It does not expand group membership or calculate effective NTFS or storage-level permissions. Recent changes made in the Admin Panel or through the API may take up to 5 minutes to appear due to caching.
Publishing for Remote Access
This API is designed to run on a private local network interface by default. Making it remotely accessible should be done with extreme caution.
IIS Bindings
The Management API is hosted on a separate IIS site WanPath.Admin.API with a single HTTP binding on port 8360. To restrict access the site only listens on 127.0.0.1. To allow remote access either allow the existing binding to listen on other addresses, or preferably create a new binding secured with a strong certificate.
SSL/TLS
The Management API can be secured with an HTTPS binding. Create a new binding for the WanPath.Admin.API site and add a certificate. The hostname in the binding should match the hostname in your certificate.
Firewall
The Management API makes no changes to any local firewalls. To allow remote access to your server you will need to allow inbound connections on your selected ports. 8360 is the default for HTTP connections. You will have chosen a custom port for HTTPS connections.