Permissions API
The Permissions API allows you to list, set, and remove folder permissions for users and groups in an Egnyte domain. Use this API to programmatically manage access control for folders, including setting permission levels, checking effective permissions, and controlling permission inheritance.
Note: Folder paths must be URL-encoded segment by segment. Do not encode forward slashes (/). For example, Shared/example?path/$file.txt should be encoded as Shared/example%3Fpath/%24file.txt.
Base URL
https://{domain}.egnyte.com/pubapi/v1/perms
https://{domain}.egnyte.com/pubapi/v2/perms
Authentication
All requests require an OAuth 2.0 Bearer token in the Authorization header:
Authorization: Bearer {access_token}
See Authentication for details on obtaining a token.
Permission Levels
Egnyte supports five permission levels that control what actions users and groups can perform on folders and files:
| Action | Viewer Only | Viewer | Editor | Full | Owner |
|---|---|---|---|---|---|
| Preview files in web UI | ✓ | ✓ | ✓ | ✓ | ✓ |
| Download/read files and folders | — | ✓ | ✓ | ✓ | ✓ |
| Copy files and folders | — | — | ✓ | ✓ | ✓ |
| Upload/edit files and folders | — | — | ✓ | ✓ | ✓ |
| Create subfolders | — | — | ✓ | ✓ | ✓ |
| Rename files and folders | — | — | ✓ | ✓ | ✓ |
| Create upload links | — | — | ✓ | ✓ | ✓ |
| Move files and folders | — | — | — | ✓ | ✓ |
| Delete files and folders | — | — | — | ✓ | ✓ |
| Edit folder sharing | — | — | — | — | ✓ |
Get Effective Permissions for a User
Retrieves the effective permissions for a specific user on a given folder. This takes into account both direct user permissions and group memberships, along with permission inheritance. If no username is specified, returns permissions for the authenticated user.
Request
GET /pubapi/v1/perms/user/{username}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | No | Username to check permissions for. If omitted, returns permissions for the authenticated user. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
folder | string | Yes | Absolute path to the folder (e.g., /Shared/Documents). |
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/perms/user/jsmith?folder=/Shared/Documents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
permission | string | Effective permission level: None, Nav, Viewer Only, Viewer, Editor, Full, or Owner. |
Example Response
{
"permission": "Full"
}
Get Folder Permissions
Retrieves all user and group permissions set on a specific folder, including permission inheritance status.
Request
GET /pubapi/v2/perms/{path}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Full path to the folder (e.g., Shared/Documents). Do not include a leading slash. |
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v2/perms/Shared/Documents" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
userPerms | object | Map of usernames to permission levels. |
groupPerms | object | Map of group names to permission levels. |
inheritsPermissions | boolean | Whether this folder inherits permissions from its parent. |
Example Response
{
"userPerms": {
"jsmith": "Full",
"ajones": "Viewer"
},
"groupPerms": {
"All Administrators": "Owner",
"Marketing Team": "Editor"
},
"inheritsPermissions": true
}
Set Folder Permissions
Sets or updates permissions for users and groups on a folder. This is a delta API — it only modifies the permissions you specify, leaving other permissions unchanged. To remove a permission, set it to None.
Request
POST /pubapi/v2/perms/{path}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Full path to the folder (e.g., Shared/Documents). Do not include a leading slash. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
userPerms | object | No | Map of usernames to permission levels. Valid permissions: None, Viewer Only, Viewer, Editor, Full, Owner. |
groupPerms | object | No | Map of group names to permission levels. Valid permissions: None, Viewer Only, Viewer, Editor, Full, Owner. |
inheritsPermissions | boolean | No | Whether the folder should inherit permissions from its parent. Only include when changing inheritance status. |
keepParentPermissions | boolean | No | When setting inheritsPermissions to false, whether to copy currently inherited permissions to this folder. Only valid when inheritsPermissions is false. |
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v2/perms/Shared/Documents" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "userPerms": { "jsmith": "Viewer", "ajones": "Editor" }, "groupPerms": { "Project Team": "Full", "Contractors": "None" } }'
Response
200 OK
Returns an empty response body on success.
Get Folder Permissions (v1)
Deprecated: Use the v2 endpoint instead. This v1 endpoint requires specifying users or groups as query parameters and is less efficient.
Retrieves permissions for specific users and groups on a folder.
Request
GET /pubapi/v1/perms/folder/{path}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Full path to the folder (e.g., Shared/MyFolder). Do not include a leading slash. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
users | string | No* | Pipe-separated list of usernames (e.g., jsmith|ajones). |
groups | string | No* | Pipe-separated list of group names (e.g., All Power Users|Marketing). |
* At least one of users or groups must be provided.
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/perms/folder/MyFolder?users=jsmith|ajones&groups=All%20Power%20Users" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
users | array | Array of user permission objects. |
users[].subject | string | Username. |
users[].permission | string | Permission level. |
groups | array | Array of group permission objects. |
groups[].subject | string | Group name. |
groups[].permission | string | Permission level. |
Example Response
{
"users": [
{
"subject": "jsmith",
"permission": "Full"
},
{
"subject": "ajones",
"permission": "Viewer"
}
],
"groups": [
{
"subject": "All Power Users",
"permission": "Editor"
}
]
}
Set Folder Permissions (v1)
Deprecated: Use the v2 endpoint instead. This v1 endpoint can only set one permission level at a time for multiple users or groups.
Sets the same permission level for multiple users or groups on a folder.
Request
POST /pubapi/v1/perms/folder/{path}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Full path to the folder (e.g., Shared/MyFolder). Do not include a leading slash. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
users | array | No* | Array of usernames to set permissions for. |
groups | array | No* | Array of group names to set permissions for. |
permission | string | Yes | Permission level to apply: None, Viewer Only, Viewer, Editor, Full, or Owner. |
* At least one of users or groups must be provided.
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/perms/folder/Shared/MyFolder" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "users": [ "jsmith", "ajones" ], "permission": "Viewer" }'
Response
200 OK
Returns an empty response body on success.
Error Codes
| Status | Error | Description | Resolution |
|---|---|---|---|
| 400 | Bad Request | Large group restriction | Only administrators can assign permissions to groups with more than 2,000 members. Contact Egnyte Support to adjust this threshold. |
| 401 | Unauthorized | Invalid or expired token | Refresh your OAuth token and retry the request. |
| 403 | Forbidden | Insufficient permissions | The authenticated user must have Owner permissions on the folder or be an administrator to modify permissions. |
| 404 | Not Found | Folder does not exist | Verify the folder path is correct and the folder exists. |
| 429 | Rate Limited | Too many requests | Implement exponential backoff and check the Retry-After header. |
Code Examples
GET /pubapi/v2/perms/Shared/Documents
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v2/perms/Shared/Documents" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
POST /pubapi/v2/perms/Shared/Documents
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v2/perms/Shared/Documents" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "userPerms": { "jsmith": "Viewer", "ajones": "Editor" }, "groupPerms": { "Project Team": "Full" } }'
Related Resources
- Authentication — How to obtain and refresh OAuth tokens
- File System API — Create, read, update, and delete files and folders
- Group Management API — Manage groups that can be assigned permissions
- User Management API — Manage users that can be assigned permissions
