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:

ActionViewer OnlyViewerEditorFullOwner
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

ParameterTypeRequiredDescription
usernamestringNoUsername to check permissions for. If omitted, returns permissions for the authenticated user.

Query Parameters

ParameterTypeRequiredDescription
folderstringYesAbsolute 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

FieldTypeDescription
permissionstringEffective 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

ParameterTypeRequiredDescription
pathstringYesFull 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

FieldTypeDescription
userPermsobjectMap of usernames to permission levels.
groupPermsobjectMap of group names to permission levels.
inheritsPermissionsbooleanWhether 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

ParameterTypeRequiredDescription
pathstringYesFull path to the folder (e.g., Shared/Documents). Do not include a leading slash.

Request Body

FieldTypeRequiredDescription
userPermsobjectNoMap of usernames to permission levels. Valid permissions: None, Viewer Only, Viewer, Editor, Full, Owner.
groupPermsobjectNoMap of group names to permission levels. Valid permissions: None, Viewer Only, Viewer, Editor, Full, Owner.
inheritsPermissionsbooleanNoWhether the folder should inherit permissions from its parent. Only include when changing inheritance status.
keepParentPermissionsbooleanNoWhen 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

ParameterTypeRequiredDescription
pathstringYesFull path to the folder (e.g., Shared/MyFolder). Do not include a leading slash.

Query Parameters

ParameterTypeRequiredDescription
usersstringNo*Pipe-separated list of usernames (e.g., jsmith|ajones).
groupsstringNo*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

FieldTypeDescription
usersarrayArray of user permission objects.
users[].subjectstringUsername.
users[].permissionstringPermission level.
groupsarrayArray of group permission objects.
groups[].subjectstringGroup name.
groups[].permissionstringPermission 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

ParameterTypeRequiredDescription
pathstringYesFull path to the folder (e.g., Shared/MyFolder). Do not include a leading slash.

Request Body

FieldTypeRequiredDescription
usersarrayNo*Array of usernames to set permissions for.
groupsarrayNo*Array of group names to set permissions for.
permissionstringYesPermission 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

StatusErrorDescriptionResolution
400Bad RequestLarge group restrictionOnly administrators can assign permissions to groups with more than 2,000 members. Contact Egnyte Support to adjust this threshold.
401UnauthorizedInvalid or expired tokenRefresh your OAuth token and retry the request.
403ForbiddenInsufficient permissionsThe authenticated user must have Owner permissions on the folder or be an administrator to modify permissions.
404Not FoundFolder does not existVerify the folder path is correct and the folder exists.
429Rate LimitedToo many requestsImplement 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"
  }
}'
Reference →Browse all endpoints